MCP Servers

Connect Command Code to external tools and data sources through MCP servers. MCP is an open protocol that lets Command Code interact with external services — databases, APIs, issue trackers, and more.


MCP (Model Context Protocol) is an open protocol that lets AI agents connect to external tools and services. With MCP, Command Code can interact with databases, APIs, dev tools, and more — all through a standardized interface.

Instead of building custom integrations, you connect MCP servers and Command Code automatically discovers and uses their tools.

With MCP servers connected, you can ask Command Code to:

  • Work with project management: "Create a GitHub issue for the bug we found and assign it to me."
  • Query databases: "Show me all users who signed up in the last 7 days from our Postgres database."
  • Integrate with services: "Search Notion for the API design doc and summarize it."
  • Automate workflows: "Review PR #123 on GitHub, then post a summary in Slack."

All MCP management is done through cmd mcp <subcommand>.

CommandDescriptionExample
cmd mcp addAdd server with CLI optionscmd mcp add --transport http notion https://mcp.notion.com/mcp
cmd mcp add-jsonAdd server from JSON configcmd mcp add-json github '{"type":"http","url":"https://..."}'
cmd mcp listList all configured serverscmd mcp list
cmd mcp get <name>Show server detailscmd mcp get notion
cmd mcp remove <name>Remove a server from configurationcmd mcp remove notion
cmd mcp auth <server>Authenticate with OAuth (opens browser)cmd mcp auth notion
cmd mcp auth --status <server>Check authentication statuscmd mcp auth --status notion
cmd mcp auth --listList all servers with stored tokenscmd mcp auth --list
cmd mcp auth --clear <server>Clear stored tokenscmd mcp auth --clear notion

HTTP Transport (Remote Servers)

Use --transport http to connect to remote MCP servers:

HTTP Examples

cmd mcp add --transport http notion https://mcp.notion.com/mcp

Stdio Transport (Local Processes)

Stdio is the default transport. Use -- to separate the server name from the command:

Stdio Examples

cmd mcp add my-tool -- npx @my-org/mcp-server
Option ordering

All flags (--transport, --scope, --env, --header) must come before the server name. The -- separates the server name from the stdio command and its arguments.

Command Options

FlagDescriptionDefault
-t, --transport <type>Transport type: stdio or httpstdio
-s, --scope <scope>Where to store: local, project, or userlocal
-e, --env <KEY=value>Environment variable (repeatable)
-H, --header <Header: value>HTTP header (repeatable, http only)

Scopes

MCP servers can be stored in three scopes with different visibility:

ScopeFile LocationPurpose
local~/.commandcode/projects/<slug>/mcp.jsonPrivate, per-project (default)
project.mcp.json in project rootShared, version controlled
user~/.commandcode/mcp.jsonPrivate, available across all projects

Precedence: When the same server name exists in multiple scopes, local overrides project, which overrides user.

Scope Examples

cmd mcp add --transport http notion https://mcp.notion.com/mcp

Inside a Command Code session, type /mcp to open the interactive MCP manager.

/mcp

The menu shows:

  • All configured servers with connection status
  • Color-coded indicators: green (connected), cyan (authenticated), yellow (requires auth), red (error)
  • Tool count for each connected server
  • Actions: connect, authenticate, or remove servers

Once a server is connected, its tools appear alongside built-in tools. They follow the naming convention mcp__<server>__<tool>:

mcp__notion__search_page mcp__github__create_issue

You don't need to remember tool names. Just describe what you want:

Search for the API design doc on Notion.

Command Code discovers and calls the appropriate MCP tool automatically.

Server won't connect:

  • Check the URL or command is correct: cmd mcp get <name>
  • For stdio, ensure the command is installed and in your PATH
  • Use /mcp to see the connection error message

Authentication issues:

  • Re-authenticate: cmd mcp auth <server>
  • Clear and retry: cmd mcp auth --clear <server> then cmd mcp auth <server>
  • Check token status: cmd mcp auth --status <server>

Tools not appearing:

  • Verify the server is connected via /mcp
  • The server may take a few seconds to initialize after startup
  • Check that the server actually exposes tools (some only expose resources)