Connecting Agents

How to connect Claude Code, Cursor, and other AI agents to Cortex.

Cortex works with any MCP-compatible AI agent — Claude Code, opencode, Cursor, Windsurf, VS Code, and custom clients. Here's how to connect popular tools.

Fastest path: paste a prompt

The onboarding "Connect your coding agents" step gives you a ready-made prompt you can paste into any agentic tool (Claude Code, opencode, etc.). The agent then wires up the Cortex MCP itself:

Add a remote MCP server named "cortex" to my configuration.
- Transport: Streamable HTTP
- URL: https://your-cortex-host/mcp
- Auth header: Authorization: Bearer crtx_YOUR_KEY_HERE

Then use the cortex tools to look up my company's governed memories,
facts, and policies before answering questions. Confirm once it's connected.

Prefer to configure it yourself? Use the per-tool JSON below. The Cortex MCP is a remote Streamable-HTTP server at <host>/mcp with Bearer auth — there is no local process to install.

Claude Code

Using the CLI

claude mcp add --transport http cortex https://your-cortex-host/mcp \
  --header "Authorization: Bearer crtx_YOUR_KEY_HERE"

Manual Configuration

Add to your Claude Code MCP configuration:

{
  "mcpServers": {
    "cortex": {
      "url": "https://your-cortex-host/mcp",
      "headers": {
        "Authorization": "Bearer crtx_YOUR_KEY_HERE"
      }
    }
  }
}

Cursor

Add to .cursor/mcp.json in your project root:

{
  "mcpServers": {
    "cortex": {
      "url": "https://your-cortex-host/mcp",
      "headers": {
        "Authorization": "Bearer crtx_YOUR_KEY_HERE"
      }
    }
  }
}

Cursor supports Streamable HTTP transport natively. No additional configuration needed.

WindSurf

Add to your WindSurf MCP configuration:

{
  "mcpServers": {
    "cortex": {
      "serverUrl": "https://your-cortex-host/mcp",
      "headers": {
        "Authorization": "Bearer crtx_YOUR_KEY_HERE"
      }
    }
  }
}

Custom Agents

For custom MCP clients, send a POST request to /mcp with:

Headers

Content-Type: application/json
Authorization: Bearer crtx_YOUR_KEY_HERE

Request Body

{
  "jsonrpc": "2.0",
  "id": 1,
  "method": "tools/call",
  "params": {
    "name": "recall",
    "arguments": {
      "query": "rate limiting policy"
    }
  }
}

Response

{
  "jsonrpc": "2.0",
  "id": 1,
  "result": {
    "content": [
      {
        "type": "text",
        "text": "{ \"ok\": true, \"results\": [...] }"
      }
    ]
  }
}

Verifying the Connection

Test your connection with a simple recall:

curl -X POST https://your-cortex-host/mcp \
  -H "Content-Type: application/json" \
  -H "Authorization: Bearer crtx_YOUR_KEY_HERE" \
  -d '{
    "jsonrpc": "2.0",
    "id": 1,
    "method": "tools/call",
    "params": {
      "name": "recall",
      "arguments": {
        "query": "hello world"
      }
    }
  }'

You should receive a JSON-RPC response with either results or a denial message.

Troubleshooting

IssueSolution
401 UnauthorizedCheck your agent key is valid and starts with crtx_
Connection refusedVerify the MCP endpoint URL
No resultsYour role may not have access to any scopes — check with an admin
TimeoutEnsure your network can reach the Cortex host