deepseek-mcp
Enables using DeepSeek models as a small, cheap supervised worker from any MCP-compatible client, providing fast flash and deep reasoning tools for bounded tasks.
README
deepseek-mcp
Use DeepSeek from Claude Code, Codex, or any MCP-compatible client as a small, cheap supervised worker.
deepseek-mcp is a tiny stdio MCP server with two tools:
deepseek(prompt, system?) — fast, cheap, non-thinking (flash)
advise(prompt, system?, effort?) — deep reasoning (pro + thinking)
It is built for bounded tasks where another model can reduce mechanical load:
- classify inboxes, tickets, logs, notes, or docs;
- summarize packets;
- turn messy text into JSON or tables;
- populate templates;
- generate first-pass mechanical edits;
- produce reviewable candidate output for a human or primary agent.
It is not built for autonomous architecture, security policy, final client prose, or decisions where the hard part is judgment.
Quickstart
1. Install
Zero-install with uvx:
DEEPSEEK_API_KEY="sk-..." uvx deepseek-mcp-server
Or install persistently:
pip install "git+https://github.com/arizen-dev/deepseek-mcp.git"
Or clone and install locally:
git clone https://github.com/arizen-dev/deepseek-mcp.git
cd deepseek-mcp
pip install -e .
2. Add your DeepSeek key
Create an API key at:
https://platform.deepseek.com/api_keys
Then export it:
export DEEPSEEK_API_KEY="sk-..."
For Claude Code, the lowest-friction setup is to put the key in your global settings:
{
"env": {
"DEEPSEEK_API_KEY": "sk-..."
}
}
Path:
~/.claude/settings.json
MCP servers are started when the client launches, so restart Claude Code or Codex after changing env/config.
3. Configure MCP
If you installed via pip (or uvx), use the installed command directly:
{
"mcpServers": {
"deepseek": {
"command": "deepseek-mcp-server",
"args": [],
"env": {
"DEEPSEEK_API_KEY": "${DEEPSEEK_API_KEY}"
}
}
}
}
If you cloned the repo, point to the script directly:
{
"mcpServers": {
"deepseek": {
"command": "python3",
"args": ["/absolute/path/to/deepseek-mcp/deepseek_mcp_server.py"],
"env": {
"DEEPSEEK_API_KEY": "${DEEPSEEK_API_KEY}"
}
}
}
}
After restart, /mcp should show a deepseek server.
In Claude Code, the tool names are:
mcp__deepseek__deepseek — flash (fast, mechanical)
mcp__deepseek__advise — pro (deep reasoning)
Codex
For Codex, add a global MCP server in ~/.codex/config.toml:
[mcp_servers.deepseekWorker]
command = "deepseek-mcp-server"
args = []
[mcp_servers.deepseekWorker.env]
DEEPSEEK_API_KEY = "sk-..."
Codex TOML does not expand "${DEEPSEEK_API_KEY}" in the same way Claude project MCP configs do. Put the key directly in the TOML env block or use whatever secret mechanism your Codex environment supports.
Demo
Prompt:
Classify these files into doc / code / config. Return JSON only:
- README.md
- pyproject.toml
- src/deepseek_mcp/server.py
Example output:
[
{"file": "README.md", "type": "doc"},
{"file": "pyproject.toml", "type": "config"},
{"file": "src/deepseek_mcp/server.py", "type": "code"}
]
The server appends lightweight metadata:
---
_deepseek · model=deepseek-v4-flash latency=18.42s tokens=52+74 cost=$0.0001_
Latency depends heavily on prompt size, model, network, and API load. Treat benchmark numbers as directional, not a guarantee.
CLI
After installing, you can use the CLI for smoke tests and one-shot calls:
# Validate setup
python -m deepseek_mcp check
# One-shot flash call
python -m deepseek_mcp run "Classify: urgent / later — 'Server down in prod'"
# Advisor call with deep reasoning
python -m deepseek_mcp advise "Should we build or buy analytics?" --effort max
Exit codes: 0 = success, 1 = API error, 2 = missing key.
Models
| Tool | Model | Mode | Best for |
|---|---|---|---|
deepseek |
deepseek-v4-flash | Non-thinking | Classification, extraction, formatting, mechanical edits |
advise |
deepseek-v4-pro | Thinking (effort: medium/high/max) | Architecture, tradeoffs, second opinions, ambiguity |
Cost
Per-call cost depends on token count and model. Pricing per api.deepseek.com (checked 2026-04-30).
| Model | Input (miss) | Input (cache hit) | Output |
|---|---|---|---|
deepseek-v4-flash |
$0.14/1M | $0.0028/1M | $0.28/1M |
deepseek-v4-pro |
$0.435/1M¹ | $0.0036/1M¹ | $0.87/1M¹ |
¹ Pro pricing is 75% off until 2026-05-31. Non-discounted: $1.74/$0.0145/$3.48.
Typical per-call cost (cache miss):
| Task | Flash | Pro |
|---|---|---|
| Small (~1K in + ~0.5K out) | ~$0.0003 | ~$0.0009 |
| Medium (~4K in + ~2K out) | ~$0.001 | ~$0.003 |
Each response footer includes an estimated cost=$... based on token usage.
Environment variables
| Variable | Default | Description |
|---|---|---|
DEEPSEEK_API_KEY |
— | Required. Your DeepSeek API key. |
DEEPSEEK_BASE_URL |
https://api.deepseek.com |
API base URL (change for proxy/compatible providers). |
DEEPSEEK_MCP_LOG |
(unset) | Set to 1 to log call metadata to ~/.deepseek-mcp/calls.jsonl (no prompts logged). |
When to use it
Good:
- "Classify these 200 filenames. Mark uncertainty."
- "Turn this rough note into a CSV table."
- "Extract all TODOs and group them by owner."
- "Create candidate JSON from this messy list. Use null for missing values."
- "Summarize this packet for review; do not make decisions."
Bad:
- "Design my architecture."
- "Write the final client email."
- "Decide whether this is secure."
- "Resolve this ambiguous business rule."
- "Publish this reply directly."
Use it like a fast junior analyst whose work you will review, not like an owner.
How it works
The server:
- reads JSON-RPC messages from stdin;
- exposes two MCP tools:
deepseek(flash, non-thinking) andadvise(pro, thinking); - sends your prompt to DeepSeek's OpenAI-compatible chat completions API;
- streams the response;
- returns the text plus model, latency, token, and cost metadata.
There is no database, no background daemon, no local web server, and no file-system access beyond the MCP client starting the process.
Smoke test
After installing:
echo '{"jsonrpc":"2.0","id":1,"method":"tools/list"}' \
| DEEPSEEK_API_KEY="sk-..." deepseek-mcp-server
You should see a JSON response with two tools (deepseek + advise).
Then test a real call:
echo '{"jsonrpc":"2.0","id":2,"method":"tools/call",\
"params":{"name":"deepseek","arguments":{"prompt":"Return exactly: ok"}}}' \
| DEEPSEEK_API_KEY="sk-..." deepseek-mcp-server
Examples
See examples/ for real prompt templates:
- flash_classify.md — inbox triage
- advise_architecture.md — architecture decision
- advise_tradeoff.md — build vs buy
Benchmark
See docs/benchmark.md for validation observations and usage guidance.
Development
pip install -e ".[dev]"
pip install -r requirements-dev.txt # alternative
python -m pytest
Compatible endpoints
deepseek-mcp works with any OpenAI-compatible API. Set DEEPSEEK_BASE_URL to point elsewhere:
| Provider | DEEPSEEK_BASE_URL |
Notes |
|---|---|---|
| DeepSeek | https://api.deepseek.com |
Default |
| Google Gemini | https://generativelanguage.googleapis.com/v1beta/openai/ |
Requires Gemini API key; models like gemini-2.5-flash |
| Ollama (local) | http://localhost:11434/v1 |
Run any local model; e.g. llama3, qwen2.5 |
| vLLM (self-hosted) | http://localhost:8000/v1 |
For self-hosted open-weight models |
| Mistral API | https://api.mistral.ai/v1 |
Requires Mistral API key |
Security notes
- The worker returns text only. It cannot call tools, write files, or access your repo. Output lands in the primary model's context — you review before anything is used.
- Do not commit API keys.
- Prefer client/global env injection over hardcoding keys in project repos.
- Treat model output as untrusted candidate text.
- Do not give the tool access to secrets you would not paste into DeepSeek directly.
- Review output before it reaches users, customers, production systems, or public channels.
License
MIT
推荐服务器
Baidu Map
百度地图核心API现已全面兼容MCP协议,是国内首家兼容MCP协议的地图服务商。
Playwright MCP Server
一个模型上下文协议服务器,它使大型语言模型能够通过结构化的可访问性快照与网页进行交互,而无需视觉模型或屏幕截图。
Magic Component Platform (MCP)
一个由人工智能驱动的工具,可以从自然语言描述生成现代化的用户界面组件,并与流行的集成开发环境(IDE)集成,从而简化用户界面开发流程。
Audiense Insights MCP Server
通过模型上下文协议启用与 Audiense Insights 账户的交互,从而促进营销洞察和受众数据的提取和分析,包括人口统计信息、行为和影响者互动。
VeyraX
一个单一的 MCP 工具,连接你所有喜爱的工具:Gmail、日历以及其他 40 多个工具。
graphlit-mcp-server
模型上下文协议 (MCP) 服务器实现了 MCP 客户端与 Graphlit 服务之间的集成。 除了网络爬取之外,还可以将任何内容(从 Slack 到 Gmail 再到播客订阅源)导入到 Graphlit 项目中,然后从 MCP 客户端检索相关内容。
Kagi MCP Server
一个 MCP 服务器,集成了 Kagi 搜索功能和 Claude AI,使 Claude 能够在回答需要最新信息的问题时执行实时网络搜索。
e2b-mcp-server
使用 MCP 通过 e2b 运行代码。
Neon MCP Server
用于与 Neon 管理 API 和数据库交互的 MCP 服务器
Exa MCP Server
模型上下文协议(MCP)服务器允许像 Claude 这样的 AI 助手使用 Exa AI 搜索 API 进行网络搜索。这种设置允许 AI 模型以安全和受控的方式获取实时的网络信息。