Skip to content

Connect AI clients over MCP ​

Experimental. MCP keys are shown when the AI features are enabled (NEXT_PUBLIC_ENABLE_CHATBOT=true).

Basicrum runs a Model Context Protocol server, so AI clients such as Claude Code, Cursor, VS Code and Codex can query your RUM data directly. Ask things like "Which pages on shop.example.com regressed in LCP this week?" from your own editor.

The server exposes the same read-only tools as the Basicrum chat: Core Web Vitals per page, LCP, INP and CLS elements, period comparisons, top pages, page views over time and metric breakdowns. It can only read data from your organization's verified sites.

1. Create an MCP key ​

  1. In Basicrum, open Settings → API Keys → MCP Keys.
  2. Click Create MCP key and give it a name you'll recognize, such as "Cursor on my laptop".
  3. Copy the key. It starts with brum_ and is shown only once.

The key acts as you. If you leave the organization, your keys stop working. Admins can see and revoke every key in their organization.

2. Connect your client ​

The endpoint is your backend URL followed by /backend/v1/mcp, for example https://basicrum.example.com/backend/v1/mcp. The key goes in the Authorization header. The create dialog shows these snippets already filled in.

Claude Code ​

bash
claude mcp add --scope user --transport http basicrum \
  https://basicrum.example.com/backend/v1/mcp \
  --header "Authorization: Bearer brum_…"

Start a new session afterwards; /mcp should list basicrum as connected. Without --scope user, the server is only available in the folder where you ran the command.

Cursor ​

Add to ~/.cursor/mcp.json:

json
{
  "mcpServers": {
    "basicrum": {
      "url": "https://basicrum.example.com/backend/v1/mcp",
      "headers": { "Authorization": "Bearer brum_…" }
    }
  }
}

VS Code ​

Add to .vscode/mcp.json in your workspace, or to your user MCP configuration:

json
{
  "servers": {
    "basicrum": {
      "type": "http",
      "url": "https://basicrum.example.com/backend/v1/mcp",
      "headers": { "Authorization": "Bearer brum_…" }
    }
  }
}

Codex ​

Add to ~/.codex/config.toml:

toml
[mcp_servers.basicrum]
url = "https://basicrum.example.com/backend/v1/mcp"
http_headers = { "Authorization" = "Bearer brum_…" }

To keep the key out of the file, replace http_headers with bearer_token_env_var = "BASICRUM_API_KEY" and export BASICRUM_API_KEY in your shell instead.

Don't commit a file that contains your key.

Good to know ​

  • Sites. Every tool that reads data takes a site, which must be one of your organization's verified sites. If the organization has none yet, the server answers with an error asking you to verify one.
  • Time zones. Date ranges are Unix timestamps. Hour and day buckets are in UTC unless the client passes a timeZone such as Europe/Berlin.
  • Revoking. Open the key in MCP Keys and click Revoke key. Clients using it lose access immediately.
  • Web connectors. The claude.ai and ChatGPT web connectors only accept a URL and expect OAuth, which Basicrum doesn't support yet. Use a client that lets you set a header.

Troubleshooting ​

SymptomCause
401 with "Send a Basicrum API key…"The header is missing, the key was revoked, or its owner was removed from the organization.
403 "no verified sites"Verify a site in Settings → Sites first.
405 on GETExpected. The server is stateless and only answers POST.
The client doesn't list the serverMCP servers load when a session starts; restart the client or open a new session.