Skip to main content
Glama

deepseek-agent-mcp

把 DeepSeek 智能体打包成 MCP Server,让别的 Agent(Claude Desktop、Cursor、DSH 自身、或任何 MCP 客户端)把它当工具调用。提供两个工具:

工具

能力

适用场景

delegate_task

裸模型 deepseek-v4-pro(无工具、无工作区)

快速问答、分析、写作

run_agent_task

完整 DSH agent:shell + 文件读写/编辑 + subagent + workflow + todo + 持久化,能真实改工作区

写代码、改文件、跑测试等真实任务

传输:stdio。运行时依赖:@modelcontextprotocol/sdk + zod(Node ≥ 20)。

1. 安装与启动

cd deepseek-agent-mcp
npm install        # 会顺便执行 prepare -> 编译出 dist/
npm run build      # 手动编译
npm start          # 运行 stdio MCP server(node dist/index.js)

凭据(API Key)

按顺序读取,命中即用:

  1. 环境变量 DEEPSEEK_API_KEY

  2. DSH 自己的凭据文件 ~/.dsh/.credentials.yaml

第 2 条对 DSH 特别有用:DSH 的 stdio MCP 启动器会清除环境里看起来像凭据的变量,但凭据文件不受影响。

环境变量

变量

默认

说明

DEEPSEEK_API_KEY

~/.dsh/.credentials.yaml 回退

DeepSeek API Key

DEEPSEEK_BASE_URL

https://api.deepseek.com

API 端点

DEEPSEEK_MCP_MODEL

deepseek-v4-pro

delegate_task 默认模型

DEEPSEEK_HARNESS_ROOT

run_agent_task 用的 deepseek-harness checkout 路径(run_agent_taskharness_root 参数优先)

Related MCP server: DeepSeek MCP Server

2. 工具说明

2.1 delegate_task —— 裸模型

把任务交给 DeepSeek 模型,返回回答。无状态、无工具、不碰文件。

参数

类型

必填

默认

说明

task

string

任务/问题

system

string

可选系统提示

model

enum

deepseek-v4-pro

deepseek-v4-pro / deepseek-v4-flash

reasoning_effort

enum

high

off / high / max

max_tokens

int

8192

输出上限(≤256000)

2.2 run_agent_task —— 完整 agent

启动一次 dsh --profile headless "<task>",跑完整 DSH 编码 agent(shell、文件读写/编辑、subagent、workflow、todo、JSONL 持久化),在指定工作区里真实执行并修改文件,返回最终回答。

参数

类型

必填

默认

说明

task

string

任务(目标、涉及文件、验收标准)

workspace

string

server 进程 cwd

agent 操作的工作区目录

harness_root

string

$DEEPSEEK_HARNESS_ROOT

deepseek-harness checkout 路径

profile

enum

headless

目前只支持 headless

timeout_ms

int

600000

超时杀掉(默认 10 分钟)

前置条件:本机要有一个已构建(pnpm install 过)的 deepseek-harness checkout,其 apps/cli/lib/bin.js 存在。首次运行 dsh --profile headless 会在 ~/.dsh/profiles/headless/ 自动初始化 profile(写几个小文件),属正常行为。

返回内容块:最终回答 → [agent] ok=... exit=... 状态 → 出错时带 [stderr] 诊断。退出码非 0 时 isError=true

3. 接入不同的 Agent

3.1 接入 DSH(本机)

插到 cordis.yml(或作为 --config overlay),DSH 里的工具名会是 mcp__deepseek__delegate_taskmcp__deepseek__run_agent_task

- insert:
    - id: deepseek-agent-mcp
      name: '@deepseek-ai/dsh-mcp-client'
      config:
        serverName: deepseek
        transport: stdio
        command: node
        args: ['D:/dsh/deepseek-agent-mcp/dist/index.js']
        cwd: D:/dsh/deepseek-agent-mcp
        env:
          DEEPSEEK_HARNESS_ROOT: 'D:/deepseek-harness'
        # 完整 agent + 思考型任务可能很久,放宽超时
        toolCallTimeoutMs: 900000

DSH 的 stdio 启动器会清掉 DSH_* 和凭据类环境变量,但 config.env 里显式写的变量会在清洗之后合并进去,所以上面显式写 DEEPSEEK_HARNESS_ROOT 是安全的;DEEPSEEK_API_KEY 不必写,server 会从 ~/.dsh/.credentials.yaml 读。

3.2 接入 Claude Desktop

claude_desktop_config.json(macOS ~/Library/Application Support/Claude/claude_desktop_config.json,Windows %APPDATA%\Claude\claude_desktop_config.json):

{
  "mcpServers": {
    "deepseek": {
      "command": "node",
      "args": ["D:/dsh/deepseek-agent-mcp/dist/index.js"],
      "env": {
        "DEEPSEEK_API_KEY": "sk-...",
        "DEEPSEEK_HARNESS_ROOT": "D:/deepseek-harness"
      }
    }
  }
}

3.3 接入 Cursor / 其它 mcp.json 客户端

.cursor/mcp.json(或通用 .mcp.json):

{
  "mcpServers": {
    "deepseek": {
      "command": "node",
      "args": ["D:/dsh/deepseek-agent-mcp/dist/index.js"],
      "env": {
        "DEEPSEEK_API_KEY": "sk-...",
        "DEEPSEEK_HARNESS_ROOT": "D:/deepseek-harness"
      }
    }
  }
}

4. 验证

npm run build      # 编译
npm run test:api   # 直接打 DeepSeek API,验证 key/端点/模型/思考参数
npm run test:mcp   # 进程内 MCP 往返:listTools + delegate_task 真实调用 + run_agent_task 冒烟
npm run smoke      # (真实环境)通过 MCP stdio 起子进程,listTools + 一次真实 delegate_task

test:mcp 用 SDK 的 InMemoryTransport 做完整 MCP 握手,不依赖子进程管道,因此也能在禁止 named-pipe 的沙箱里跑;run_agent_task 的完整 agent 冒烟需要真实环境(见下)。

5. 安全与边界(重要)

  • run_agent_task 会真实执行:调用方等于把任务交给一个能跑 shell、能改文件的编码 agent。谁调用它,就等于授权它在 workspace 里做这些事——务必限制调用来源和工作区范围。

  • API Key 不回传:key 只在 server 进程内存里、且只作为 HTTPS 请求头发给 DEEPSEEK_BASE_URL(默认官方端点)。工具返回、schema、日志都不含 key。详见上一轮说明。

  • delegate_task无状态的裸模型,不带会话、工具、工作区。

  • run_agent_task 每次调用是独立的一次性会话(新 session),不跨调用共享上下文。

  • 模型/思考参数由 ~/.dsh/settings.yamlagent-default-model)决定,run_agent_task 走 DSH 的默认模型选择。

6. 可移植替代方案(Python SDK)

如果不想依赖一个本机 checkout,官方更「可携带」的入口是 Python SDK deepseek-harness-sdk,它捆绑运行时并复用同一套完整 agent 组合:

from deepseek_harness import DeepSeekHarness

with DeepSeekHarness(
    provider="deepseek-official",
    model="deepseek-v4-pro",
    cwd="/path/to/workspace",          # agent 可修改的工作区
    session_root="/path/to/.dsh-sessions",
) as harness:
    result = harness.run("fix the failing test")
    print(result.final_response, result.finish_reason)

它返回结构化 RunResultfinal_responsefinish_reasonsession_id),且运行时子进程可跨调用复用。参考 examples/jsonrpc-agent/minimal.pypython/sdk/README.md。把这段包进一个 Python MCP server(mcp 包)即可得到同样效果、且自带运行时的版本;本仓库当前用 CLI 方案是因为它无需额外 pip install 和运行时构建。

Available Tools

2 tools
delegate_taskDelegate a task to the DeepSeek modelA

Send a task or question to the raw DeepSeek model (deepseek-v4-pro) and return its answer. Fast and cheap, but has NO tools and cannot touch files. For work that needs a shell, file edits, or sub-agents, use run_agent_task instead. Stateless: put all context into the task (or the optional system prompt).

ParametersJSON Schema
NameRequiredDescriptionDefault
taskYesThe task or question to delegate. Be specific about the goal, context, and expected output.
modelNoWhich DeepSeek model answers the task.deepseek-v4-pro
systemNoOptional system instruction: persona, constraints, or output format for this call.
max_tokensNoMaximum output tokens for the answer (default 8192).
reasoning_effortNoReasoning budget. "off" disables thinking (fastest); "high" and "max" enable the reasoning channel.high

TDQS

A4.7/5.0
Behavior4/5

Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?

With no annotations provided, the description carries the full burden and discloses key behavioral traits: has NO tools, cannot touch files, stateless, and returns the raw model answer. It doesn't mention error handling, rate limits, or the exact response structure, but the critical limitations are clearly stated for a simple delegation tool.

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness5/5

Is the description appropriately sized, front-loaded, and free of redundancy?

Four short, front-loaded sentences: purpose first, then limitations, then alternative tool, then stateless usage note. Every sentence earns its place with no filler or redundancy.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness5/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

For a simple stateless delegation tool with five straightforward parameters and a single sibling, the description covers purpose, when to use it, the alternative tool, capabilities/limitations, and context-passing guidance. The response format is only 'return its answer', but given the absence of an output schema and the simplicity of the expected output, this is sufficient.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters4/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

Schema coverage is 100%, which sets a baseline of 3. The description adds value beyond the schema by instructing that the task should carry all context and that the optional system prompt can contain instructions, which directly supplements the task and system parameter descriptions. It doesn't add details for max_tokens or reasoning_effort, but the schema already covers them well.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose5/5

Does the description clearly state what the tool does and how it differs from similar tools?

The description opens with a specific verb+resource: 'Send a task or question to the raw DeepSeek model' and states it returns the answer. It explicitly contrasts with the sibling run_agent_task by noting that shell/file/sub-agent work should use that alternative, which clearly differentiates this tool's purpose.

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines5/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

The description gives explicit usage context ('Fast and cheap') and names the exact alternative for when not to use this tool: 'For work that needs a shell, file edits, or sub-agents, use run_agent_task instead.' It also provides practical guidance by explaining the tool is stateless, so all context must be placed in the task or system prompt.

Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.

run_agent_taskRun the full DSH coding agent in a workspaceA

Run a complete DeepSeek Harness coding agent on a task. The agent has a shell, file read/write/edit, sub-agent delegation, workflow, todo, and session persistence — it can actually modify files in the given workspace. This spawns a one-shot dsh --profile headless process; it needs a built deepseek-harness checkout (set DEEPSEEK_HARNESS_ROOT, or pass harness_root). Use this for real coding/workspace work; use delegate_task for quick model-only questions.

ParametersJSON Schema
NameRequiredDescriptionDefault
taskYesThe task for the agent. Be specific: goal, files, acceptance criteria.
profileNodsh profile to boot (headless = one-shot coding agent).headless
workspaceNoDirectory the agent operates on (default: the server process cwd).
timeout_msNoKill the run after this many milliseconds (default 10 minutes).
harness_rootNoPath to the deepseek-harness checkout (default: $DEEPSEEK_HARNESS_ROOT).

TDQS

A4.4/5.0
Behavior4/5

Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?

With no annotations, the description carries the full burden of disclosing side effects. It clearly warns 'it can actually modify files in the given workspace' and explains it spawns a one-shot `dsh --profile headless` process. It does not describe return values or blocking behavior, but the key safety-relevant aspects are covered.

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness5/5

Is the description appropriately sized, front-loaded, and free of redundancy?

Three sentences, each earning its place: first states purpose, second lists capabilities and side effects, third gives usage guidance and alternative. Front-loaded with the core action, no filler or repetition.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness4/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

Given the tool's complexity (agent with shell, file modifications, sub-agents) and lack of output schema/annotations, the description is thorough: it covers capabilities, side effects, prerequisites, and alternative tools. It does not mention the return/result format, which would be helpful, but it is otherwise complete for an agent-invocation tool.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters3/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

Schema description coverage is 100%, so the parameters (task, profile, workspace, timeout_ms, harness_root) are already fully documented. The description adds minimal extra meaning beyond schema; it mentions the harness_root environment variable and the workspace scope, which aligns with but does not exceed schema descriptions.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose5/5

Does the description clearly state what the tool does and how it differs from similar tools?

The description opens with a specific verb+resource: 'Run a complete DeepSeek Harness coding agent on a task.' It also explicitly distinguishes from the sibling tool, noting 'use delegate_task for quick model-only questions,' which clarifies its unique scope.

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines5/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

Provides explicit when-to-use guidance: 'Use this for real coding/workspace work; use delegate_task for quick model-only questions.' It also states prerequisites (a built deepseek-harness checkout, DEEPSEEK_HARNESS_ROOT or harness_root) which tells the agent when this tool is appropriate and what setup is required.

Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.

TDQS

A4.5/5.0
Disambiguation5/5

The two tools are clearly distinct: delegate_task is a stateless raw model call, while run_agent_task spawns a full agent with workspace access. The descriptions explicitly contrast them and cross-reference each other, leaving no ambiguity.

Naming Consistency5/5

Both tools follow a consistent verb_noun pattern (delegate_task, run_agent_task), using a single naming convention that is predictable and readable.

Tool Count4/5

With only 2 tools, the set is slightly under the typical well-scoped range, but given the server's narrow purpose of offering two modes of DeepSeek interaction, the count is reasonable and not excessive.

Completeness4/5

The tool surface fully covers its stated domain: a simple model query and a full agent execution. No critical operations are missing, though there are no extra lifecycle tools (e.g., cancel/status) that a broader agent workflow might expect.

Maintenance

ActivityMaintained
ResponsivenessSyncing

Resources

Unclaimed servers have limited discoverability.

Looking for Admin?

If you are the server author, to access and configure the admin panel.

Related MCP Connectors

Related MCP Servers

Latest Blog Posts

MCP directory API

We provide all the information about MCP servers via our MCP API.

curl -X GET 'https://glama.ai/api/mcp/v1/servers/mbj733/deepseek-agent-mcp'

If you have feedback or need assistance with the MCP directory API, please join our Discord server