Skip to main content
Glama
xinzhuang

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: free-web-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 github:xinzhuang/deepseek-websearch-mcp

发布到 npm 后可简写为 npx -y deepseek-websearch-mcp。

方式二:全局安装

npm install -g github:xinzhuang/deepseek-websearch-mcp
deepseek-websearch-mcp

方式三:客户端配置

Claude Code

claude mcp add deepseek-websearch -s user -e DEEPSEEK_API_KEY=sk-你的key -- npx -y github:xinzhuang/deepseek-websearch-mcp

Cursor / 通用 JSON(mcp.json)

{
  "mcpServers": {
    "deepseek-websearch": {
      "command": "npx",
      "args": ["-y", "github:xinzhuang/deepseek-websearch-mcp"],
      "env": { "DEEPSEEK_API_KEY": "sk-你的key" }
    }
  }
}

VS Code(mcp.json)

{
  "servers": {
    "deepseek-websearch": {
      "command": "npx",
      "args": ["-y", "github:xinzhuang/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

MIT

Available Tools

2 tools
web_fetchA

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

ParametersJSON Schema
NameRequiredDescriptionDefault
urlYes要抓取的网页地址,必须为含主机的 http/https URL,不允许携带用户名或密码

TDQS

A4/5.0
Behavior3/5

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

No annotations are provided, so the description carries the full disclosure burden. It does state the return format (title + Markdown), but says nothing about auth, rate limits, JS-rendered pages, redirects, or failure behavior for a network-fetching 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?

Two tight sentences with zero filler; the capability statement is front-loaded and the usage note follows immediately.

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?

For a single-parameter fetch with no output schema, the description covers what it does and what it returns at a high level. Error/edge-case behavior is unaddressed, but the core call contract is clear.

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% and there is a single param whose constraints (http/https, host required, no credentials) are fully documented in the schema. The description adds no further parameter detail, so baseline 3 applies.

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?

Cites a specific verb+resource (抓取单个网页) and explicitly states the return payload (页面标题与 Markdown 正文). It also names the sibling web_search and contrasts the scopes, so an agent can distinguish fetch-full-content from search.

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

Usage Guidelines4/5

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

Gives clear context: use it to read the full content of a URL sourced from web_search results. This routes the agent to the right sibling, but stops short of stating exclusions (e.g., when not to fetch, or non-HTML targets).

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 observedweb_fetch
    • First observedweb_search

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

ActivityMaintained
ResponsivenessNo issues

Related MCP Connectors

Related MCP Servers

  • A
    license
    B
    quality
    C
    maintenance
    Enables web search and site-specific search capabilities through the Deepsearch model. Provides unified access to broad web retrieval and targeted site search functionality within the MCP ecosystem.
    2
    19 npm
    5
    Apache 2.0
  • 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
    MIT