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>.
| Command | Description | Example |
|---|---|---|
cmd mcp add | Add server with CLI options | cmd mcp add --transport http notion https://mcp.notion.com/mcp |
cmd mcp add-json | Add server from JSON config | cmd mcp add-json github '{"type":"http","url":"https://..."}' |
cmd mcp list | List all configured servers | cmd mcp list |
cmd mcp get <name> | Show server details | cmd mcp get notion |
cmd mcp remove <name> | Remove a server from configuration | cmd mcp remove notion |
cmd mcp auth <server> | Authenticate with OAuth (opens browser) | cmd mcp auth notion |
cmd mcp auth --status <server> | Check authentication status | cmd mcp auth --status notion |
cmd mcp auth --list | List all servers with stored tokens | cmd mcp auth --list |
cmd mcp auth --clear <server> | Clear stored tokens | cmd 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
Command Options
| Flag | Description | Default |
|---|---|---|
-t, --transport <type> | Transport type: stdio or http | stdio |
-s, --scope <scope> | Where to store: local, project, or user | local |
-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:
| Scope | File Location | Purpose |
|---|---|---|
local | ~/.commandcode/projects/<slug>/mcp.json | Private, per-project (default) |
project | .mcp.json in project root | Shared, version controlled |
user | ~/.commandcode/mcp.json | Private, 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
/mcpto see the connection error message
Authentication issues:
- Re-authenticate:
cmd mcp auth <server> - Clear and retry:
cmd mcp auth --clear <server>thencmd 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)
- MCP Server Examples for a list of useful MCP servers
- CLI Reference for all Command Code commands
- Slash Commands for custom prompts
- MCP Protocol Specification for building your own MCP server
- Join our Discord community for support