Featured

Deploy OpenClaw in 60 seconds โ€” 20% off logoDeploy OpenClaw in 60 seconds โ€” 20% off

Launch OpenClaw on Hostinger in about 60 seconds and keep your agent live 24/7. Our referral link gives you 20% off, no coupon code needed.

Launch on Hostinger โ†’
Run your Hermes agent on Hostinger, fully managed logoRun your Hermes agent on Hostinger, fully managed

Launch Hermes on Hostinger in one click, fully managed, no VPS knowledge needed. Use code ZACAARON10 for 10% off.

Launch on Hostinger โ†’
Crawl and scrape any site into clean data, 10% off logoCrawl and scrape any site into clean data, 10% off

Firecrawl crawls and scrapes any site into clean markdown for your agent. Get 1,000 free credits, and new users get 10% off their first purchase.

Try Firecrawl free โ†’
Your own AI agent, running 24/7 with QwikClaw logoYour own AI agent, running 24/7 with QwikClaw

QwikClaw sets up and runs an always-on OpenClaw agent for you. One click, no config files, no server setup.

Deploy now โ†’
One API to scrape, enrich, and extract the internet. logoOne API to scrape, enrich, and extract the internet.

Context.dev gives your agents a single API to scrape, enrich, and extract live web data โ€” no proxies, no parsers, no maintenance.

Start building free โ†’
SetupClaw: done-for-you OpenClaw for founders & exec teams logoSetupClaw: done-for-you OpenClaw for founders & exec teams

White-glove OpenClaw for founders and exec teams (4โ€“50+ employees): we install, harden, integrate your tools, and maintain it โ€” secured from day one.

Get it set up for you โ†’
SEO data APIs for your agent, $1 free credit logoSEO data APIs for your agent, $1 free credit

DataForSEO gives your agent live access to SERP results, keyword data, backlinks, and on-page SEO data through one API. New accounts get a $1 credit, good for up to 20,000 keyword or backlink lookups.

Try DataForSEO free โ†’
Reach 47,000+ AI builders

A flat monthly placement in front of developers actively installing AI tools. No lock-in, cancel anytime.

Advertise here โ†’

Works with

Claude CodeClaude DesktopCursorVS CodeClineCodex CLIOpenClaw+ any MCP client

Install to Claude Code

This server doesn't publish a one-line install command. Follow the setup in the source repository.

Summary

PsChina/deepseek-as-subagent MCP server](https://glama.ai/mcp/servers/PsChina/deepseek-as-subagent/badges/score.svg)](https://glama.ai/mcp/servers/PsChina/deepseek-as-subagent) ๐Ÿ ๐Ÿ  ๐ŸŽ ๐ŸชŸ ๐Ÿง - Run DeepSeek as a real sub-agent inside Claude Code / Codex CLI.

README.md

deepseek-as-subagent

English ยท ็ฎ€ไฝ“ไธญๆ–‡

![Python](https://www.python.org/) ![License: MIT](LICENSE) ![GitHub stars](https://github.com/PsChina/deepseek-as-subagent) ![Glama MCP server](https://glama.ai/mcp/servers/PsChina/deepseek-as-subagent) ![MCP](https://modelcontextprotocol.io/) ![Mentioned in Awesome MCP Servers](https://github.com/punkpeye/awesome-mcp-servers) ![Platforms](https://github.com/PsChina/deepseek-as-subagent)

Run DeepSeek as a real sub-agent inside Claude Code / Codex CLI โ€” not just an LLM endpoint. Claude stays on the main loop (your Max OAuth, your context, your judgment). DeepSeek gets its own Read / Write / Edit / Bash / Glob / Grep / NotebookEdit agent loop for batch / mechanical work.

       Claude (your main agent, Max OAuth, expensive but smart)
         โ”‚
         โ”‚  decides this is a batch task
         โ”‚  โ†’  delegate_to_deepseek(task, context)
         โ–ผ
       DeepSeek sub-agent (cheap, runs its own loop inside the workspace)
         โ”‚  Read / Write / Edit / Bash / Glob / Grep / NotebookEdit โ€” all local
         โ”‚  iterates until done
         โ–ผ
       Final message bubbles back to Claude
       Claude verifies a sample of the output, reports to you

Quick start

curl -sSL https://raw.githubusercontent.com/PsChina/deepseek-as-subagent/main/curl-install.sh | bash

One line. Clones the repo to ~/.local/share/deepseek-as-subagent, installs the Python package in an isolated venv, registers the MCP server with Claude Code, deploys the skill + /ds slash command, and adds a pure shell alias.

After install, edit ~/.deepseek-mcp/config.json to paste your DeepSeek API key (get one at platform.deepseek.com). Then run claude and try /ds write a python hello world to /tmp/hi.py.

Re-run the same curl | bash later to upgrade. For other clients (Codex, Cursor, Cline) or manual install, see Install below.

How is this different from existing DeepSeek MCP servers?

Most deepseek-mcp-server projects expose DeepSeek as a single LLM call (create_chat_completion, create_anthropic_message). Claude has to read every file itself and feed content into the prompt โ€” DeepSeek only saves you the "thinking" cost, not the "reading/writing" cost. Same for Composio's DeepSeek toolkit.

This project gives DeepSeek its own full agent loop: tool dispatch, file I/O, command execution, multi-turn reasoning โ€” all inside a sandboxed workspace. Claude hands off the entire task and gets a single summary back. The token savings are end-to-end.

What's in the box

  • MCP server (Python, stdio transport) exposing one real tool: delegate_to_deepseek(task, context)
  • Local agent loop for DeepSeek (agent_loop.py) with OpenAI-compatible function calling
  • 7 sandboxed tools for DeepSeek to use: Read / Write / Edit / Bash / Glob / Grep / NotebookEdit (Jupyter cell-level editing)
  • Path sandbox + command blacklist (safety.py) โ€” DeepSeek can't escape your workspace or run rm -rf /
  • Skill + slash command so Claude knows when to delegate (and when not to)
  • pure shell alias for one-shot "no DeepSeek today" runs

Install

Claude Code (default)

git clone https://github.com/PsChina/deepseek-as-subagent
cd deepseek-as-subagent
./install.sh

Then edit ~/.deepseek-mcp/config.json and paste your DeepSeek API key.

Get a key at https://platform.deepseek.com (CNY ยฅ20 lasts a long time).

Codex CLI

See adapters/codex/ โ€” registers the MCP server with codex and provides instructions you can paste into AGENTS.md.

Cursor / Cline / Claude Desktop / other MCP clients

The MCP server itself is client-agnostic. After pip install -e ., point your client's MCP config at <repo>/.venv/bin/deepseek-mcp. For client-specific "when to delegate" hints, see adapters/ โ€” PRs welcome for new clients.

Usage

After install, just use claude normally. The plugin adds:

  • delegate_to_deepseek โ€” Claude auto-invokes it when the task fits (see skills/delegate-to-deepseek/SKILL.md)
  • /ds <task> โ€” force delegation, skip Claude's own judgment
  • pure shell alias โ€” start Claude with DeepSeek disabled for this session

When delegation actually saves money

Critical rule (encoded in the skill): the delegation decision must happen before Claude reads any source files. If Claude reads first then delegates, both Claude and DeepSeek read the same files โ€” net cost goes up, not down.

The skill enforces: only Glob / LS / read-only Bash are allowed before the delegation decision. If you can't decide without reading, you shouldn't delegate.

Sweet spot for delegation:

  • โœ… 10โ€“50 files, mechanical pattern (i18n extract, batch refactor, ETL)
  • โœ… Large data + simple processing (log scan, file conversion)
  • โŒ Single file < 500 lines (DeepSeek thinking-token overhead > savings)
  • โŒ Cross-file design / architectural judgment
  • โŒ Tasks needing project-specific idioms from CLAUDE.md

Architecture

โ”Œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”
โ”‚  Claude Code (CLI or VSCode extension, your Max OAuth)          โ”‚
โ”‚    โ†“ stdio (MCP protocol, no network)                           โ”‚
โ”‚  deepseek-as-subagent (this project, Python subprocess)         โ”‚
โ”‚    โ†“ HTTPS                                                      โ”‚
โ”‚  api.deepseek.com (your API key, paid per token)                โ”‚
โ””โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”˜

Everything except the actual DeepSeek API call stays on your machine.
No third-party proxy. No cloud relay. Your code never leaves your laptop.

Configuration

~/.deepseek-mcp/config.json:

{
  "api_key": "sk-...",
  "model": "deepseek-v4-pro",
  "max_turns": 50,
  "allowed_tools": ["Read", "Write", "Edit", "Bash", "Glob", "Grep", "NotebookEdit"]
}

Workspace (sandbox root) auto-follows the directory where you launch claude โ€” DeepSeek shares the same scope as Claude itself, no manual config needed. To lock the sandbox to a fixed path regardless of cwd, add "workspace": "/abs/path" to the config.

Override at runtime with env vars: DEEPSEEK_API_KEY, DEEPSEEK_WORKSPACE, DEEPSEEK_MODE=off.

Uninstall

./uninstall.sh

Removes the MCP registration, skill, and slash command. Doesn't touch your Claude Code, your Max OAuth, or your projects.

License

MIT

See related servers & alternatives โ†’

Related MCP servers

Browse all โ†’

Related guides

Hand-picked reading to help you choose and use Search servers.