> ## Documentation Index
> Fetch the complete documentation index at: https://docs.context.dev/llms.txt
> Use this file to discover all available pages before exploring further.

# Install MCP

> Connect Claude Code, Cursor, VS Code, or any MCP client to Context.dev's MCP server.

Context.dev's Model Context Protocol (MCP) server exposes the full API to any MCP-aware AI tool: Claude Code, Cursor, VS Code, Zed, Claude Desktop, and the rest.

This gives your agent tools to resolve a brand, scrape webpages, crawl entire sites, pull styleguides, and more.

Context.dev offers a hosted MCP server you can connect to at `https://context-dev.stlmcp.com`. Jump to [Run the MCP server locally](#run-the-mcp-server-locally) if you'd rather run the server on your own machine instead.

## Connect your MCP client

Every MCP client reads a JSON config file that lists the servers it should connect to. The shape is the same across clients; the file path differs.

### Claude Code

Use the `claude mcp` CLI:

```bash terminal theme={null}
claude mcp add context_dev_api \
    --transport http \
    --header "x-context-dev-api-key: ctxt_secret_..." \
    https://context-dev.stlmcp.com
```

This writes to `~/.claude.json`. Restart Claude Code and the `context_dev_api` tool group appears in the tool picker.

### Cursor

The fast path is the install button:

[![Add to Cursor](https://cursor.com/deeplink/mcp-install-dark.svg)](https://cursor.com/en-US/install-mcp?name=context_dev_api\&config=eyJuYW1lIjoiY29udGV4dF9kZXZfYXBpIiwidHJhbnNwb3J0IjoiaHR0cCIsInVybCI6Imh0dHBzOi8vY29udGV4dC1kZXYuc3RsbWNwLmNvbSIsImhlYWRlcnMiOnsieC1jb250ZXh0LWRldi1hcGkta2V5IjoiTXkgQVBJIEtleSJ9fQ==)

After clicking it, open Cursor Settings → Tools & MCP → New MCP Server, paste your API key into the `x-context-dev-api-key` header value, and save.

To configure manually, edit `~/.cursor/mcp.json`:

```json ~/.cursor/mcp.json theme={null}
{
  "mcpServers": {
    "context_dev_api": {
      "transport": "http",
      "url": "https://context-dev.stlmcp.com",
      "headers": {
        "x-context-dev-api-key": "ctxt_secret_..."
      }
    }
  }
}
```

### VS Code

Open the install link in VS Code:

[Open in VS Code](https://vscode.stainless.com/mcp/%7B%22name%22%3A%22context_dev_api%22%2C%22type%22%3A%22http%22%2C%22url%22%3A%22https%3A%2F%2Fcontext-dev.stlmcp.com%22%2C%22headers%22%3A%7B%22x-context-dev-api-key%22%3A%22My%20API%20Key%22%7D%7D)

VS Code prompts to confirm, then writes to your user `mcp.json`. Open it via Command Palette → "MCP: Open User Configuration" if you need to edit the API key.

```json mcp.json theme={null}
{
  "servers": {
    "context_dev_api": {
      "type": "http",
      "url": "https://context-dev.stlmcp.com",
      "headers": {
        "x-context-dev-api-key": "ctxt_secret_..."
      }
    }
  }
}
```

### Any other MCP client

The [Model Context Protocol clients directory](https://modelcontextprotocol.io/clients) has the up-to-date list. Most clients accept the streamable-HTTP config shape:

```json mcp-config.json theme={null}
{
  "mcpServers": {
    "context_dev_api": {
      "transport": "http",
      "url": "https://context-dev.stlmcp.com",
      "headers": { "x-context-dev-api-key": "ctxt_secret_..." }
    }
  }
}
```

If your client only supports stdio (Claude Desktop is the common one), see [Run the MCP server locally](#run-the-mcp-server-locally).

## How Code Mode works

The server is built on the "Code Mode" tool scheme. Instead of one tool per API endpoint, the agent gets two tools and writes TypeScript SDK code against them:

1. **`search_docs`.** The agent queries the Context.dev SDK docs for the function and parameters it needs.
2. **`execute`.** The agent writes TypeScript that calls the Context.dev SDK. The server runs that code in a Stainless-hosted sandbox without network or filesystem access (other than the Context.dev API call itself) and returns whatever the code returns.

The benefit: the agent can compose multiple SDK calls into one tool invocation, branch on results, filter responses, and return only what you asked for. A single user prompt like "get stripe.com's brand colors, logos, and pricing-page URL" turns into one tool call that runs `client.brand.retrieve()` and walks the response (`brand.colors`, `brand.logos`, `brand.links.pricing`), instead of a half-dozen back-and-forth rounds of single-purpose tool calls.

You don't need to know this is happening. From the agent's side, it looks like calling a normal tool. From your side, it looks like the agent has the full Context.dev SDK in scope.

## Verify it loaded

After installing, ask your agent something only Context.dev can answer:

> What are the brand colors for stripe.com?

The agent should call the Context.dev MCP `execute` tool and return Stripe's actual brand colors (`#543cfb` "Meteor Shower" and a few secondaries). If it tries to describe the colors from training data instead of calling the tool, the server isn't wired up. Re-check the config file path and the API key value.

## Run the MCP server locally

Run the server on your own machine when you'd rather not connect to the hosted endpoint: for offline / air-gapped setups, when you want to inspect the tool definitions yourself, or when a client only supports stdio.

You need Node 18+ installed.

### Quick start (stdio)

```bash terminal theme={null}
export CONTEXT_DEV_API_KEY="ctxt_secret_..."
npx -y context.dev-mcp@latest
```

The server speaks MCP over stdio. Most clients launch this command themselves once you put it in their config; you only run it by hand to verify the package downloads and starts.

### Launch over HTTP

```bash terminal theme={null}
# Streamable HTTP on a chosen port (default 3000).
npx -y context.dev-mcp@latest --transport=http --port=3000

# Or bind to a Unix socket.
npx -y context.dev-mcp@latest --transport=http --socket=/tmp/contextdev-mcp.sock
```

Authenticate to the local HTTP server with either `Authorization: Bearer <key>` or `x-context-dev-api-key`, the same headers the hosted server accepts.

### Have a client launch the server for you

For clients that support stdio (Claude Desktop and most others), point the config at the `npx` command and the client will spawn it on demand:

```json mcp-config.json theme={null}
{
  "mcpServers": {
    "context_dev_api": {
      "command": "npx",
      "args": ["-y", "context.dev-mcp@latest"],
      "env": { "CONTEXT_DEV_API_KEY": "ctxt_secret_..." }
    }
  }
}
```

For **Claude Desktop**, this config lives at `~/Library/Application Support/Claude/claude_desktop_config.json` (macOS) or `%APPDATA%\Claude\claude_desktop_config.json` (Windows). Restart Claude Desktop after editing; the hammer icon in the chat input lights up, and clicking it shows the Context.dev tools.

For clients that support **local HTTP**, start the server with `--transport=http --port=3000` and point the config at `http://localhost:3000`:

```json mcp-config.json theme={null}
{
  "mcpServers": {
    "context_dev_api": {
      "url": "http://localhost:3000",
      "headers": { "Authorization": "Bearer ctxt_secret_..." }
    }
  }
}
```

## Next steps

<CardGroup cols={2}>
  <Card title="Agent Quickstart" icon="robot" href="/agent-quickstart">
    The full agent setup: copyable system prompt, SKILL.md, and MCP, in one page.
  </Card>

  <Card title="SKILL.md" icon="book-open" href="/install-skill">
    Install the drop-in skill file that teaches your agent the Context.dev API.
  </Card>

  <Card title="API Reference" icon="code" href="/api-reference/brand-intelligence/retrieve-brand-data-by-domain">
    The underlying endpoints the MCP server's code-mode tool calls.
  </Card>

  <Card title="Brand Intelligence" icon="globe" href="/guides/get-brand-data">
    What the agent can resolve: name, domain, email, ticker, ISIN, transaction.
  </Card>
</CardGroup>
