The MCP server is a JSON-RPC 2.0 dispatcher mounted at POST /api/mcp. All
methods are invoked through the same request envelope, and all failures stay
inside the JSON-RPC error envelope at HTTP 200 — they never use the REST
error shape.
Request envelope
{
"jsonrpc": "2.0",
"id": 1,
"method": "ping",
"params": {}
}
| Field | Type | Required | Description |
|---|
jsonrpc | "2.0" | Yes | Protocol version; must be exactly "2.0". |
id | string | number | null | No | Echoed back on the response. Omit or null for a notification. |
method | string | Yes | The method (tool) to invoke. |
params | object | No | Method parameters. |
Success response
{
"jsonrpc": "2.0",
"id": 1,
"result": { "pong": true }
}
Error response
{
"jsonrpc": "2.0",
"id": 1,
"error": { "code": -32601, "message": "Method not found" }
}
Error codes
| Code | Meaning | When |
|---|
-32700 | Parse error | The body wasn’t valid JSON. |
-32600 | Invalid Request | The body wasn’t a valid JSON-RPC request. |
-32601 | Method not found | The method isn’t a registered tool. |
-32603 | Internal error | The tool threw while handling the request. |
Authentication failures are the one exception: a missing or invalid API key is rejected by
middleware before the JSON-RPC dispatcher runs, so it returns a REST 401 rather than a
JSON-RPC error.
Example
curl -X POST https://api-atlaswork.vercel.app/api/mcp \
-H "Authorization: Bearer $ATLAS_API_KEY" \
-H "Content-Type: application/json" \
-d '{ "jsonrpc": "2.0", "id": 1, "method": "ping", "params": {} }'
{ "jsonrpc": "2.0", "id": 1, "result": { "pong": true } }