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:
| Code | Meaning |
|---|---|
-32600 | Invalid request |
-32601 | Method not found |
-32602 | Invalid params |
-32603 | Internal error |
Returns HTTP 404 if {agent_name} does not exist or does not have MCP enabled.