Skip to Content

Connect to the CompetLab MCP Server

Before you begin

You need two things: an MCP-capable client that speaks Streamable HTTP (Claude Code, Claude Desktop, Claude on the web, Cursor, VS Code, Windsurf, or Cline), and a CompetLab API key. Getting the key is the only step that isn’t copy-and-paste, so start there.

1. Get your API key

In the CompetLab dashboard, open your organization’s Settings → API Keys and create a key. You’ll need the Owner or Admin role, and each organization can hold up to five active keys. Every key starts with cl_live_ and is 40 characters long — copy it when it’s shown, since you won’t be able to read it again.

Keep the key somewhere safe. It carries the same access your account has over the API, so treat it like a password.

2. Choose how to send your key

The key travels with every request, one of two ways:

MethodWhere the key goesUse it when
CL-API-Key headerAn HTTP header your client sendsYour client supports custom headers — Claude Code, Cursor, VS Code, Windsurf, Cline.
?api_key= query parameterAppended to the server URLYour client can’t send custom headers — Claude on the web is the main case.

If both are present, the header wins. The per-client configs below already use the right method for each client, so in practice you just paste and drop in your key.

3. Add the server to your client

Each client keeps its MCP config in a different place and format. Find yours below.

ClientConfig locationAuth
Claude Codethe claude mcp add commandheader
Cursor.cursor/mcp.jsonheader
VS Code (Copilot).vscode/mcp.jsonheader secure prompt
Windsurf~/.codeium/windsurf/mcp_config.jsonheader
Clinecline_mcp_settings.json, or the Cline UIheader
Claude Desktop / webclaude.ai, or Claude Desktop → Settings → Developer → Edit ConfigURL

Claude Code

Register the server with one command — no file to edit:

claude mcp add --transport http \ --header "CL-API-Key: YOUR_COMPETLAB_API_KEY" \ competlab https://mcp.competlab.com/mcp

Cursor

Add the server to .cursor/mcp.json in your project (or the global Cursor MCP settings):

{ "mcpServers": { "competlab": { "url": "https://mcp.competlab.com/mcp", "headers": { "CL-API-Key": "YOUR_COMPETLAB_API_KEY" } } } }

VS Code (Copilot)

VS Code uses a servers block (not mcpServers) and can prompt for the key securely, so it never sits in the file. Add this to .vscode/mcp.json:

{ "inputs": [ { "type": "promptString", "id": "competlab-api-key", "description": "CompetLab API Key (starts with cl_live_)", "password": true } ], "servers": { "competlab": { "type": "http", "url": "https://mcp.competlab.com/mcp", "headers": { "CL-API-Key": "${input:competlab-api-key}" } } } }

Windsurf

Windsurf uses serverUrl rather than url. Add this to ~/.codeium/windsurf/mcp_config.json:

{ "mcpServers": { "competlab": { "serverUrl": "https://mcp.competlab.com/mcp", "headers": { "CL-API-Key": "YOUR_COMPETLAB_API_KEY" } } } }

Cline

Add the server through the Cline UI (Installed → Advanced MCP Settings) or edit cline_mcp_settings.json directly. Note the disabled: false flag:

{ "mcpServers": { "competlab": { "url": "https://mcp.competlab.com/mcp", "headers": { "CL-API-Key": "YOUR_COMPETLAB_API_KEY" }, "disabled": false } } }

Claude Desktop and Claude on the web

Claude on the web and Claude Desktop connect by URL and don’t send custom headers, so the key goes in the URL. In Claude Desktop, open Settings → Developer → Edit Config and add:

{ "mcpServers": { "competlab": { "url": "https://mcp.competlab.com/mcp?api_key=YOUR_COMPETLAB_API_KEY" } } }

Because the key is in the URL, treat the whole URL as a secret — don’t share it in a chat, a screenshot, or a committed file. If your client supports headers, prefer the header form and keep the key out of the URL.

Verify the connection

Once the server is added, your client should list the CompetLab tools. In Claude Code, check with:

claude mcp list

You should see competlab in the list. In any client, the quickest end-to-end test is to ask the agent to list your projects — that calls the list_projects tool and confirms both the connection and your key in one step. If your key is missing or malformed, the server rejects the request with a 401 before any tool runs, so your client shows the CompetLab server as failing to connect rather than returning a tool result — see Troubleshooting below.

Run the server locally (advanced)

For offline or air-gapped work, CompetLab publishes an open-source version of the server that runs locally over stdio. It’s the same tools, connecting straight to the CompetLab REST API — there’s no reason to use it over the hosted URL unless you specifically need to run the process yourself. Clone and build it per the repository’s README, then run:

COMPETLAB_API_KEY=YOUR_COMPETLAB_API_KEY node dist/index.js

To wire the local stdio server into Claude Desktop, point the config at the built file:

{ "mcpServers": { "competlab": { "command": "node", "args": ["/path/to/competlab-mcp-server/dist/index.js"], "env": { "COMPETLAB_API_KEY": "YOUR_COMPETLAB_API_KEY" } } } }

Troubleshooting

  • api_key_missing — the server saw no key. Check that your CL-API-Key header is spelled exactly, or that ?api_key= is on the URL for a header-less client.
  • api_key_invalid — the key isn’t the right shape. Valid keys start with cl_live_ and are 40 characters; make sure you copied the whole thing.
  • The client can’t send headers — use the ?api_key= URL form (the Claude Desktop / web config above).
  • api_unreachable — the server couldn’t reach the CompetLab API. This is transient; retry, and check the CompetLab status page if it persists.

Next steps

Last updated on