Keyboard shortcuts

Press or to navigate between chapters

Press S or / to search in the book

Press ? to show this help

Press Esc to hide this help

Deep Code

Why this agent

Deep Code is an open-source terminal AI coding assistant tuned for the DeepSeek-V4 model family. It ships with deep-thinking + reasoning-effort controls, Agent Skills, and native MCP support — per docs/mcp_en.md it reads MCP servers from the standard mcpServers.<name>.{command, args, env} shape in ~/.deepcode/settings.json. The same settings file is shared with the Deep Code VS Code extension.

Prerequisites

  • Node.js 18+ installed.
  • Deep Code CLI installed: npm install -g @vegamo/deepcode-cli; deepcode --version works.
  • espctl installed at a stable path on disk.
  • (Optional, for remote builds) the Aegis build server URL + MCP_AUTH_SECRET.

Install snippet (or alternative)

Edit ~/.deepcode/settings.json and merge the mcpServers entry alongside your existing DeepSeek model config:

{
  "env": {
    "MODEL": "deepseek-v4-pro",
    "BASE_URL": "https://api.deepseek.com",
    "API_KEY": "sk-..."
  },
  "thinkingEnabled": true,
  "reasoningEffort": "max",
  "mcpServers": {
    "espctl": {
      "command": "/path/to/espctl",
      "args": ["mcp", "serve"],
      "env": {
        "CONTROL_BASE_URL": "https://esphome.cloud",
        "MCP_AUTH_SECRET": "your-access-key"
      }
    }
  }
}

Replace:

  • /path/to/espctl — full path to your espctl executable.
  • CONTROL_BASE_URL — your Aegis build server URL.
  • MCP_AUTH_SECRET — the access key your build server gave you.

Or grab just the mcpServers block pre-filled:

Read the install://deep-code resource.

First-run verification

cd /path/to/your/esp-idf/project
deepcode

Inside Deep Code:

/mcp

Expected: the /mcp view shows espctl server Connected with ~40 tools. Tools are exposed as mcp__espctl__<tool_name> per Deep Code’s naming convention.

Troubleshooting

  • /mcp shows espctl not connected — confirm /path/to/espctl is absolute and executable from your shell user. Deep Code does not search $PATH for stdio command paths.
  • Tools enumerate but every call returns “auth required”MCP_AUTH_SECRET is missing or has been revoked. Get a fresh access key from the control plane and paste it into the config.
  • command is npx and tools fail to load — Deep Code auto- prepends -y for npx commands. Our espctl entry uses the binary directly so this isn’t relevant; remove -y if you’re hand- copying from a different MCP doc.
  • VS Code extension and terminal CLI behave differently — they share the same ~/.deepcode/settings.json. If you edited via CLI the extension picks it up on next reload; if you edited via the extension, restart deepcode.

Tested as-of 2026-05-19

Deep Code-specific notes

  • Deep Code is DeepSeek-V4 specific (uses deepseek-v4-pro / deepseek-v4-flash). The MCP transport itself is model- independent — you could point BASE_URL at any OpenAI-compatible endpoint (e.g., Volcano Ark Coding Plan) and the same MCP wiring still works.
  • Agent Skills live under ~/.agents/skills/<name>/SKILL.md (user level) or ./.deepcode/skills/<name>/SKILL.md (project level). Skills and MCP tools are orthogonal — both surfaces co-exist in the same session.
  • The MCP-tool naming mcp__espctl__<tool> (double underscore) is Deep Code-specific. Other agents in this matrix use mcp.espctl.<tool> (Hermes) or unprefixed (Claude Code).