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."
Add your first MCP server to Command Code in under a minute.
Add an MCP server
Pick one transport:
Add MCP Server
Example:
Examples
Authenticate if prompted
Some remote servers require OAuth. Open the MCP menu:
Follow the browser prompt to log in. Tokens are stored securely and refreshed automatically.
If needed, pass auth headers:
All options (--transport, --env, --scope, --header) must come before the server name. -- separates the server name from the local command for stdio servers.
Verify connection
List your configured servers:
Or inspect one server:
Inside a session, /mcp shows connection status and available tools.
Try it out
Start a session:
Then ask naturally:
Command Code automatically discovers and calls the right MCP tools based on your request.
Optional: Add MCP servers from JSON
For complex setups, use JSON:
Example:
GitHub MCP Server
For copying configs between machines or scripting:
- The JSON accepts
typeas an alias fortransport. - Environment variables in config values (like
${API_KEY}) are resolved at runtime.
Optional: Import from Claude Desktop
If you already configured MCP servers in Claude Desktop:
You will get an interactive picker for which servers to import.
HTTP transport (remote servers)
Use --transport http to connect to remote MCP servers:
HTTP Examples
Stdio transport (local processes)
Stdio is the default transport. Use -- to separate the server name from the command:
Stdio Examples
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) | — |
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 |
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
Local scope (default)
Stored in ~/.commandcode/. Only available to you for the current project.
Project scope
Stored in .mcp.json at your project root. Checked into version control — shared with your team.
This creates or updates .mcp.json:
User scope
Stored in ~/.commandcode/mcp.json. Available to you across all projects.
Config schema
The configuration files follow this schema:
Config Schema
OAuth flow
Command Code supports OAuth 2.0 Authorization Code with PKCE for HTTP servers.
Add a server that requires OAuth
Add OAuth Server
If the server requires authentication, Command Code detects this automatically and starts the OAuth flow.
Authenticate via browser
A browser window opens for you to authorize. After you grant access, tokens are stored securely in ~/.commandcode/mcp-tokens.json.
You can also authenticate later:
Authenticate
Or use the /mcp menu inside a session to authenticate interactively.
Tokens refresh automatically
Tokens are refreshed automatically when they expire. If refresh fails, re-authenticate with cmd mcp auth <server>.
Token Commands
OAuth flow (remote servers)
Many remote MCP servers support OAuth 2.0. Use /mcp inside Command Code to authenticate:
Select the server and follow the browser login flow. Tokens are stored securely and refreshed automatically.
Tips:
- Use "Clear authentication" in
/mcpto revoke access - If your browser doesn't open automatically, copy the provided URL
- OAuth works with HTTP and SSE transport servers
OAuth with JSON
API key auth
For servers that use API keys, pass them as environment variables or headers:
Inside a Command Code session, type /mcp to open the interactive MCP manager.
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>:
You don't need to remember tool names. Just describe what you want:
Command Code discovers and calls the appropriate MCP tool automatically.
A list of useful MCP servers and how to add them in Command Code. These servers extend Command Code with access to external tools, documentation, and services.
Notion
Search, read, and create pages in your Notion workspace.
After adding, authenticate via the /mcp menu inside a Command Code session.
GitHub
Manage GitHub beyond what git supports — issues, PRs, code search, and more. It requires your GitHub Personal Access Token (PAT).
Fine-grained token (recommended) — scoped to specific repos, minimal permissions:
- Go to GitHub > Settings > Developer settings > Personal access tokens > Fine-grained tokens
- Click Generate new token
- Name it
commandcode-mcp, set expiration as needed - Repository access → Choose "All repositories" or "Only select repositories"
- Permissions → Repository permissions → expand and configure:
- Contents: Read and write (for file operations)
- Issues: Read and write (for issue management)
- Pull requests: Read and write (for PR operations)
- Metadata: Read-only (automatically included)
- Generate token and copy it
Classic token — broader access, simpler setup:
- Go to GitHub > Settings > Developer settings > Personal access tokens > Tokens (classic)
- Name it
commandcode-mcp, set expiration as needed - Check the repo scope (includes all repository permissions)
- Generate token and copy it
Replace YOUR_GITHUB_PAT with your generated token:
For more details, see the instructions in these GitHub MCP Server installation docs.
Playwright
Control and inspect a browser using Playwright. Write and run browser tests, take screenshots, and automate web interactions.
Sentry
Access Sentry logs, monitor errors, and debug production issues.
After adding, authenticate via the /mcp menu inside a Command Code session.
OpenAI Docs
Search and read OpenAI developer documentation directly from your prompts.
Context7
Connect to up-to-date developer documentation. Dynamically fetches version-specific docs and code examples from official sources.
Include use context7 in your prompts to pull in the latest docs for any library.
Figma
Access your Figma designs. Available as both a remote and local server.
Figma MCP
For the remote server, authenticate via the /mcp menu after adding. The local server requires the Figma desktop app to be running.
Chrome Developer Tools
Control and inspect Chrome from Command Code. Debug pages, take screenshots, and interact with the DOM.
Adding any MCP server
Most MCP servers connect in three ways: as a remote HTTP server, a local stdio process, or from a JSON config.
General Pattern
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)
- 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