CORE CONCEPTS5 min read
MCP Protocol
Understanding the Model Context Protocol (MCP) JSON-RPC interface
What is MCP?
The Model Context Protocol (MCP) is an open standard for connecting AI assistants to external data sources. It uses JSON-RPC 2.0 over HTTP, making it easy to integrate with Claude, ChatGPT, and other AI systems.
Endpoint URL
text
POST https://app.conexor.io/mcp/{organization-slug}/{endpoint-name}
Headers:
Content-Type: application/json
X-API-Key: mcp_xxxxx (or Authorization: Bearer {token})Methods
initialize
Negotiate protocol version and capabilities
json
// Request
{"jsonrpc":"2.0","id":1,"method":"initialize","params":{"protocolVersion":"2024-11-05"}}
// Response
{"jsonrpc":"2.0","id":1,"result":{"protocolVersion":"2024-11-05","capabilities":{"tools":{"listChanged":false},"resources":{"subscribe":false}},"serverInfo":{"name":"Sales API","version":"1.0.0"}}}tools/list
List available tools
json
// Request
{"jsonrpc":"2.0","id":2,"method":"tools/list"}
// Response
{"jsonrpc":"2.0","id":2,"result":{"tools":[{"name":"get_orders","description":"Retrieve orders","inputSchema":{"type":"object","properties":{"customerId":{"type":"integer"}}}}]}}tools/call
Execute a tool
json
// Request
{"jsonrpc":"2.0","id":3,"method":"tools/call","params":{"name":"get_orders","arguments":{"customerId":123}}}
// Response
{"jsonrpc":"2.0","id":3,"result":{"content":[{"type":"text","text":"[{"orderId":1,"total":99.99}]"}],"isError":false}}resources/list
List available resources (skills)
json
// Request
{"jsonrpc":"2.0","id":4,"method":"resources/list"}
// Response
{"jsonrpc":"2.0","id":4,"result":{"resources":[{"uri":"skill://explain-sales","name":"Explain Sales Data","mimeType":"text/markdown"}]}}resources/read
Read a resource by URI
json
// Request
{"jsonrpc":"2.0","id":5,"method":"resources/read","params":{"uri":"skill://explain-sales"}}
// Response
{"jsonrpc":"2.0","id":5,"result":{"contents":[{"uri":"skill://explain-sales","mimeType":"text/markdown","text":"# Explain Sales..."}]}}ping
Health check
json
// Request
{"jsonrpc":"2.0","id":6,"method":"ping"}
// Response
{"jsonrpc":"2.0","id":6,"result":{}}Error Handling
json
// Error response format
{
"jsonrpc": "2.0",
"id": 3,
"error": {
"code": -32602,
"message": "Invalid params: missing required parameter 'customerId'"
}
}