> ## Documentation Index
> Fetch the complete documentation index at: https://mintlify.com/jackdog668/claude-code/llms.txt
> Use this file to discover all available pages before exploring further.

# mcp

> Configure and manage MCP (Model Context Protocol) servers for Claude Code.

The `claude mcp` command group lets you add, remove, list, and inspect MCP servers, as well as run Claude Code itself as an MCP server.

```bash theme={null}
claude mcp <subcommand> [options]
```

## Subcommands

### `mcp add`

Add an MCP server to Claude Code.

```bash theme={null}
claude mcp add [options] <name> <command-or-url> [args...]
```

<ParamField path="name" type="string" required>
  Unique name to identify this MCP server.
</ParamField>

<ParamField path="command-or-url" type="string" required>
  For `stdio` transport: the executable command to run.\
  For `sse` or `http` transport: the server URL.
</ParamField>

<ParamField path="-s, --scope <scope>" type="string">
  Configuration scope. Choices: `local` (default), `user`, `project`.
</ParamField>

<ParamField path="-t, --transport <transport>" type="string">
  Transport type. Choices: `stdio` (default), `sse`, `http`.
</ParamField>

<ParamField path="-e, --env <env...>" type="string[]">
  Set environment variables for the server process (e.g. `-e KEY=value`).
  Only applies to `stdio` transport.
</ParamField>

<ParamField path="-H, --header <header...>" type="string[]">
  Set HTTP/WebSocket headers (e.g. `-H "Authorization: Bearer abc"`). Only
  applies to `sse` and `http` transports.
</ParamField>

<ParamField path="--client-id <clientId>" type="string">
  OAuth client ID for `http` or `sse` servers.
</ParamField>

<ParamField path="--client-secret" type="boolean">
  Prompt for an OAuth client secret (or set the `MCP_CLIENT_SECRET` environment
  variable instead).
</ParamField>

<ParamField path="--callback-port <port>" type="string">
  Fixed port for the OAuth callback. Use this for servers that require
  pre-registered redirect URIs.
</ParamField>

<CodeGroup>
  ```bash stdio server theme={null}
  claude mcp add my-server -- npx my-mcp-server --some-flag
  ```

  ```bash stdio server with env vars theme={null}
  claude mcp add -e API_KEY=xxx my-server -- npx my-mcp-server
  ```

  ```bash HTTP server theme={null}
  claude mcp add --transport http sentry https://mcp.sentry.dev/mcp
  ```

  ```bash HTTP server with auth header theme={null}
  claude mcp add --transport http corridor https://app.corridor.dev/api/mcp \
    --header "Authorization: Bearer <token>"
  ```

  ```bash SSE server theme={null}
  claude mcp add --transport sse my-sse-server https://example.com/events
  ```
</CodeGroup>

### `mcp remove`

Remove an MCP server from the configuration.

```bash theme={null}
claude mcp remove [options] <name>
```

<ParamField path="name" type="string" required>
  Name of the server to remove.
</ParamField>

<ParamField path="-s, --scope <scope>" type="string">
  Configuration scope to remove from (`local`, `user`, or `project`). If not
  specified, the server is removed from whichever scope it exists in.
</ParamField>

### `mcp list`

List all configured MCP servers.

```bash theme={null}
claude mcp list
```

<Note>
  The workspace trust dialog is skipped and stdio servers from `.mcp.json` are
  spawned for health checks. Only use this command in directories you trust.
</Note>

### `mcp get`

Get details about a specific MCP server.

```bash theme={null}
claude mcp get <name>
```

<ParamField path="name" type="string" required>
  Name of the server to inspect.
</ParamField>

<Note>
  The workspace trust dialog is skipped and stdio servers from `.mcp.json` are
  spawned for health checks. Only use this command in directories you trust.
</Note>

### `mcp serve`

Start Claude Code itself as an MCP server. This lets other tools connect to
Claude Code over the MCP protocol.

```bash theme={null}
claude mcp serve [options]
```

<ParamField path="-d, --debug" type="boolean">
  Enable debug mode.
</ParamField>

<ParamField path="--verbose" type="boolean">
  Override the verbose mode setting from config.
</ParamField>

### `mcp add-json`

Add an MCP server by providing the configuration as a raw JSON string.

```bash theme={null}
claude mcp add-json [options] <name> <json>
```

<ParamField path="-s, --scope <scope>" type="string">
  Configuration scope: `local` (default), `user`, or `project`.
</ParamField>

### `mcp add-from-claude-desktop`

Import MCP servers from a Claude Desktop installation (macOS and WSL only).

```bash theme={null}
claude mcp add-from-claude-desktop [options]
```

<ParamField path="-s, --scope <scope>" type="string">
  Configuration scope: `local` (default), `user`, or `project`.
</ParamField>

### `mcp reset-project-choices`

Reset all approved and rejected project-scoped (`.mcp.json`) servers within
the current project.

```bash theme={null}
claude mcp reset-project-choices
```

## Configuration scopes

| Scope     | File location                 | When to use                    |
| --------- | ----------------------------- | ------------------------------ |
| `local`   | `.claude/settings.local.json` | Personal, not committed to git |
| `user`    | `~/.claude/settings.json`     | Available across all projects  |
| `project` | `.claude/settings.json`       | Shared with the team via git   |

<Tip>
  You can also supply MCP servers at startup without modifying config files
  using the `--mcp-config` flag:

  ```bash theme={null}
  claude --mcp-config ./my-servers.json
  claude --mcp-config '{"myServer": {"type": "stdio", "command": "npx", "args": ["my-mcp"]}}'
  ```
</Tip>

## The `/mcp` slash command

Inside an interactive session, run `/mcp` to open the MCP settings panel where you can view server status, enable/disable servers, and reconnect.

```
/mcp
/mcp enable my-server
/mcp disable my-server
/mcp reconnect my-server
```
