Skip to main content
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.
claude mcp <subcommand> [options]

Subcommands

mcp add

Add an MCP server to Claude Code.
claude mcp add [options] <name> <command-or-url> [args...]
name
string
required
Unique name to identify this MCP server.
command-or-url
string
required
For stdio transport: the executable command to run.
For sse or http transport: the server URL.
-s, --scope <scope>
string
Configuration scope. Choices: local (default), user, project.
-t, --transport <transport>
string
Transport type. Choices: stdio (default), sse, http.
-e, --env <env...>
string[]
Set environment variables for the server process (e.g. -e KEY=value). Only applies to stdio transport.
-H, --header <header...>
string[]
Set HTTP/WebSocket headers (e.g. -H "Authorization: Bearer abc"). Only applies to sse and http transports.
--client-id <clientId>
string
OAuth client ID for http or sse servers.
--client-secret
boolean
Prompt for an OAuth client secret (or set the MCP_CLIENT_SECRET environment variable instead).
--callback-port <port>
string
Fixed port for the OAuth callback. Use this for servers that require pre-registered redirect URIs.
claude mcp add my-server -- npx my-mcp-server --some-flag

mcp remove

Remove an MCP server from the configuration.
claude mcp remove [options] <name>
name
string
required
Name of the server to remove.
-s, --scope <scope>
string
Configuration scope to remove from (local, user, or project). If not specified, the server is removed from whichever scope it exists in.

mcp list

List all configured MCP servers.
claude mcp list
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.

mcp get

Get details about a specific MCP server.
claude mcp get <name>
name
string
required
Name of the server to inspect.
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.

mcp serve

Start Claude Code itself as an MCP server. This lets other tools connect to Claude Code over the MCP protocol.
claude mcp serve [options]
-d, --debug
boolean
Enable debug mode.
--verbose
boolean
Override the verbose mode setting from config.

mcp add-json

Add an MCP server by providing the configuration as a raw JSON string.
claude mcp add-json [options] <name> <json>
-s, --scope <scope>
string
Configuration scope: local (default), user, or project.

mcp add-from-claude-desktop

Import MCP servers from a Claude Desktop installation (macOS and WSL only).
claude mcp add-from-claude-desktop [options]
-s, --scope <scope>
string
Configuration scope: local (default), user, or project.

mcp reset-project-choices

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

Configuration scopes

ScopeFile locationWhen to use
local.claude/settings.local.jsonPersonal, not committed to git
user~/.claude/settings.jsonAvailable across all projects
project.claude/settings.jsonShared with the team via git
You can also supply MCP servers at startup without modifying config files using the --mcp-config flag:
claude --mcp-config ./my-servers.json
claude --mcp-config '{"myServer": {"type": "stdio", "command": "npx", "args": ["my-mcp"]}}'

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

Build docs developers (and LLMs) love