Skip to main content
Glama
RedrockerLi

deepseek-web-search

by RedrockerLi

deepseek-web-search-mcp

把 DeepSeek 的 Web Search 和 Fetch 接口暴露给 AI 客户端的本地 stdio MCP server。原样返回 DeepSeek 的 JSON,不过滤、不重排、不截断。

安装

要求 Node.js >= 22.12。

npm install
npm run build

Related MCP server: websearch-deepseek

配置

server 只从环境变量读 Key,不读 .env。Key 已在 shell 中 export 时,一条命令完成注册:

claude mcp add-json --scope user deepseek-web-search \
  '{"type":"stdio","command":"/home/redrocker/.nvm/versions/node/v22.23.2/bin/node","args":["/home/redrocker/File/deepseek-web-search-mcp/dist/index.js"],"env":{"DEEPSEEK_API_KEY":"${DEEPSEEK_API_KEY}"},"timeout":180000}'

也可以把 ${DEEPSEEK_API_KEY} 换成实际 Key。

  • --scope:user 全局可用,local 仅当前项目(默认),project 写入仓库 .mcp.json 并会提交 Key。

  • timeout:单次工具调用上限,fetch 最坏 180 秒,保留该字段。

  • command:node 绝对路径,避免取到 PATH 里系统自带的旧版本。

其他客户端用等价的 JSON 配置(timeout 字段可以删):

{
  "mcpServers": {
    "deepseek-web-search": {
      "type": "stdio",
      "command": "/home/redrocker/.nvm/versions/node/v22.23.2/bin/node",
      "args": ["/home/redrocker/File/deepseek-web-search-mcp/dist/index.js"],
      "env": { "DEEPSEEK_API_KEY": "sk-..." },
      "timeout": 180000
    }
  }
}

工具名:mcp__deepseek-web-search__search、mcp__deepseek-web-search__fetch。改了 src/ 要重新 npm run build 并重启会话。

工具

参数

类型

默认

说明

query

string

必填

1~128 字符,支持 site: -site: - "..." lang: after: before:

count

integer

10

1~50

need_content

boolean

false

返回网页正文,可能非常大

ori_question

string

—

用户原始问题

site / exclude_sites

string[]

—

限定 / 排除站点,多站点用 OR

lang

string[]

—

如 ["zh","en"]

after / before

string

—

YYYY、YYYY-MM 或 YYYY-MM-DD

exact_phrase

string

—

精确匹配短语

exclude_terms

string[]

—

排除包含这些词的网页

结构化参数追加到 query 后面,与 query 里手写的操作符叠加,不去重。

fetch

参数

类型

说明

url

string

绝对 HTTP/HTTPS URL,≤8192 字符,不能带凭据

返回与错误

  • HTTP 2xx:一个 text block,DeepSeek 响应体原文。

  • HTTP 非 2xx:两个 text block(HTTP <status> + 原文),isError: true。

  • 配置、参数、网络错误:一个 text block 说明原因,isError: true。

  • 不截断:need_content=true 或抓取长页面时结果可能很大。

环境变量

变量

必填

说明

DEEPSEEK_API_KEY

是

缺失时 server 仍能启动,调用工具返回配置错误

DEEPSEEK_BASE_URL

否

默认 https://api.deepseek.com,不要带 /v1 或凭据

超时与重试

  • 单次超时:search 30 秒,fetch 60 秒;总上限 90 / 180 秒。

  • 仅 408、429、5xx 重试,最多 2 次,指数退避 + 抖动,尊重 Retry-After(上限 30 秒)。

  • 其他 4xx、网络错误、超时不重试。

  • 限速 search 100 QPS、fetch 25 QPS;5 元 / 1000 次成功请求。

开发

npm run typecheck
npm test
npm run dev
DEEPSEEK_INTEGRATION=1 DEEPSEEK_API_KEY=... npm run test:integration

集成测试通过 stdio 启动 dist/index.js,实际发起 1 次 search + 1 次 fetch;未设置 DEEPSEEK_INTEGRATION=1 时跳过。

安全

Key 只从环境变量读取,不写入日志或工具输出;stdio 下 stdout 只承载 MCP 协议,日志走 stderr;除非设置 DEEPSEEK_BASE_URL,只连接 api.deepseek.com。

License

MIT

Available Tools

2 tools
fetchFetch URL as MarkdownA
Read-only

Fetch a URL through DeepSeek and return the raw JSON response exactly as received.

The response is a JSON object with title (string) and content (Markdown). The content is not truncated by this server. The URL must be an absolute HTTP/HTTPS URL of at most 8192 characters and must not contain credentials. Billing: 5 CNY per 1,000 successful fetches. Rate limit: 25 QPS.

ParametersJSON Schema
NameRequiredDescriptionDefault
urlYesAbsolute HTTP/HTTPS URL to fetch. Must not contain credentials.

TDQS

A3.7/5.0
Behavior5/5

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

Goes well beyond the readOnly/openWorld annotations: it discloses that content is not truncated by the server, the return shape, billing at 5 CNY per 1,000 successful fetches, and a 25 QPS rate limit. Those cost/throughput facts are exactly the operational context annotations cannot carry.

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?

Four short sentences, each doing a job: what it does, what returns, validity constraints, cost/rate. Nothing is padded, though the URL constraints duplicate the schema rather than adding value.

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?

There is no output schema, and the description compensates by describing the returned object's fields and the no-truncation guarantee. Cost and rate limits round out everything an agent needs to call this predictably.

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 coverage is 100% and the single `url` parameter is already fully documented in the schema (absolute HTTP/HTTPS, no credentials, maxLength 8192). The description restates the same constraints without adding format examples or edge-case handling, so this is textbook baseline territory.

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 and resource ('Fetch a URL through DeepSeek') and says what comes back (raw JSON with title and Markdown content). The one blemish is the title saying 'as Markdown' while the body says 'raw JSON', which could briefly confuse, though the body reconciles it. It does not contrast with the `search` sibling.

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

Usage Guidelines2/5

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

The description gives hard input constraints (absolute HTTP/HTTPS, no credentials, 8192 chars) but never says when to reach for this tool versus `search` or when not to use it. An agent is left to infer that this is for a known URL rather than discovery.

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 updatesv0.1.0
    • First observedfetch
    • First observedsearch

TDQS

A4.1/5.0

Scored across 2 tools

Disambiguation5/5

search and fetch have clearly distinct purposes: discovery via query vs. retrieval of a specific known URL. The search description even explicitly redirects agents to fetch for a specific URL, eliminating any overlap.

Naming Consistency5/5

Both tools use a single lowercase verb with no mixed conventions (no camelCase, no noun-only names). The pattern is fully predictable across the two-tool surface.

Tool Count4/5

Two tools is on the thin side, but for a narrowly scoped search-and-retrieve proxy it is exactly the right surface — no tool feels extraneous and none is missing. Slightly below 5 only because the count leaves no room for filter/parameter discovery aids.

Completeness4/5

Search plus fetch covers the full web-retrieval lifecycle with no dead ends, and both tools return raw upstream JSON. Minor gap: structured filters are mentioned as being 'appended to query' without explicit parameters, so agents must guess the syntax.

Maintenance

ActivityMaintained
ResponsivenessNo issues

Related MCP Connectors

Related MCP Servers

  • A
    license
    A
    quality
    C
    maintenance
    An MCP server that provides web search powered by DeepSeek's native search API, returning AI-generated answers with source links. Integrates with MCP-compatible clients like Claude Code and Cursor.
    1
    MIT
  • A
    license
    A
    quality
    C
    maintenance
    Exposes DeepSeek's Search and Fetch REST APIs as two read-only MCP tools, letting any MCP-capable agent run ranked web searches and retrieve individual pages as truncated Markdown. Works with whichever model the host runs, over stdio or Streamable HTTP.
    2
    MIT
  • A
    license
    Not graded
    quality
    C
    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.
    MIT