Logo IconGuided Mind
v2.4Sign In
Integration

MCP Overview

Connect AI agents to GuidedMind via Model Context Protocol with SSE transport.

The Model Context Protocol (MCP) lets AI agents access your RAG system as standard tools. GuidedMind implements MCP over SSE (Server-Sent Events) transport.

Architecture

Connection Endpoints

EndpointMethodPurpose
/api/v1/mcp/sseGETEstablish SSE connection
/api/v1/mcp/messagesPOSTSend JSON-RPC messages
/api/v1/mcp/healthGETHealth check

Connecting

Step 1: Open SSE Connection

curl -N "https://api.guidedmind.ai/api/v1/mcp/sse?api_key=rk_your_key_here"

Response:

event: open
data: {"session_id": "uuid-here", "message_endpoint": "/api/v1/mcp/messages?session_id=uuid-here"}

Step 2: Send JSON-RPC Messages

curl -X POST "https://api.guidedmind.ai/api/v1/mcp/messages?session_id=YOUR_SESSION_ID" \
  -H "Content-Type: application/json" \
  -d '{
    "jsonrpc": "2.0",
    "id": 1,
    "method": "tools/list",
    "params": {}
  }'

JSON-RPC Format

All messages follow JSON-RPC 2.0:

{
  "jsonrpc": "2.0",
  "id": 1,
  "method": "tools/call",
  "params": {
    "name": "rag_search",
    "arguments": {
      "query": "What is RAG?"
    }
  }
}

Available Tools

ToolPurpose
rag_searchSearch your document index
upload_documentUpload a document
upload_and_processUpload and process immediately

See MCP Per Tool for detailed parameter documentation.

Authentication

Pass your API key as a query parameter on the SSE connection:

/api/v1/mcp/sse?api_key=rk_your_key_here

The session ID from the open event is then used for all subsequent message requests.

Each SSE session is single-use. Create a new connection for each agent session.

Error Handling

Errors are returned as JSON-RPC error responses:

{
  "jsonrpc": "2.0",
  "id": 1,
  "error": {
    "code": -32601,
    "message": "Method not found"
  }
}
CodeMeaning
-32700Parse error
-32600Invalid request
-32601Method not found
-32602Invalid params
-32000Server error

Valid Methods

MethodPurpose
initializeInitialize MCP session
tools/listList available tools
tools/callCall a specific tool