DeepSeek MCP Patch Worker

DeepSeek MCP Patch Worker

Generates or reviews Git unified diffs via DeepSeek API with local path validation, enabling secure patch suggestions without scanning repositories.

Category
Visit Server

README

DeepSeek MCP Patch Worker

一个可本地安装、通过 STDIO 运行的 MCP 服务。它把调用方明确提供的代码上下文发送给 DeepSeek,并返回经过本地路径校验的 Git unified diff;它不会扫描或修改你的仓库。

非 DeepSeek 官方项目。调用 DeepSeek API 会发送数据并产生费用,请先阅读 SECURITY.md。

功能

  • 同步生成或审查候选补丁:generate_patch、review_patch
  • 后台长任务:submit_patch_job、get_patch_job、get_patch_result、cancel_patch_job
  • 本地能力查询:get_capabilities(不调用 API)
  • 严格限制补丁只能修改 allowed_paths 中的路径
  • 拒绝二进制补丁、越权路径和超限响应
  • 只持久化任务摘要、哈希、聚合进度和已校验结果,不持久化完整提示词、文件上下文或推理内容

安装

需要 Python 3.10 或更高版本。

git clone https://github.com/prelearn-code/deepseek-mcp.git
cd deepseek-mcp
python -m venv .venv

Linux/macOS:

.venv/bin/python -m pip install -U pip
.venv/bin/python -m pip install -e .
export DEEPSEEK_API_KEY="your-key"

Windows PowerShell:

.venv\Scripts\python.exe -m pip install -U pip
.venv\Scripts\python.exe -m pip install -e .
$env:DEEPSEEK_API_KEY = "your-key"

不要把真实密钥写进 Git、TOML 示例或命令历史。推荐通过操作系统的密钥管理或在启动 MCP 客户端前设置环境变量。

接入 Codex

将 config.example.toml 复制到 ~/.codex/config.toml,并替换 Python 的绝对路径。Windows 的 command 应改为类似:

command = "C:/absolute/path/deepseek-mcp/.venv/Scripts/python.exe"

重启 Codex 后运行 codex mcp list,或在 Codex 中输入 /mcp。示例使用 env_vars 转发已存在的环境变量,并将工具审批设为 prompt,因为每次模型调用都可能发送代码并产生费用。

其他支持 STDIO 的 MCP 客户端可用相同入口启动:

/absolute/path/.venv/bin/python -m deepseek_worker.server

配置

环境变量 用途 默认值
DEEPSEEK_API_KEY 必需的 API 密钥 无
DEEPSEEK_BASE_URL OpenAI-compatible API 地址 https://api.deepseek.com
DEEPSEEK_STATE_DIR 后台任务数据库目录 操作系统的用户 state 目录
DEEPSEEK_JOB_WORKERS 后台并发数 2

默认模型为 deepseek-v4-pro,也支持 deepseek-v4-flash。官方 API 当前使用 POST /chat/completions、JSON Output 和流式响应。

开发与验证

测试不会调用真实 API:

.venv/bin/python -m pip install -e ".[dev]"
.venv/bin/python -m pytest -q
.venv/bin/python -m build

GitHub Actions 会在 Linux、Windows 和 macOS 的 Python 3.10/3.13 上运行相同验证。

安全模型

返回的补丁始终是不可信候选内容。调用方仍需审查完整 diff、应用补丁并运行格式化、lint、构建和测试。allowed_paths 只能约束输出补丁路径,不能识别输入中是否包含敏感数据。

Recommended Servers

playwright-mcp

playwright-mcp

A Model Context Protocol server that enables LLMs to interact with web pages through structured accessibility snapshots without requiring vision models or screenshots.

Official
Featured
TypeScript
Magic Component Platform (MCP)

Magic Component Platform (MCP)

An AI-powered tool that generates modern UI components from natural language descriptions, integrating with popular IDEs to streamline UI development workflow.

Official
Featured
Local
TypeScript
Audiense Insights MCP Server

Audiense Insights MCP Server

Enables interaction with Audiense Insights accounts via the Model Context Protocol, facilitating the extraction and analysis of marketing insights and audience data including demographics, behavior, and influencer engagement.

Official
Featured
Local
TypeScript
VeyraX MCP

VeyraX MCP

Single MCP tool to connect all your favorite tools: Gmail, Calendar and 40 more.

Official
Featured
Local
graphlit-mcp-server

graphlit-mcp-server

The Model Context Protocol (MCP) Server enables integration between MCP clients and the Graphlit service. Ingest anything from Slack to Gmail to podcast feeds, in addition to web crawling, into a Graphlit project - and then retrieve relevant contents from the MCP client.

Official
Featured
TypeScript
Kagi MCP Server

Kagi MCP Server

An MCP server that integrates Kagi search capabilities with Claude AI, enabling Claude to perform real-time web searches when answering questions that require up-to-date information.

Official
Featured
Python
E2B

E2B

Using MCP to run code via e2b.

Official
Featured
Neon Database

Neon Database

MCP server for interacting with Neon Management API and databases

Official
Featured
Exa Search

Exa Search

A Model Context Protocol (MCP) server lets AI assistants like Claude use the Exa AI Search API for web searches. This setup allows AI models to get real-time web information in a safe and controlled way.

Official
Featured
Qdrant Server

Qdrant Server

This repository is an example of how to create a MCP server for Qdrant, a vector search engine.

Official
Featured