Skip to main content

CtrlB MCP

CtrlB exposes an MCP (Model Context Protocol) endpoint that lets AI-powered code editors query your observability data, investigate incidents, and explore telemetry — all without leaving your IDE.

  • Server URL: Unique per customer — contact the CtrlB support team to get your endpoint.
  • Transport: HTTP (Streamable HTTP)
  • Authentication: Bearer token via Authorization header

Prerequisites

  • A CtrlB API key (this is separate from your data ingestion key)
  • Your customer-specific MCP server URL (reach out to the CtrlB support team)
  • One of the supported editors listed below

VS Code

VS Code supports MCP servers natively through GitHub Copilot's agent mode. Configuration is stored in an mcp.json file — either per-workspace (.vscode/mcp.json) or globally via the MCP: Open User Configuration command.

Setup

  1. Open the Command Palette (Ctrl+Shift+P / Cmd+Shift+P).
  2. Run MCP: Open User Configuration (for global access) or create .vscode/mcp.json in your workspace root (for project-scoped access).
  3. Add the following configuration:
{
"inputs": [
{
"type": "promptString",
"id": "ctrlb-api-key",
"description": "CtrlB MCP API Key",
"password": true
}
],
"servers": {
"ctrlb": {
"type": "http",
"url": "<SERVER_URL>",
"headers": {
"Authorization": "Bearer ${input:ctrlb-api-key}"
}
}
}
}
  1. VS Code will prompt you for the API key when the server starts for the first time. The value is stored securely and reused for subsequent sessions.

Verify

  • Open the Command Palette and run MCP: List Servers — you should see ctrlb listed.
  • Switch to Agent mode in the Copilot chat panel to use CtrlB tools.

Claude Code

Claude Code supports remote MCP servers over HTTP transport directly from the CLI.

Setup

Run the following command in your terminal:

claude mcp add --transport http ctrlb <SERVER_URL> \
--header "Authorization: Bearer <YOUR_CTRLB_API_KEY>"

Replace <YOUR_CTRLB_API_KEY> with your actual API key.

Scoping

Use the --scope flag to control where the configuration is stored:

ScopeFlagDescription
Local (default)--scope localAvailable only to you in the current project
Project--scope projectShared with team via .mcp.json in the project root
User--scope userAvailable to you across all projects

Example with user scope:

claude mcp add --transport http ctrlb <SERVER_URL> \
--header "Authorization: Bearer <YOUR_CTRLB_API_KEY>" \
--scope user

Alternative: JSON configuration

You can also add the server directly from a JSON snippet:

claude mcp add-json ctrlb '{
"type": "http",
"url": "<SERVER_URL>",
"headers": {
"Authorization": "Bearer <YOUR_CTRLB_API_KEY>"
}
}'

Verify

claude mcp list       # List all configured servers
claude mcp get ctrlb # Check details for the CtrlB server

Within a Claude Code session, run /mcp to view server status interactively.

Cursor

Cursor supports MCP servers through its settings UI or by editing the configuration file directly.

Setup

  1. Open Cursor Settings (Cmd+Shift+P / Ctrl+Shift+P → "Cursor Settings").

  2. Navigate to Tools & IntegrationsMCP Tools.

  3. Click New MCP Server and select Streamable HTTP as the type.

  4. Alternatively, edit the configuration file directly at:

    • macOS / Linux: ~/.cursor/mcp.json
    • Windows: %USERPROFILE%\.cursor\mcp.json

    Or create a project-scoped config at .cursor/mcp.json in your project root.

  5. Add the following configuration:

{
"mcpServers": {
"ctrlb": {
"url": "<SERVER_URL>",
"headers": {
"Authorization": "Bearer <YOUR_CTRLB_API_KEY>"
}
}
}
}

Replace <YOUR_CTRLB_API_KEY> with your actual API key.

Verify

  • Open Cursor Settings → Tools & Integrations. The CtrlB server should appear under MCP Tools with its available tools listed.
  • In the Composer panel, switch to Agent mode — the agent will automatically use CtrlB tools when relevant.

Windsurf

Windsurf (formerly Codeium) supports MCP via its Cascade AI agent. Configuration is managed through the mcp_config.json file.

Setup

  1. Open the MCP configuration file at:

    • macOS / Linux: ~/.codeium/windsurf/mcp_config.json
    • Windows: %USERPROFILE%\.codeium\windsurf\mcp_config.json

    You can also access it through: Windsurf SettingsCascadeMCP ServersView raw config.

  2. Add the following configuration:

{
"mcpServers": {
"ctrlb": {
"serverUrl": "<SERVER_URL>",
"headers": {
"Authorization": "Bearer <YOUR_CTRLB_API_KEY>"
}
}
}
}

Replace <YOUR_CTRLB_API_KEY> with your actual API key.

Note: Windsurf uses serverUrl (not url) for HTTP transport servers.

Using environment variables

Windsurf supports environment variable interpolation. To avoid hardcoding your API key:

{
"mcpServers": {
"ctrlb": {
"serverUrl": "<SERVER_URL>",
"headers": {
"Authorization": "Bearer ${env:CTRLB_API_KEY}"
}
}
}
}

Then set CTRLB_API_KEY in your shell environment before launching Windsurf.

Verify

  • Click the MCP servers button (hammer icon) in the Cascade chat panel.
  • Click Refresh to load the new server.
  • The CtrlB server and its tools should appear in the list.

Available Tools

Once connected, the following tools are exposed to your editor's AI agent.

Datasets

ToolDescription
list_datasetsList all available datasets for a given telemetry type (logs, traces, or metrics)
get_dataset_statsGet storage statistics (doc count, size, time range) for all datasets of a telemetry type
get_dataset_attributesGet the schema (field names and types) for a specific dataset

Logs

ToolDescription
search_logsQuery logs using SQL syntax.
get_histogramGet time-bucketed volume data for a dataset — useful for spotting spikes and trends

Traces

ToolDescription
get_traceRetrieve all spans for a distributed trace by trace ID
get_servicesList services with performance stats (latency, error rate, throughput) from a traces dataset

Alerts

ToolDescription
list_alert_conditionsList configured alert conditions, optionally filtered by telemetry type and dataset
list_alertsList triggered alerts with filters for dataset, status, and time range
get_alertGet details of a specific triggered alert by ID
get_active_alerts_countGet the count of currently active (triggered) alerts

Usage

ToolDescription
get_usage_statsGet data ingestion usage statistics for the workspace over a time period

Troubleshooting

Server not connecting

Ensure the CtrlB MCP endpoint is reachable. You can verify with a quick curl:

curl -X POST <SERVER_URL> \
-H "Content-Type: application/json" \
-H "Authorization: Bearer <YOUR_CTRLB_API_KEY>" \
-d '{"jsonrpc":"2.0","method":"initialize","params":{"protocolVersion":"2024-11-05","capabilities":{}},"id":1}'

If this fails, check your network connectivity and ensure your API key is valid.

Authentication errors

  • Verify your API key is correct and has not expired.
  • In VS Code, stop and restart the MCP server from the Command Palette (MCP: List Servers → select ctrlb → restart). VS Code will re-prompt for the API key.
  • In Claude Code, re-add the server with the updated key:
    claude mcp remove ctrlb
    claude mcp add --transport http ctrlb <SERVER_URL> \
    --header "Authorization: Bearer YOUR_NEW_KEY"
  • In Cursor and Windsurf, update the key directly in the config file and refresh.

Tools not appearing

  • VS Code / Cursor: Make sure you are in Agent mode — MCP tools are not available in standard chat mode.
  • Windsurf: Click the MCP servers button (hammer icon) in the Cascade panel and hit Refresh after adding or updating the config.
  • Claude Code: Run /mcp inside a session to check whether the server shows as connected.

Windsurf: url vs serverUrl

Windsurf uses serverUrl for remote HTTP servers. If you use url instead, the server may silently fail to connect. Always use serverUrl in mcp_config.json.

Timeout on startup

If the server takes longer than usual to initialize, increase the startup timeout:

  • Claude Code: Set the MCP_TIMEOUT environment variable before launching:
    MCP_TIMEOUT=15000 claude
  • Other editors: Check the MCP server logs in your editor's output panel. Common causes include network latency or transient connectivity issues.