MCP Server Overview

Cortex exposes a permissioned MCP gateway for AI agents.

Cortex implements the Model Context Protocol (MCP) as a Streamable HTTP endpoint. Every tool call executes under the agent's acting user identity — role-scoped filtering, citations, and audit apply automatically.

Gateway Endpoint

POST /mcp

The gateway is stateless — each request builds a per-agent server instance so tools are bound to the acting user's identity.

Authentication

Every request must include a valid agent key:

Authorization: Bearer crtx_...

Or via header:

x-cortex-agent-key: crtx_...

Unauthenticated requests never reach a tool. The gateway returns 401 Unauthorized with a JSON-RPC error.

Available Tools

ToolDescription
recallScope-filtered semantic search with citations
rememberStore a memory (only into scopes you can read)
list_memoriesRecent memories visible to your role
get_factDeterministic fact from the registry — never a vector guess

Response Format

All tools return JSON-RPC responses with structured content:

{
  "content": [
    {
      "type": "text",
      "text": "{ ... }"
    }
  ]
}

Error Handling

Denials are explicit — if your role isn't cleared for something, the tool returns a denial object with reason and allowed scopes. Denials are always logged to the audit trail.

Next Steps