Skip to content
dhanu docs
Browse pages

API reference

MCP server

POST /api/pub/v1/mcp, the Model Context Protocol endpoint for AI clients.

POSThttps://api.dhanu.ai/api/pub/v1/mcp

The 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

FieldTypeRequiredNotes
jsonrpcstringYes
idanyNoAbsent on a notification.
methodstringYesinitialize, ping, tools/list, tools/call or notifications/initialized.
paramsobjectNo
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

CodeStatusMeaning
invalid_api_key401The bearer key is missing or unknown.
api_key_revoked401The key was revoked.
api_key_expired401The key passed its expiry date.
api_key_ip_not_allowed403The caller's IP is outside the key's allowlist.
developer_access_revoked403The key's creator lost developer access in the workspace.
api_key_project_scope403The 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.