Skip to main content
Glama
DeepSeek Web MCP

DeepSeek Web MCP

by kia69028

DeepSeek Web MCP

基于 DeepSeek 官方 Search & Fetch API 的 MCP 服务器,提供两个工具:

工具

对应官方 API

功能

web_search

POST /v1/tools/search

DeepSeek 自研引擎联网搜索,返回结构化结果(标题/链接/摘要/相关性评分/权威级别/日期)

web_fetch

POST /v1/tools/fetch

抓取单个网页,正文转为 Markdown 返回

环境要求

  • Node.js ≥ 18

Related MCP server: deepseek-websearch-mcp

安装

git clone https://github.com/kia69028/deepseek-web-mcp.git
cd deepseek-web-mcp
npm install

配置 API Key

  1. 在 DeepSeek 开放平台 创建 API Key

  2. 在 MCP 客户端中添加一个 stdio 服务器,args 指向本仓库 server.js 的绝对路径:

{
  "mcpServers": {
    "deepseek-web": {
      "type": "stdio",
      "command": "node",
      "args": ["/absolute/path/to/deepseek-web-mcp/server.js"],
      "env": {
        "DEEPSEEK_API_KEY": "sk-你的key"
      }
    }
  }
}
  1. 重启客户端,检查 MCP 连接状态。

未配置 key 时服务器仍能启动,但调用工具会返回配置指引而不是崩溃。

安全提示:不要把 API Key 提交到仓库。.env 已在 .gitignore 中忽略,推荐通过客户端的环境变量配置或密钥管理工具注入。

环境变量

变量

默认值

说明

DEEPSEEK_API_KEY

(无)

必填,DeepSeek API Key

DEEPSEEK_BASE_URL

https://api.deepseek.com

API 基址(代理/兼容网关时可改)

DEEPSEEK_TIMEOUT_MS

60000

单次请求超时(毫秒)

MAX_CONTENT_CHARS

20000

web_search 开启 need_content 时单条正文的截断长度

工具说明

{ "query": "商汤科技 最新新闻", "count": 10, "need_content": false, "ori_question": "最近商汤有什么动态?" }
  • query:1–128 字符,支持操作符:

    • site:github.com OR site:huggingface.co 限定站点;-site: 排除站点

    • -词 / -"短语" 排除;"短语" 精确匹配

    • lang:zh,en 限定语言;after:2026-10-01 / before:2026-10-21 限定日期

  • count:1–50,默认 10

  • need_content:true 时每条结果附页面正文(更大更贵流量,默认关闭)

  • ori_question:触发搜索的原始用户问题,改善查询理解

  • 结果字段:rerank_score(0–3,≥1.5 高质量)、summary(600–800 字长摘要)、authority(0–4,≥3 高权威)、date、site_name

web_fetch

{ "url": "https://example.com/article", "max_chars": 60000 }
  • 仅支持 HTTP/HTTPS、带主机名、不含用户名密码的 URL(官方限制)

  • 返回 { title, url, content },content 为 Markdown

  • max_chars:截断保护上下文,默认 60000,0 = 不截断

计费与限流(官方)

  • Search / Fetch 均 每 1000 次成功请求 $0.75;仅 HTTP 200 且有结果时计费,失败、空结果不计费

  • 限流:Search 100 QPS,Fetch 25 QPS(Fetch 另有按域名限制),超限返回 429

测试

npm test

冒烟测试会以 stdio 启动服务器并验证:握手 → tools/list → 未配置 key 的错误路径。 配置了 DEEPSEEK_API_KEY 环境变量时会额外发起一次真实搜索与抓取。

故障排查

现象

处理

工具返回 401

检查 config.json 里的 DEEPSEEK_API_KEY 是否填写正确

返回 402

DeepSeek 账户余额不足,充值后重试

返回 429

触发限流,稍后重试

返回 404(fetch)

页面不存在/被屏蔽/内容类型不支持/无可提取正文

服务器未连接

ZCode 设置 → MCP 查看状态;确认 node 在 PATH 中

Tool Schema Changelog

Recent tool additions, removals, and schema changes observed during successful MCP inspections.

Loading tool schema changelog…

    Related MCP Connectors

    Related MCP Servers

    • A
      license
      A
      quality
      C
      maintenance
      Enables agents to run web searches with query operators and to fetch web pages as Markdown through DeepSeek's native Search/Fetch JSON API. It acts as a fallback for hosts whose built-in web tools are unavailable or return errors such as HTTP 403, rather than retrying them repeatedly.
      2
      1
      MIT
    • A
      license
      A
      quality
      B
      maintenance
      Enables MCP-capable AI clients to run web searches through DeepSeek's search engine and fetch individual webpages as Markdown. Search results include relevance scores, authority, and publication times, and support advanced query syntax such as site:, lang:, and date filters.
      2
      52 npm
      1
      Apache 2.0
    • A
      license
      Not graded
      quality
      C
      maintenance
      Enables MCP clients to run web searches and fetch individual web pages as Markdown through DeepSeek's official Search/Fetch API, with freshness filtering, structured metadata such as publish date, authority and rerank scores, and raw structured output.
      50 npm
      4
      MIT
    • A
      license
      Not graded
      quality
      C
      maintenance
      Enables agents to run web searches and fetch HTTP(S) pages as Markdown via the DeepSeek Search/Fetch API, returning titles, URLs, summaries, publication dates, authority scores, and optional page content. Supports advanced query operators like site:, exact phrases, exclusion terms, lang:, and date-range filters, with retries, timeouts, and structured errors.
      1
      MIT