MCP / Agents
Platform MCP tool execution and AI Agent integration: connecting external clients to the MCP server, and how Agents initiate tool executions with approval and billing.
Overview
Through its built-in model gateway, the platform provides capabilities in two directions:
- MCP server (exposed externally): the gateway's native
POST /mcp(JSON-RPC 2.0 + SSE) is the external service endpoint, authenticated with platform API Keys (Authorization: Bearer sk-tp-...). External clients (Claude, Cursor, etc.) simply point their MCP server address athttp://<host>:8080/mcpand include the platform key; the tool surface is narrowed by governance configuration. - Agent tool execution (platform approval flow): An AI Agent (attached to a platform account, provisioned by an admin with its own API Key) initiates tool executions through the platform proxy endpoint. All executions enter a manual approval queue by default, and once approved the platform executes them on the Agent's behalf and bills per call.
Agent tool execution
Initiating an execution
- Authentication:
Authorization: Bearer <Agent's API Key>(issued by an administrator when provisioning the Agent in the admin console; returned only once) - Content-Type:
application/json
Request body:
| Parameter | Type | Required | Description |
|---|---|---|---|
| toolName | string | Yes | Tool name (must be within the Agent's tool allowlist) |
| argsJson | string | No | Tool arguments as a JSON string; defaults to '{}' |
Behavior: after the allowlist and daily quota checks pass, an approval request is created (PENDING). A tool outside the allowlist returns 403; if the daily quota has been fully charged, returns 429.
Querying execution records
Returns the Agent's 50 most recent approval requests (status, arguments, execution result).
Approval and billing
Tool executions are approved or rejected by a platform administrator on the "Tool approvals" page in the admin console. Once approved, the platform calls the upstream on the Agent's behalf and bills per call:
- Unit price: configurable per tool (default ¥0.01/call)
- Billing: costs are recorded to the Agent's attached account (balance, ledger, and usage details are updated together; in usage details,
modelistool:<tool name>) - Daily quota: each Agent can have a configurable daily charge limit
Error codes
| Status code | Meaning |
|---|---|
| 401 | Invalid API Key, or not an Agent key |
| 403 | Tool not in the Agent's allowlist, or the Agent is disabled |
| 429 | The Agent's daily quota is exhausted |