MCP

JSON-RPC 2.0 endpoint speaking Model Context Protocol 2024-11-05.

POST /api/mcp

Bearer apk_

Methods implemented:

| Method | Purpose | |---|---| | initialize | Capability + serverInfo handshake | | tools/list | Returns the tool registry | | tools/call | Invoke a tool by name | | ping | Keep-alive | | notifications/initialized | No-op acknowledgement |

Example: tools/list

curl -X POST https://api.sorenpay.com/api/mcp \
-H "Authorization: Bearer apk_…" \
-H "Content-Type: application/json" \
-d '{"jsonrpc":"2.0","id":1,"method":"tools/list"}'

Response:

{
"jsonrpc": "2.0",
"id": 1,
"result": {
  "tools": [
    {
      "name": "get_treasury",
      "description": "Get the workspace's current treasury snapshot...",
      "inputSchema": { "type": "object", "properties": {}, "additionalProperties": false }
    },

  ]
}
}

Example: tools/call

curl -X POST https://api.sorenpay.com/api/mcp \
-H "Authorization: Bearer apk_…" \
-H "Content-Type: application/json" \
-d '{
  "jsonrpc": "2.0",
  "id": 2,
  "method": "tools/call",
  "params": { "name": "get_treasury", "arguments": {} }
}'

Error codes

| Code | Meaning | |---|---| | -32700 | Parse error | | -32600 | Invalid JSON-RPC request | | -32601 | Method or tool not found | | -32602 | Invalid params (Zod validation failed) | | -32603 | Internal error | | -32001 | Unauthorized (apk_ missing/invalid, or missing scope) | | -32010 | Tool execution error |

See the MCP tool reference for tool-specific schemas.