API reference
MCP server
POST /api/pub/v1/mcp, the Model Context Protocol endpoint for AI clients.
https://api.dhanu.ai/api/pub/v1/mcpThe remote MCP server: a stateless Streamable HTTP
endpoint that takes one JSON-RPC 2.0 request (or a batch) per POST and answers
with the response as JSON, or 202 with no body for a notification. It supports
initialize, ping, tools/list, tools/call and notifications/initialized;
the tools it offers, and the scope each needs, are listed on
MCP tools. Clients do not call this endpoint by hand, they
configure it as an MCP server.
Request
| Field | Type | Required | Notes |
|---|---|---|---|
jsonrpc | string | Yes | |
id | any | No | Absent on a notification. |
method | string | Yes | initialize, ping, tools/list, tools/call or notifications/initialized. |
params | object | No |
curl -X POST https://api.dhanu.ai/api/pub/v1/mcp \
-H "Authorization: Bearer $DHANU_API_KEY" \
-H "Content-Type: application/json" \
-d '{ "jsonrpc": "2.0", "id": 1, "method": "tools/list" }'
Response
200 OK
{ "jsonrpc": "2.0", "id": 1, "result": { "tools": [{ "name": "create_task", "description": "…", "inputSchema": { "type": "object", "properties": { "input": { "type": "string" } }, "required": ["input"] } }] } }
Errors
| Code | Status | Meaning |
|---|---|---|
invalid_api_key | 401 | The bearer key is missing or unknown. |
api_key_revoked | 401 | The key was revoked. |
api_key_expired | 401 | The key passed its expiry date. |
api_key_ip_not_allowed | 403 | The caller's IP is outside the key's allowlist. |
developer_access_revoked | 403 | The key's creator lost developer access in the workspace. |
api_key_project_scope | 403 | The key covers no active projects, or projectId is outside its scope. |
A tool that fails, a missing task, a scope the key lacks, invalid arguments, is a
200 whose result.isError is true; JSON-RPC errors (-32700 parse error,
-32600 invalid request, -32601 unknown method, -32602 unknown tool) describe a
malformed exchange rather than a failed tool.