Deep Code CLI supports MCP (Model Context Protocol), enabling AI assistants to connect with external tools and services such as GitHub, browsers, databases, and more.
Once MCP is configured, Deep Code can:
- Operate on GitHub repositories (view issues, create PRs, search code, etc.)
- Control browsers (screenshots, clicks, form filling, etc.)
- Access the file system
- Connect to databases and APIs
- ...and any external service compatible with the MCP protocol
MCP tools are named in Deep Code using the format mcp__<service_name>__<tool_name>, for example mcp__github__search_code.
Edit ~/.deepcode/settings.json and add the mcpServers field:
{
"env": {
"MODEL": "deepseek-v4-pro",
"BASE_URL": "https://api.deepseek.com",
"API_KEY": "sk-..."
},
"thinkingEnabled": true,
"reasoningEffort": "max",
"mcpServers": {
"<service_name>": {
"command": "<executable>",
"args": ["<arg1>", "<arg2>"],
"env": {
"<env_var>": "<value>"
}
}
}
}| Field | Type | Required | Description |
|---|---|---|---|
command |
string | Yes | Path or command of the MCP server executable (e.g., npx, node, python). When the command is npx, Deep Code automatically prepends -y to the arguments. |
args |
string[] | No | List of arguments to pass to the command |
env |
object | No | Environment variables (e.g., API keys) to pass to the MCP server process |
Allows Deep Code to directly operate on GitHub repositories (search code, manage issues/PRs, read/write files, etc.):
{
"mcpServers": {
"github": {
"command": "npx",
"args": ["-y", "@modelcontextprotocol/server-github"],
"env": {
"GITHUB_PERSONAL_ACCESS_TOKEN": "ghp_xxxxxxxxxxxx"
}
}
}
}Generate a GitHub Personal Access Token at GitHub Settings > Developer settings > Personal access tokens.
Lets Deep Code control a browser for screenshots, page interactions, etc.:
{
"mcpServers": {
"playwright": {
"command": "npx",
"args": ["@playwright/mcp@latest"]
}
}
}Enables Deep Code to read and write files within a specified directory:
{
"mcpServers": {
"filesystem": {
"command": "npx",
"args": ["-y", "@modelcontextprotocol/server-filesystem", "/path/to/allowed/dir"]
}
}
}{
"mcpServers": {
"my-tool": {
"command": "python",
"args": ["-m", "my_mcp_server"],
"env": {
"API_KEY": "xxx"
}
}
}
}Below is a complete ~/.deepcode/settings.json with both GitHub and Playwright MCP servers configured:
{
"env": {
"MODEL": "deepseek-v4-pro",
"BASE_URL": "https://api.deepseek.com",
"API_KEY": "sk-xxxxxxxxxxxx"
},
"thinkingEnabled": true,
"reasoningEffort": "max",
"mcpServers": {
"github": {
"command": "npx",
"args": ["-y", "@modelcontextprotocol/server-github"],
"env": {
"GITHUB_PERSONAL_ACCESS_TOKEN": "ghp_xxxxxxxxxxxx"
}
},
"playwright": {
"command": "npx",
"args": ["@playwright/mcp@latest"]
}
}
}After configuration, start deepcode and use the /mcp command to manage MCP connections:
/mcp— View the status of configured MCP servers/mcp add— Add a new MCP server/mcp remove— Remove an MCP server/mcp list— List all connected MCP servers and their tools
Simply use the MCP tool name in your conversation to invoke it, for example:
Help me search for issues in the deepcode-cli repository on GitHub
The AI will automatically invoke the mcp__github__search_issues tool to complete the action.
An MCP tool name consists of three parts: mcp__<service_name>__<tool_name>
| Service | Tool Name | Full Invocation Name |
|---|---|---|
| github | search_code | mcp__github__search_code |
| github | create_pull_request | mcp__github__create_pull_request |
| playwright | browser_navigate | mcp__playwright__browser_navigate |
| playwright | browser_take_screenshot | mcp__playwright__browser_take_screenshot |
You can view the list of tools provided by each server using /mcp list.
If an MCP server fails to start, check:
- Whether
commandis installed (e.g.,npxrequires Node.js) - Whether environment variables in
envare correct (e.g.,GITHUB_PERSONAL_ACCESS_TOKEN) - Whether the terminal running
deepcodehas network access
- Verify that the
mcpServersfield insettings.jsonis correctly formatted - After starting deepcode, use
/mcpto check server status - If the server status shows an error, debug based on the error message
On Windows, Deep Code CLI automatically adds shell support for .cmd commands. If your MCP command is a batch script, ensure the filename ends with .cmd.
MCP servers follow the Model Context Protocol specification and communicate using JSON‑RPC 2.0. You can write an MCP server in any language as long as it implements the following methods:
initialize— Handshake and protocol negotiationtools/list— Return the list of available toolstools/call— Execute a tool call
For more information, see the official MCP documentation.