POST
/api/mcpModel Context Protocol (MCP) API
Standardized JSON-RPC 2.0 endpoint implementing the Model Context Protocol specification for tool discovery and execution.
JSON-RPC 2.0 Specification
All requests to /api/mcp must provide a JSON-RPC 2.0 envelope containing jsonrpc: "2.0", a unique request id, and a method string.
Method: listTools
Request payload:
json
{
"jsonrpc": "2.0",
"id": "req-001",
"method": "listTools"
}Response:
json
{
"jsonrpc": "2.0",
"id": "req-001",
"result": {
"tools": [
{
"name": "query_database",
"description": "Execute governed SQL queries against the Northwind database schema.",
"inputSchema": {
"type": "object",
"properties": {
"sql": {
"type": "string",
"description": "The ANSI SQL query to execute."
}
},
"required": ["sql"]
}
}
]
}
}Method: callTool
Request payload:
json
{
"jsonrpc": "2.0",
"id": "req-002",
"method": "callTool",
"params": {
"name": "query_database",
"arguments": {
"sql": "SELECT COUNT(*) AS total_customers FROM Customers;"
}
}
}Response:
json
{
"jsonrpc": "2.0",
"id": "req-002",
"result": {
"content": [
{
"type": "text",
"text": "[\n {\n \"total_customers\": 91\n }\n]"
}
]
}
}JSON-RPC Error Codes
-32601 Method not foundMethod other than listTools or callTool called
-32603 Internal errorDatabase offline or credentials not configured