Use Manager AGI Agents as MCP tools from a trusted server-side application. This guide covers setup, authentication, downstream authorization, calls, recovery, and stable errors.
Quick start
- In Web Admin, create an active third-party application, bind it to a company, and copy its App ID and App Secret.
- Assign an enabled Agent to that company. Only enabled, assigned Agents with effective published Skills are listed.
- Point an MCP Streamable HTTP client at
POST|GET|DELETE /openapi/v1/agents/mcpon your Engine HTTPS host. - Initialize a session, send
notifications/initialized, calltools/list, then call anagent_{id}tool.
The general assistant is not exported. Keep the App Secret on your server.
Authentication and authority scope
API environments:
- Test: https://aim-api-test.proton-system.com
- Production: https://aim-api.proton-system.com
Every request must include Authorization: Basic Base64(KEY:SECRET), where KEY is the App ID and SECRET is the App Secret. Also send the content-negotiation headers shown below.
Authorization: Basic Base64(KEY:SECRET)
Content-Type: application/json
Accept: application/json, text/event-streamA remote MCP client that supports custom request headers can use the following configuration:
{
"mcpServers": {
"manager-agi": {
"url": "https://xxx.com/openapi/v1/agents/mcp",
"headers": {
"Authorization": "Basic <Base64(AppID:AppSecret)>"
}
}
}
}An active third-party application is permanently approved at company scope: existing and newly assigned Agents and their newly published Skills become reachable without a human approval step, including write or high-risk operations. CompanyRole does not narrow this authority. The Engine still enforces application, company, Agent, assignment, Skill publication, downstream authorization, schema/risk drift, validation, rate limits, idempotency, and audit controls.
Initialize and manage a session
Initialize with a supported MCP protocol version, then save the Mcp-Session-Id response header.
{"jsonrpc":"2.0","id":1,"method":"initialize","params":{"protocolVersion":"2025-11-25","capabilities":{},"clientInfo":{"name":"partner-server","version":"1.0.0"}}}{"jsonrpc":"2.0","method":"notifications/initialized"}Send Mcp-Session-Id on later POST, GET, and DELETE requests. Reinitialize after INVALID_MCP_SESSION.
Agent tools and metadata
Discover tools after initialization:
{"jsonrpc":"2.0","id":2,"method":"tools/list","params":{}}Each tool is named agent_{id}, using the exact Agent ID after the prefix. Its top-level title is the Agent name, and its description is the Agent description with the name as fallback. _meta.easyposAgent contains public id, name, description, and iconUrl. Its sibling authorizationRequirements contains deduplicated downstream requirements: mcpHubId, mcpHubName, authType, status, expiresAt, authorized, and, when authorization is needed, the Engine-owned authorizationUrl. Prompts, quick questions, Skill definitions, internal tool schemas, and credentials are not exposed.
Downstream authorization
When status is MISSING or REAUTH_REQUIRED, open the Engine-owned authorizationUrl, which starts at /openapi/v1/mcp/authorization/start. After the user finishes, retry tools/list or the original tools/call; ACTIVE means the Engine can execute with its stored application-scoped grant. Expiration or a downstream 401 returns an authorization error and requires the same flow again. Do not refresh tokens, send downstream headers, or automatically replay the failed business call.
Call an Agent
Use the exact tool name returned by tools/list. Add _meta.progressToken if you want standard MCP progress notifications.
{"jsonrpc":"2.0","id":3,"method":"tools/call","params":{"name":"agent_a441d514-2aed-4b86-b12f-7cce1bd90134","arguments":{"requestId":"req-20260825-001","message":"Summarize today's open orders","conversationId":"optional-existing-id"},"_meta":{"progressToken":"req-20260825-001"}}}requestId is required, trimmed, and at most 128 UTF-8 bytes. message is required and at most 16 KiB. conversationId is optional and may only be reused by the same application, company, and Agent.
A successful tool result includes "status":"COMPLETED", "answer", requestId, conversationId, Agent display metadata, and current authorizationRequirements. Missing downstream credentials return isError:true, status:"authorization_required", and errorCode:"MCP_AUTHORIZATION_REQUIRED" without creating an execution.
SSE, resume, cancellation, and close
With Accept: application/json, text/event-stream, consume standard MCP progress notifications and one final tool result. To replay a disconnected stream, GET the same endpoint with Basic authentication plus Mcp-Session-Id, opaque Last-Event-ID, EasyPOS-Agent-Request-Id, EasyPOS-Agent-Id, and Accept: text/event-stream. Replay restores persisted events and never reruns the Agent; if more remain, repeat GET with the newest cursor.
An explicit MCP cancellation only requests cancellation, and dispatched side effects are not rolled back. A transport disconnect does not cancel accepted work. Close a session with authenticated DELETE and Mcp-Session-Id.
Limits and idempotency
| Boundary | Contract |
|---|---|
| Call input | requestId 128 bytes; message 16 KiB; POST body 256 KiB |
| Accepted calls | Agent MCP does not impose a call-rate limit; conversation leases, idempotency, and input-size limits still apply |
| Idempotency/replay retention | 90 days |
| Stream replay | At most 256 stored events and 64 events returned per GET |
requestId is idempotent within one application for 90 days. The same normalized input replays the stored/in-progress outcome without consuming another execution unit. Different input returns IDEMPOTENCY_CONFLICT; a still-running request may return REQUEST_IN_PROGRESS.
Error contract
Transport failures use an HTTP status and JSON such as {"code":"COMPANY_INACTIVE","description":"The company is inactive."}. MCP/domain failures use isError:true, errorCode, and errorDescription in structured Tool output. Descriptions are stable, non-sensitive English text; branch on the code.
| Code | Returned description |
|---|---|
METHOD_NOT_ALLOWED | The HTTP method is not supported by this endpoint. |
INVALID_AUTHORIZATION_REQUEST | The authorization request is missing required or valid parameters. |
AUTHORIZATION_STATE_INVALID | The authorization state is invalid, expired, or already used. |
INVALID_APP_CREDENTIALS | The application credentials are missing or invalid. |
APPLICATION_INACTIVE | The third-party application is inactive. |
COMPANY_INACTIVE | The company is inactive. |
AGENT_MCP_UNAVAILABLE | The Agent MCP service is temporarily unavailable. |
ORIGIN_NOT_ALLOWED | The request origin is not allowed for this application. |
INVALID_REQUEST_AUTHORITY | The request authority cannot be used to build a secure public URL. |
INVALID_MCP_SESSION | The MCP session is missing, invalid, expired, or outside the application scope. |
EVENT_CURSOR_SCOPE_MISMATCH | The event cursor does not belong to the requested application, Agent, or request scope. |
INVALID_AGENT_STREAM_SCOPE | The Agent stream scope is missing or invalid. |
INVALID_EVENT_CURSOR | The event cursor is malformed. |
EVENT_REPLAY_UNAVAILABLE | The requested event replay is no longer available. |
AGENT_NOT_FOUND | The Agent does not exist. |
AGENT_DISABLED | The Agent is disabled. |
AGENT_NOT_ASSIGNED | The Agent is not assigned to this company. |
INVALID_AGENT_REQUEST | The Agent request input is missing or exceeds the supported limits. |
IDEMPOTENCY_CONFLICT | The requestId was already used with different input. |
REQUEST_IN_PROGRESS | The idempotent request is still in progress. |
CONVERSATION_SCOPE_MISMATCH | The conversation does not belong to this application, company, or Agent. |
CONVERSATION_BUSY | The conversation already has an active execution. |
AGENT_NO_EFFECTIVE_SKILLS | The Agent has no effective published Skills. |
AGENT_REQUEST_FAILED | The previously recorded Agent request failed. |
MCP_AUTHORIZATION_REQUIRED | Required downstream MCP authorization is missing. |
MCP_AUTHORIZATION_EXPIRED | The downstream MCP authorization has expired. |
SCHEMA_OR_RISK_DRIFT | A Tool schema or execution-risk change requires refreshed metadata. |
AGENT_TOOL_OUTCOME_UNKNOWN | A prior write Tool outcome is unknown and cannot be retried automatically. |
AGENT_TOOL_STEP_DRIFT | The retried Tool step does not match the persisted execution ledger. |
AGENT_TOOL_CONTINUATION_TOO_LARGE | The Agent Tool continuation exceeds the supported limit. |
REQUEST_CANCELLED | The Agent request was cancelled or exceeded its deadline. |
AGENT_EXECUTION_FAILED | The Agent execution failed without a safe public detail. |
Security and troubleshooting
Use TLS, store the App Secret in a secret manager, and redact authorization headers from logs. Never send the Secret from browser/mobile code, URLs, or source control. Server clients should omit Origin; if present, it must be an allowed HTTPS origin. Disable the application or reset its Secret after suspected exposure; existing sessions then become invalid.
If tools/list is empty, check company/Agent status, assignment, and effective published Skills. If authorization is required, open authorizationUrl and retry discovery or the call after completion. On invalid session, initialize again. The application's notification callbackUrl is not an Agent result channel: read execution results from MCP/SSE.