MCP protocol endpoints for agent and tools servers
cURL
curl --request POST \ --url http://127.0.0.1:8765/messages/ \ --header 'Content-Type: application/json' \ --header 'X-API-Key: <api-key>' \ --data ' { "jsonrpc": "<string>", "method": "<string>", "params": {}, "id": 123, "params.name": "<string>", "params.arguments": {}, "params.protocolVersion": "<string>", "params.capabilities": {}, "params.clientInfo": {} } '
Agent.launch(protocol="mcp")
ToolsMCPServer
# Start MCP server agent.launch(protocol="mcp", port=8080)
http://localhost:8080
curl -N http://localhost:8080/sse
curl -X POST http://localhost:8080/messages/ \ -H "Content-Type: application/json" \ -d '{"jsonrpc": "2.0", "method": "tools/list", "id": 1}'
{ "jsonrpc": "2.0", "id": 1, "result": { "tools": [ { "name": "execute_assistant_task", "description": "Executes the agent's primary task with the given prompt.", "inputSchema": { "type": "object", "properties": { "prompt": {"type": "string"} }, "required": ["prompt"] } } ] } }
{ "jsonrpc": "2.0", "id": 1, "result": { "tools": [ { "name": "search", "description": "Search the web for information.", "inputSchema": { "type": "object", "properties": { "query": {"type": "string"} }, "required": ["query"] } } ] } }
curl -X POST http://localhost:8080/messages/ \ -H "Content-Type: application/json" \ -d '{ "jsonrpc": "2.0", "method": "tools/call", "params": { "name": "search", "arguments": {"query": "AI news"} }, "id": 2 }'
{ "jsonrpc": "2.0", "id": 2, "result": { "content": [ { "type": "text", "text": "Results for: AI news" } ] } }
curl -X POST http://localhost:8080/messages/ \ -H "Content-Type: application/json" \ -d '{ "jsonrpc": "2.0", "method": "initialize", "params": { "protocolVersion": "2024-11-05", "capabilities": {}, "clientInfo": {"name": "test-client", "version": "1.0.0"} }, "id": 0 }'
{ "jsonrpc": "2.0", "id": 0, "result": { "protocolVersion": "2024-11-05", "capabilities": {"tools": {}}, "serverInfo": {"name": "praisonai-tools", "version": "1.0.0"} } }
{ "jsonrpc": "2.0", "id": 1, "error": { "code": -32601, "message": "Method not found" } }
-32700
-32600
-32601
-32602
-32603