deepseek-mcp

deepseek-mcp

Local MCP server that provides DeepSeek-powered code review, file analysis, and consultation tools for coding agents, enabling read-only analysis with minimal token overhead.

Category
访问服务器

README

deepseek-mcp

A local MCP server that makes DeepSeek available to your primary coding agent for code review and second opinions.

The server reads the repo itself. Your agent passes a git ref or a list of paths — never the code — so a review costs about twenty tokens on the way in instead of several thousand.

Tools

Tool Use it for Model
review_changes Review a diff. Uncommitted work by default, or a branch via base. review
review_files Review whole files — architecture, an unfamiliar module, a suspected bug. review
consult Ask a specific question. Supports multi-turn via history. consult

All three are read-only and take paths, not content.

Install

npm i -g @berrydev-ai/deepseek-mcp

That puts a deepseek-mcp binary on your PATH; no checkout needed. Or skip the install and let your MCP client fetch it on demand with npx -y @berrydev-ai/deepseek-mcp, at the cost of a slower cold start.

One caveat if you install from source instead: avoid npm i -g git+https://github.com/berrydev-ai/deepseek-mcp.git. On npm 10.x it appears to succeed but symlinks the global package at a bare clone in the cache with no working tree, leaving bin dangling. Use the registry, or a tarball. dist/ is committed so that installing from git or a tarball still works — a global install has no devDependencies, so nothing can compile at install time.

Configure

There is no dotenv loader. The server reads process.env and nothing else, so .env is a reference for what to set rather than a file that gets read. Configuration belongs in your MCP client's env block.

Claude Code

claude mcp add deepseek -s user -e DEEPSEEK_API_KEY=sk-... -- deepseek-mcp

-s user registers it across all your projects. Without it the default is local scope, which is limited to the directory you ran the command in.

Codex

codex mcp add deepseek --env DEEPSEEK_API_KEY=sk-... -- deepseek-mcp

Note --env rather than Claude's -e, and that the command to launch goes after -- in both. Codex writes to ~/.codex/config.toml globally, so there is no scope flag to think about. The equivalent by hand:

[mcp_servers.deepseek]
command = "deepseek-mcp"

[mcp_servers.deepseek.env]
DEEPSEEK_API_KEY = "sk-..."

Verify with codex mcp get deepseek, and codex mcp remove deepseek to undo.

Any other MCP client

{
  "mcpServers": {
    "deepseek": {
      "command": "deepseek-mcp",
      "env": {
        "DEEPSEEK_API_KEY": "sk-..."
      }
    }
  }
}

Note that a missing key does not stop the server from starting, so the client will report it as connected either way — assertConfigured only fires on the first tool call. If every call comes back with "DEEPSEEK_API_KEY is not set", the env block is the place to look.

The server operates on its working directory, which is normally your project. Set DEEPSEEK_REPO_ROOT to override.

Local development

git clone https://github.com/berrydev-ai/deepseek-mcp.git
cd deepseek-mcp && npm install && npm run build

Run npm run build and commit dist/ alongside any source change, otherwise installs keep serving the previous build.

Direct or through AI Gateway

One env var, no code change. https://api.deepseek.com is the default and has no dependencies. Pointing DEEPSEEK_BASE_URL at a Cloudflare AI Gateway endpoint instead gets you request logs, spend caps, caching and the ability to swap models without touching this repo — worth it the moment you want to compare two models on the same review.

Tuning the prompts

prompts/review.md and prompts/consult.md are the entire behaviour of the server. They are plain markdown; edit and restart. Both are written to keep output tight, because whatever DeepSeek returns lands in your primary agent's context window and competes with everything else there.

The review prompt enforces severity grouping and file:line anchors, and forbids restating what the code does. If reviews come back vague, the fix is almost always in that file rather than in the TypeScript.

Getting it actually invoked

The most common failure mode is not a bug — it is that the primary agent never calls the tool. Coding agents are reluctant to delegate. The tool descriptions are written to draw a clear line (substantial changes yes, one-line edits no), but you may still need to ask for it explicitly at first, or add a line to your CLAUDE.md telling the agent to get a DeepSeek review before opening a PR.

Delegation only pays for itself on work that involves reading and analysing real amounts of code. On small tasks the per-call overhead dominates.

Guards

  • Paths are resolved and rejected if they escape the repo root.
  • Git refs are validated so an argument cannot be smuggled in as an option.
  • Input is truncated at a character budget, and the response says when that happened.
  • Model calls abort at 55s, below the ~60s tool-call timeout most clients enforce, so you get a clear message rather than a hang.
  • Every response carries a footer with file count, model and token usage.

Notes

Built on @modelcontextprotocol/server v2 via serveStdio, which serves both the 2025 and 2026-07-28 protocol revisions from one factory — clients on either revision work without configuration.

Model defaults are deepseek-v4-flash for reviews and deepseek-v4-pro for consults. Check them against whichever endpoint you point at — the names move over time.

Watch out for the older deepseek-chat and deepseek-reasoner names. They still return 200, but the response comes back as deepseek-v4-flash, so a stale value costs you the reasoning model without ever raising an error. The model in the response footer is read from the provider's reply rather than from your config, so it will tell you what actually ran.

License

MIT — see LICENSE.

推荐服务器

Baidu Map

Baidu Map

百度地图核心API现已全面兼容MCP协议,是国内首家兼容MCP协议的地图服务商。

官方
精选
JavaScript
Playwright MCP Server

Playwright MCP Server

一个模型上下文协议服务器,它使大型语言模型能够通过结构化的可访问性快照与网页进行交互,而无需视觉模型或屏幕截图。

官方
精选
TypeScript
Magic Component Platform (MCP)

Magic Component Platform (MCP)

一个由人工智能驱动的工具,可以从自然语言描述生成现代化的用户界面组件,并与流行的集成开发环境(IDE)集成,从而简化用户界面开发流程。

官方
精选
本地
TypeScript
Audiense Insights MCP Server

Audiense Insights MCP Server

通过模型上下文协议启用与 Audiense Insights 账户的交互,从而促进营销洞察和受众数据的提取和分析,包括人口统计信息、行为和影响者互动。

官方
精选
本地
TypeScript
VeyraX

VeyraX

一个单一的 MCP 工具,连接你所有喜爱的工具:Gmail、日历以及其他 40 多个工具。

官方
精选
本地
graphlit-mcp-server

graphlit-mcp-server

模型上下文协议 (MCP) 服务器实现了 MCP 客户端与 Graphlit 服务之间的集成。 除了网络爬取之外,还可以将任何内容(从 Slack 到 Gmail 再到播客订阅源)导入到 Graphlit 项目中,然后从 MCP 客户端检索相关内容。

官方
精选
TypeScript
Kagi MCP Server

Kagi MCP Server

一个 MCP 服务器,集成了 Kagi 搜索功能和 Claude AI,使 Claude 能够在回答需要最新信息的问题时执行实时网络搜索。

官方
精选
Python
e2b-mcp-server

e2b-mcp-server

使用 MCP 通过 e2b 运行代码。

官方
精选
Neon MCP Server

Neon MCP Server

用于与 Neon 管理 API 和数据库交互的 MCP 服务器

官方
精选
Exa MCP Server

Exa MCP Server

模型上下文协议(MCP)服务器允许像 Claude 这样的 AI 助手使用 Exa AI 搜索 API 进行网络搜索。这种设置允许 AI 模型以安全和受控的方式获取实时的网络信息。

官方
精选