Keyboard shortcuts

Press or to navigate between chapters

Press S or / to search in the book

Press ? to show this help

Press Esc to hide this help

MCP Server

Expose agents as MCP (Model Context Protocol) tool servers. Each agent with MCP enabled gets its own endpoint that accepts JSON-RPC 2.0 requests.

POST /api/v1/mcp/

Send a JSON-RPC 2.0 MCP request to the named agent.

List tools

Request

{
  "jsonrpc": "2.0",
  "id": 1,
  "method": "tools/list",
  "params": {}
}

Response 200 OK

{
  "jsonrpc": "2.0",
  "id": 1,
  "result": {
    "tools": [
      {
        "name": "search_logs",
        "description": "Search log files for a pattern",
        "inputSchema": {
          "type": "object",
          "properties": {
            "pattern": {"type": "string"},
            "path": {"type": "string"}
          },
          "required": ["pattern"]
        }
      }
    ]
  }
}

Call a tool

Request

{
  "jsonrpc": "2.0",
  "id": 2,
  "method": "tools/call",
  "params": {
    "name": "search_logs",
    "arguments": {"pattern": "ERROR", "path": "/var/log/app.log"}
  }
}

Response 200 OK

{
  "jsonrpc": "2.0",
  "id": 2,
  "result": {
    "content": [
      {"type": "text", "text": "Found 3 matches in /var/log/app.log"}
    ]
  }
}

Error responses

MCP errors use standard JSON-RPC error codes:

CodeMeaning
-32600Invalid request
-32601Method not found
-32602Invalid params
-32603Internal error

Returns HTTP 404 if {agent_name} does not exist or does not have MCP enabled.