Skip to content

MCP Server

Every running ReflexDB instance exposes a Model Context Protocol (MCP) server, so AI agents — Claude, Cursor, or any MCP-capable client — can read your schema and run queries against the instance’s in-memory snapshot directly, without you wiring up an integration.

The server runs inside the instance itself (alongside the query engine) and is reached over Streamable HTTP.

https://<instance-id>.reflexdb.cloud/mcp

The MCP server uses the same per-instance API keys as the Query API (rxk_…), created in the dashboard under Database → API Keys. Pass the key one of two ways:

  • Authorization: Bearer rxk_<keyId>.<hmac> — for clients that let you set request headers.
  • ?key=rxk_<keyId>.<hmac> as a query parameter — for connectors (such as claude.ai) that only accept a URL and can’t set a custom header. The key is still protected by HTTPS in transit.
  1. Create an API key in the dashboard: Database → API Keys.

  2. Add the server to your client.

    claude.ai — open Settings → Connectors → Add custom connector, and paste the URL with your key in the query string:

    https://<instance-id>.reflexdb.cloud/mcp?key=rxk_<keyId>.<hmac>

    Generic MCP client (Cursor, Claude Desktop, or your own) — point it at the endpoint with a Bearer header:

    {
    "mcpServers": {
    "reflexdb": {
    "url": "https://<instance-id>.reflexdb.cloud/mcp",
    "headers": { "Authorization": "Bearer rxk_<keyId>.<hmac>" }
    }
    }
    }
  3. Verify with a raw handshake if you want to confirm connectivity:

    Terminal window
    curl -sN https://<instance-id>.reflexdb.cloud/mcp \
    -H "Authorization: Bearer rxk_<keyId>.<hmac>" \
    -H "Accept: application/json, text/event-stream" \
    -H "Content-Type: application/json" \
    -d '{"jsonrpc":"2.0","id":1,"method":"initialize","params":{"protocolVersion":"2024-11-05","capabilities":{},"clientInfo":{"name":"curl","version":"0"}}}'
ToolWhat it does
queryRuns a Reflex DSL query against the instance’s snapshot and returns the JSON result. Query errors are passed through so the agent can self-correct.
check_healthReports whether the instance is online and serving. Use it after a failed query to tell a syntax error apart from an availability problem.
validate_configValidates a reflexdb.yaml config — checks syntax and structure against the full engine spec, returning structured errors.
ResourceContents
reflexdb://schema/openapiThe instance’s OpenAPI spec — the exact tables, fields, relations, and query syntax for this instance. Read it before constructing queries.
reflexdb://config/referenceThe complete reflexdb.yaml configuration reference — every key, type, default, and validation rule.