Skip to main content
Glama
deepseek-websearch-mcp

deepseek-websearch-mcp

by xinzhuang

deepseek-websearch-mcp

基于 DeepSeek 网页搜索与抓取 API 的 MCP server(stdio 传输),为支持 MCP 的 AI 客户端(Claude Code、Cursor、VS Code 等)提供两个工具:

  • web_search —— DeepSeek 自研搜索引擎,返回带相关性分数、权威性、发布时间的结构化结果,支持 site:、lang:、after: 等搜索语法

  • web_fetch —— 抓取单个网页,返回 Markdown 正文

前置要求

  • Node.js ≥ 20

  • DeepSeek API Key(Search/Fetch 按成功请求计费:5 元/千次)

Related MCP server: DeepSeek Search MCP

安装与配置

认证信息通过环境变量 DEEPSEEK_API_KEY 注入。

环境变量

必填

默认

说明

DEEPSEEK_API_KEY

是

-

DeepSeek API Key,缺失时启动即退出

DEEPSEEK_BASE_URL

否

https://api.deepseek.com

API 基址(自建网关/调试用)

DEEPSEEK_TIMEOUT_MS

否

60000

单次 HTTP 请求超时(毫秒)

方式一:npx 直接运行(推荐)

npx -y @frankzhang.ai/deepseek-websearch-mcp

方式二:全局安装

npm install -g @frankzhang.ai/deepseek-websearch-mcp
deepseek-websearch-mcp

方式二备选:从 GitHub 安装(不经 npm registry)

npx -y github:xinzhuang/deepseek-websearch-mcp

注意:npm v11 对 npm install -g github:... 存在已知缺陷(安装后留下指向已清理临时目录的死链,见 npm/cli#1390 一类问题),如遇 command not found 请改用上方 registry 安装。

方式三:客户端配置

Claude Code

claude mcp add deepseek-websearch -s user -e DEEPSEEK_API_KEY=sk-你的key -- npx -y @frankzhang.ai/deepseek-websearch-mcp

Cursor / 通用 JSON(mcp.json)

{
  "mcpServers": {
    "deepseek-websearch": {
      "command": "npx",
      "args": ["-y", "@frankzhang.ai/deepseek-websearch-mcp"],
      "env": { "DEEPSEEK_API_KEY": "sk-你的key" }
    }
  }
}

VS Code(mcp.json)

{
  "servers": {
    "deepseek-websearch": {
      "command": "npx",
      "args": ["-y", "@frankzhang.ai/deepseek-websearch-mcp"],
      "env": { "DEEPSEEK_API_KEY": "sk-你的key" }
    }
  }
}

工具说明

参数

类型

必填

说明

query

string

是

1~128 字符;支持 site:、-site:、"精确短语"、lang:zh,en、after:2025、before:2026、-排除词

count

integer

否

返回条数 1~50,默认 10

ori_question

string

否

触发搜索的用户原始问题

localization

string

否

本地化 IP

need_content

boolean

否

返回网页正文,默认 false(正文较长,按需开启)

web_fetch

参数

类型

必填

说明

url

string

是

≤8192 字符的 http/https URL,不允许携带用户名密码

错误处理

  • 408/429/5xx 自动指数退避重试(最多 2 次);402 及其余 4xx 不重试

  • 预期内错误以 isError 工具结果返回模型可读消息;DEEPSEEK_API_KEY 缺失时启动即报错退出

  • 限速:Search/Fetch 各 5 QPS(账号级)

开发

npm install
npm run typecheck   # 类型检查
npm test            # 单元 + stdio 端到端(全 mock,无需 Key)
DEEPSEEK_API_KEY=sk-xxx npm test   # 额外运行真实 API 集成测试(会产生计费调用)
npm run build       # tsc 构建到 dist/

License

Apache-2.0

Available Tools

2 tools
web_fetchA

抓取单个网页,返回页面标题与 Markdown 正文。适用于读取 web_search 结果中某个 URL 的完整内容。

Inputs: url (required).

Tool Schema Changelog

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

Loading tool schema changelog…

    TDQS

    A3.7/5.0

    Scored across 2 tools

    Disambiguation5/5

    web_search and web_fetch have clearly distinct purposes: one searches, the other retrieves page content. No overlap in function, and descriptions explicitly reference how they complement each other.

    Naming Consistency5/5

    Both tool names follow a consistent snake_case verb_noun pattern with a shared 'web_' prefix, making the relationship and action clear.

    Tool Count3/5

    With only 2 tools, the set is thin for a websearch server. While each tool earns its place, the absence of additional operations (e.g., batch fetch or result pagination) makes the count borderline.

    Completeness4/5

    The core workflow of searching and fetching pages is covered, and search syntax is rich. Minor gaps like batch fetching or advanced result filtering keep it from being fully complete.

    Maintenance

    ActivitySlowing
    ResponsivenessLimited data

    Related MCP Connectors

    Related MCP Servers

    • A
      license
      B
      quality
      C
      maintenance
      Enables MCP clients to run web searches via DeepSeek's open platform API, with optional web page fetching that returns Markdown content, and supports query syntax for source, language, and time filters.
      1
      118 npm
      1
      MIT
    • 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.
      74 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
    • A
      license
      A
      quality
      B
      maintenance
      Exposes DeepSeek's web search and page-fetch tools to any MCP client, letting any LLM run searches with quality signals like rerank score and source authority, plus advanced query syntax. It also retrieves single pages as Markdown, with built-in throttling, retries, and size-conscious summaries.
      2
      781 npm
      3
      MIT