Skip to main content
Glama
StarkL

DeepSeek Search MCP Server

by StarkL

DeepSeek Search MCP Server 🔍

GitHub Release License: MIT MCP Protocol DeepSeek API

DeepSeek Search MCP 是基于 DeepSeek 官方最新发布的 网页搜索 (Search) 与网页抓取 (Fetch) 接口 构建的标准 Model Context Protocol (MCP) 服务。

为 Claude Desktop、Cursor、Cline、Windsurf 等全生态 AI 助手提供极低成本、原生优化的实时互联网检索与正文精读能力。


✨ 核心特性 (Key Features)

  • 💰 极致性价比:完全复用已有的 DeepSeek API Key,仅需约 ¥5 元 / 千次调用(~$0.75/1K),失败与空结果不计费,远低于海外同类搜索服务。

  • 🧠 专为大模型调优的长摘要:支持 DeepSeek 独特的 summary 模式(600~800 字高质量长摘要),提供充沛信息量的同时,极大节省上下文 Token,告别传统搜索的“截断”与“爆 Context”。

  • 🔄 搜索 + 抓取双工具闭环:

    • deepseek_search:实时网络搜索,支持相关性重排打分(rerank_score)与高级搜索语法。

    • deepseek_fetch:将目标 URL 一键抓取并解析为高清、无广告的干净 Markdown 正文。

  • 🛡️ 生产级健壮性:

    • 参数安全防爆:自动拦截并截断大模型可能传入的长句子,防止触发官方 128 字符硬限制(HTTP 400)。

    • 429 智能指数退避重试:针对 QPS 达到 5 次/秒上限的情况,自动进行指数退避平滑重试。

    • 404 抓取优雅降级:目标站点存在强反爬或不可读时,平滑提示大模型改读摘要,避免对话中断。

    • 协议纯净防护:严格分离 stdio 协议流与调试日志,彻底告别 JSON-RPC 解析错误。


Related MCP server: MyWebSearch MCP

🚀 快速上手 (Quick Start)

前置准备

  1. 拥有一个 DeepSeek 开放平台账号并创建 API Key:platform.deepseek.com

  2. 确保账户内有充足余额(充值几元即可体验数千次搜索)。


客户端一键配置

1. Claude Desktop

编辑 Claude Desktop 配置文件:

  • macOS: ~/Library/Application Support/Claude/claude_desktop_config.json

  • Windows: %APPDATA%\Claude\claude_desktop_config.json

{
  "mcpServers": {
    "deepseek-search": {
      "command": "npx",
      "args": ["-y", "github:StarkL/deepseek-search-mcp"],
      "env": {
        "DEEPSEEK_API_KEY": "sk-your-deepseek-api-key"
      }
    }
  }
}

2. Claude Code (Anthropic 官方终端 Agent CLI)

只需在终端执行一行命令即可完成接入:

# 方式 1:直接通过 GitHub 仓库运行(免安装)
claude mcp add deepseek-search -e DEEPSEEK_API_KEY=sk-your-deepseek-api-key '--' npx -y github:StarkL/deepseek-search-mcp

# 方式 2:本地源码运行(零网络延迟,推荐开发与日常使用)
claude mcp add deepseek-search -e DEEPSEEK_API_KEY=sk-your-deepseek-api-key '--' node /absolute/path/to/deepseek-search-mcp/dist/index.js

💡 PowerShell 用户提示:在 Windows PowerShell 中,命令中的 '--' 需加引号,防止被 PowerShell 识别为内部转义符。

或在任意项目根目录创建 .mcp.json 实现团队级一键共享:

{
  "mcpServers": {
    "deepseek-search": {
      "command": "npx",
      "args": ["-y", "github:StarkL/deepseek-search-mcp"],
      "env": {
        "DEEPSEEK_API_KEY": "sk-your-deepseek-api-key"
      }
    }
  }
}

3. DeepSeek Harness (dsh 官方 Agent 运行时)

DeepSeek 官方的 Agent 运行时 (dsh) 原生支持 MCP。有两种接入方式:

  • 方式 A(Web 界面):启动 dsh web 后,打开浏览器进入 Settings → MCP,点击添加 stdio 服务:

    • Command: npx

    • Args: -y github:StarkL/deepseek-search-mcp

    • Env: DEEPSEEK_API_KEY=sk-your-deepseek-api-key

  • 方式 B(Profile 配置):在 Profile 的 patch 文件(如 ~/.dsh/profiles/default/cordis.patch.yml)中添加插件项:

    - id: mcp-deepseek-search
      name: '@deepseek-ai/dsh-mcp-client'
      config:
        serverName: deepseek-search
        transport: stdio
        command: npx
        args:
          - '-y'
          - 'github:StarkL/deepseek-search-mcp'
        env:
          DEEPSEEK_API_KEY: !!js process.env.DEEPSEEK_API_KEY

4. Cursor

在 Cursor 设置中打开 Features -> MCP,点击 + Add New MCP Server:

  • Name: deepseek-search

  • Type: command

  • Command: npx -y github:StarkL/deepseek-search-mcp

  • Environment Variables: 添加 DEEPSEEK_API_KEY=sk-your-deepseek-api-key

5. Cline / Roo Code (VS Code 扩展)

打开 Cline 的 MCP 设定文件 cline_mcp_settings.json:

{
  "mcpServers": {
    "deepseek-search": {
      "command": "npx",
      "args": ["-y", "github:StarkL/deepseek-search-mcp"],
      "env": {
        "DEEPSEEK_API_KEY": "sk-your-deepseek-api-key"
      }
    }
  }
}

6. Windsurf

在 ~/.codeium/windsurf/mcp_config.json 中配置:

{
  "mcpServers": {
    "deepseek-search": {
      "command": "npx",
      "args": ["-y", "github:StarkL/deepseek-search-mcp"],
      "env": {
        "DEEPSEEK_API_KEY": "sk-your-deepseek-api-key"
      }
    }
  }
}

7. Codex / OpenCode / Goose 及通用 Agent Harness

对于支持标准 Model Context Protocol 的任何代码智能体(Agent Harness),配置通用的 Stdio 标准指令即可:

  • Transport: stdio

  • Executable: npx

  • Arguments: ["-y", "github:StarkL/deepseek-search-mcp"]

  • Environment Variables: DEEPSEEK_API_KEY=sk-your-deepseek-api-key


🛠️ 可用工具 (Tools)

1. deepseek_search (网页搜索)

调用 DeepSeek 自研搜索引擎获取实时网络结果。

参数

类型

必填

默认值

说明

query

string

是

-

搜索关键词(支持 site:、-site:、双引号等高级搜索语法,服务端已内置 128 字符防爆安全截断)。

count

number

否

5

返回结果数量(1~50)。

detail_level

string

否

"summary"

详情模式:• "summary":600800 字密集长摘要(推荐)• "snippet":100200 字短摘要(超省 Token)• "full":直接抓取网页正文。

min_score

number

否

1.0

排序分数阈值(0~3 分,官方认为 $\ge 1.5$ 为高度优质匹配),低于该值的结果将被自动过滤。

ori_question

string

否

-

用户原始提问,有助于搜索引擎更精确理解搜索意图。

localization

string

否

-

可选 IP 地址,用于优先匹配本地化搜索结果。

2. deepseek_fetch (网页正文提取)

深度抓取指定网页并解析为结构化的 Markdown 纯文本。

参数

类型

必填

默认值

说明

url

string

是

-

网页完整 HTTP/HTTPS 地址(最大支持 8192 字符)。

max_length

number

否

8000

返回 Markdown 文本的最大截断字符数,防止超大网页占满上下文。


环境变量说明

环境变量

必需

默认值

说明

DEEPSEEK_API_KEY

是

-

DeepSeek 开放平台 API 密钥(以 sk- 开头)。

DEEPSEEK_BASE_URL

否

https://api.deepseek.com

自定义 API 网关地址(用于企业私有代理或内网转发)。


❓ 常见问题排查 (FAQ)

  1. 收到 HTTP 402 Payment Required 报错?

  2. 遇到 HTTP 429 报错?

    • DeepSeek Search / Fetch 接口单个账号独立限制为 5 QPS。本 MCP 已内置轻量指数退避重试,若仍频繁触发,请提示模型降低并发调用频次。

  3. 部分网页 Fetch 提示无法提取正文?

    • 某些目标网站具有严格的反爬盾(如 Cloudflare / 极验)或属于纯交互单页应用。遇到此类情况,MCP 会友好提示模型改用搜索阶段提供的长摘要进行分析。


📄 开源许可证 (License)

本项目基于 MIT License 开源。欢迎提 Issue 与 PR!

Available Tools

2 tools
deepseek_fetchB

Fetch and extract the readable Markdown text of a specific webpage using DeepSeek's official crawler. Ideal for deep-dive reading on search results or analyzing documentation from a specific URL.

ParametersJSON Schema
NameRequiredDescriptionDefault
urlYesThe full HTTP/HTTPS URL of the webpage to fetch.
max_lengthNoMaximum character length of the returned markdown content (default is 8000).

TDQS

B3.4/5.0
Behavior3/5

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

With no annotations, the description carries full behavioral burden. It usefully discloses the output form (markdown) and that crawling is done by DeepSeek's official crawler, but omits auth requirements, rate limits, JS-rendering behavior, and failure modes on non-HTML or unreachable URLs.

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

Conciseness4/5

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

Two tight sentences with the primary action front-loaded and the usage hint second. No filler, though the second sentence is somewhat marketing-flavored ('Ideal for deep-dive reading').

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

Completeness3/5

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

For a simple 2-parameter fetch tool with a complete schema and no output schema, the description covers the essentials. It is adequate but thin on behavioral details (truncation interaction with max_length, error behavior) that an agent would benefit from.

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 both parameters (url, max_length) are fully documented in the schema. The description adds no syntax, format, or default detail beyond what the schema already provides — baseline 3.

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

Purpose4/5

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

States a specific verb ('Fetch and extract') and resource ('readable Markdown text of a specific webpage'), and identifies the mechanism (DeepSeek's official crawler). It implicitly contrasts with deepseek_search by framing itself as the follow-up read step, but never explicitly differentiates from the sibling.

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

Usage Guidelines3/5

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

Gives an intended-use context ('deep-dive reading on search results or analyzing documentation from a specific URL'), which implies the fetch-after-search workflow. However, it never names deepseek_search as the alternative or states when NOT to use it.

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

Tool Schema Changelog

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

  1. 2 tool updatesv1.0.0
    • First observeddeepseek_fetch
    • First observeddeepseek_search

TDQS

A4/5.0

Scored across 2 tools

Disambiguation5/5

deepseek_search and deepseek_fetch have clearly distinct purposes: one queries the search engine, the other retrieves and converts a specific URL to Markdown. An agent can trivially tell which to call based on whether it has a query or a known URL.

Naming Consistency5/5

Both tools use the same deepseek_ prefix followed by a concise action verb (search, fetch). The pattern is predictable and readable, with no mixing of conventions.

Tool Count4/5

Two tools is on the lean side, but for a web-retrieval server this is exactly the minimal complete pair (find then read). Nothing feels missing or padded, though a multi-URL or batch fetch would be a natural addition.

Completeness5/5

Search plus fetch covers the full retrieval lifecycle: discovering sources and then reading them in depth. There are no obvious dead ends for the stated purpose of web search and content extraction.

Maintenance

ActivityMaintained
ResponsivenessNo issues

Related MCP Connectors

Related MCP Servers

  • F
    license
    Not graded
    quality
    C
    maintenance
    Enables AI agents to perform unified web research through a single MCP server, including search, page fetching, recursive crawling, document parsing, YouTube transcript extraction, and deep multi-query research.
    3
    -
  • A
    license
    B
    quality
    B
    maintenance
    Enables AI agents to perform web searches and extract full-text content from web pages via standard MCP tools, with fallback search and semantic reranking.
    2
    2
    MIT