deepseek-search
Click on "Deploy Server".
Wait a few minutes for the server to deploy. Once ready, it will show a "Started" state.
In the chat, type
@followed by the MCP server name and your instructions, e.g., "@deepseek-searchsearch for DeepSeek Search API docs and fetch the top result as Markdown"
That's it! The server will respond to your query, and you can continue using it as needed.
Here is a step-by-step guide with screenshots.
kimi-deepseek-search
简体中文 | English
一个 Kimi Code CLI 插件:把 DeepSeek 原生的 Search / Fetch JSON API 注册为两个 MCP 工具——网页搜索和网页抓取。
它主要作为内置联网工具的兜底:当 Kimi Code 套餐不覆盖内置 web_search 时(例如返回 HTTP 403),Agent 可以改用本插件的工具,而不是反复重试。
零运行时依赖,只用 Node 内置的 fetch、readline 和 zlib。
功能
web_search— 调用POST /v1/tools/search,返回结构化结果:标题、URL、摘要、总结、正文(可选)、站点名与图标、发布时间、权威度、相关度。web_fetch— 调用POST /v1/tools/fetch,把一个网页返回为 Markdown。查询运算符 —
site:、-site:、-、"精确短语"、lang:zh,en、after:2025-01-01、before:2026-06-01。复用已有凭据 — 自动读取 Kimi Code 已配置的 DeepSeek key,通常无需额外配置。
重试 — 对
408、429、500、502、503、504指数退避重试,尊重Retry-After(上限 8 秒)。可取消 — MCP 的
notifications/cancelled会中止正在进行的请求。有上限的 I/O — 原始响应上限 8 MiB,解压后上限 16 MiB。
协议感知 — 只向协商了 MCP
2025-06-18的客户端返回structuredContent。
Related MCP server: DeepSeek Search MCP
环境要求
支持插件的 Kimi Code CLI(
/plugins)。Node.js 18.13+(推荐 20 或 22)。
一个可访问
/v1/tools/search和/v1/tools/fetch的 DeepSeek API key。搜索与抓取由 DeepSeek 计费,不消耗 Kimi Code 套餐额度。
安装
从 GitHub 安装
/plugins install https://github.com/zou-hong-run/kimi-code-deepseek-search安装后重新加载:
/reload也可以固定到某个版本,Kimi Code 支持以下 GitHub URL 形式:
/plugins install https://github.com/zou-hong-run/kimi-code-deepseek-search/tree/v1.1.0
/plugins install https://github.com/zou-hong-run/kimi-code-deepseek-search/releases/tag/v1.1.0
/plugins install https://github.com/zou-hong-run/kimi-code-deepseek-search/commit/<sha>从本地目录安装
/plugins install C:\path\to\kimi-deepseek-searchKimi Code 会把目录复制到 $KIMI_CODE_HOME/plugins/managed/deepseek-search/,并始终从这份托管副本运行。安装后再改源码不会生效,需要重新安装。
从 zip 安装
/plugins install https://github.com/zou-hong-run/kimi-code-deepseek-search/archive/refs/heads/main.zip验证
/plugins list
/plugins info deepseek-search两个工具会以 mcp__deepseek-search__web_search 和 mcp__deepseek-search__web_fetch 的名字出现。如果内置搜索可用,Agent 默认会优先用内置的;想强制验证本插件,直接要求它调用 mcp__deepseek-search__web_search。
插件清单还会注入一段 system prompt:优先使用内置联网工具,失败时回退到本插件。
凭据
每次请求时按以下顺序解析,取第一个非空值:
DEEPSEEK_SEARCH_API_KEYDEEPSEEK_API_KEY$KIMI_CODE_HOME/config.toml(默认~/.kimi-code/config.toml)中[providers.deepseek]表的api_key
key 不会被写入磁盘、打印到日志或缓存:轮换配置或环境变量后,下一次调用立即生效。找不到任何 key 时,工具返回 WEB_PROVIDER_CREDENTIAL_MISSING。
配置
全部可选,默认值直接适配 DeepSeek 公共 API。
环境变量 | 默认值 | 作用 |
|
| API 基地址,会自动拼接 |
|
| 调用方未传 |
|
| 首次尝试之后的重试次数 |
|
| 指数退避的基础延迟 |
| — | 最高优先级凭据 |
| — | 第二优先级凭据 |
|
| 从这里读取 |
工具说明
web_search
参数 | 类型 | 必填 | 说明 |
| string | 是 | 1–128 字符,支持上面的查询运算符 |
| integer | 否 | 1–50,默认 10 |
| string | 否 | 触发搜索的原始用户问题(≤128 字符),帮助理解意图 |
| boolean | 否 | 同时返回每个网页的 Markdown 正文;正文通常很大 |
| string | 否 | 用于偏好本地化结果的 IP 地址(≤64 字符) |
每条结果可能包含 title、url、snippet、summary、content、siteName、siteIcon、date、authority(0–4)、rerankScore(0–3)。没有 URL 的条目会被丢弃,重复 URL 会去重。空结果列表表示"没有匹配",不是错误。
web_fetch
参数 | 类型 | 必填 | 说明 |
| string | 是 | 绝对的 |
返回 { url, title, content },其中 content 为 Markdown。
错误码
错误码 | 含义 |
| 参数非法、服务方报错,或响应无法解析 |
| 环境变量和 |
| 请求被客户端取消,或服务正在关闭 |
服务方返回错误信息时,会原样透出。
命令行
同一套核心逻辑也打包成两个 CLI,便于脱离 Agent 调试:
export DEEPSEEK_API_KEY=sk-...
node bin/websearch.mjs "Kimi Code 插件" --count 5
node bin/websearch.mjs "Kimi Code 插件" --json --content
node bin/webfetch.mjs https://www.kimi.com/code/docs/zh/ --json执行 npm link 后可以直接使用 kimi-deepseek-search 和 kimi-deepseek-fetch。--help 会列出完整参数;凭据与端点解析规则和 MCP 工具完全一致。
开发
npm test # node:test 测试套件
npm run test:watch # 监听改动并重跑
node lib/server.mjs # 在 stdio 上运行 MCP 服务测试通过 mock globalThis.fetch 完成,不需要 key,也不会发起真实网络请求。
目录结构:
kimi-deepseek-search/
kimi.plugin.json # Kimi Code 插件清单(必须位于根目录)
package.json # 元数据、CLI、测试脚本
lib/search.mjs # API 客户端、参数校验、结果映射与渲染
lib/server.mjs # 精简的 JSON-RPC/MCP stdio 服务
bin/websearch.mjs # 搜索 CLI
bin/webfetch.mjs # 抓取 CLI
test/search.test.mjs # node:test 测试套件设计说明
凭据读取刻意保持窄口径。 读取
config.toml用的是针对[providers.deepseek]单个 key 的逐行解析,而不是引入 TOML 依赖;它只需要兼容 Kimi Code 写出的格式。按魔数判断压缩。 宿主进程可能安装了与 Node 内置 fetch 背后不同版本的 undici dispatcher,跨版本时
response.json()可能拿到仍未解压的字节。按 gzip/zlib 魔数识别,使解码不受这个边界影响。MCP 服务刻意做小。 只实现
initialize、tools/list、tools/call、ping、取消通知,以及按协议版本开关的structuredContent,不引入 SDK。请求并发处理。 一次慢搜索不会阻塞下一次工具调用。
限制
DeepSeek 的
/v1/tools/search、/v1/tools/fetch由服务方维护,可能变更或限流;本插件不做本地爬取或 HTML 解析。返回内容取决于服务方;
authority与rerankScore是服务方信号,不是本地计算的。API 用量计入 key 所属的 DeepSeek 账户。
web_fetch由服务方抓取,插件本身不运行本地 HTTP 客户端。
许可证
MIT,见 LICENSE。
核心逻辑移植自 aaronlei/dsh-web-search-diy(MIT),上游版权声明已保留在 LICENSE 中。Kimi Code 插件封装、MCP 服务、CLI 以及 DeepSeek Search/Fetch 对接属于新增工作。
Available Tools
2 toolsweb_fetchA
Fetch one web page and return its title and Markdown body. Use it on a url returned by web_search when the summary is not enough. Fails when the page is unreachable, blocked by the site, or has no extractable body.
| Name | Required | Description | Default |
|---|---|---|---|
| url | Yes | The absolute http or https url to fetch, up to 8192 characters. Must include a host and no credentials. |
Output Schema
| Name | Required | Description |
|---|---|---|
| url | Yes | |
| title | Yes | |
| content | Yes |
TDQS
Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?
With no annotations, the description carries the full burden and does well: it discloses the return payload (title + Markdown body) and the three failure modes (unreachable, site-blocked, no extractable body). It stops short of covering auth needs, rate limits, or truncation/redirect behavior.
Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.
Is the description appropriately sized, front-loaded, and free of redundancy?
Three short sentences, front-loaded with purpose, then usage, then failure modes; none of it is filler and each sentence changes how an agent would call it.
Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.
Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?
Output schema exists so return values need not be spelled out, and failure modes plus the search-to-fetch workflow are covered. Minor gaps remain around dynamic pages, truncation, and redirects for a fetch tool.
Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.
Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?
Schema coverage is 100% and the url parameter is already fully documented there (absolute http/https, length cap, no credentials), so baseline is 3. The description adds only the contextual hint that the url typically comes from web_search, not new format semantics.
Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.
Does the description clearly state what the tool does and how it differs from similar tools?
States a specific verb and resource ("Fetch one web page") plus the return shape (title and Markdown body), which cleanly separates it from web_search's summarized results. An agent can identify the tool without reading the schema.
Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.
Does the description explain when to use this tool, when not to, or what alternatives exist?
Explicitly routes the agent: use it on a url returned by web_search when the summary is not enough, naming the sibling and the condition that selects this tool. The escalation path from search to fetch is unambiguous.
Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.
web_searchA
Search the live web and return structured sources (title, url, snippet, summary, publish date, authority). Use it for recent events, facts you cannot confirm from memory, or anything past your training cutoff. The query accepts site:, -site:, -, "exact phrase", lang:, after: and before: operators. Follow up with web_fetch to read a page in full.
| Name | Required | Description | Default |
|---|---|---|---|
| count | No | How many results to return, 1-50. Defaults to 10. | |
| query | Yes | The search query, 1-128 characters. Supports site:, -site:, -, "exact phrase", lang:zh,en, after:2025-01-01 and before:2026-06-01. | |
| localization | No | An IP address used to prefer localized results. Omit unless the user asks for a specific region. | |
| need_content | No | When true, also return each page body as Markdown. Bodies are large; leave this off unless the summary is insufficient. | |
| ori_question | No | The original user question that triggered this search, up to 128 characters. Improves intent understanding. |
Output Schema
| Name | Required | Description |
|---|---|---|
| query | Yes | |
| results | Yes |
TDQS
Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?
No annotations are provided, so the description carries the full behavioral burden. It does disclose that results are live and returns structured source fields, which implies a read-only, non-mutating operation, but it says nothing about rate limits, cost, result freshness/latency, or failure modes when the web is unreachable.
Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.
Is the description appropriately sized, front-loaded, and free of redundancy?
Four short sentences, front-loaded with purpose then use cases then syntax then follow-up. Every sentence is useful, though the operator sentence partially restates the schema's own query description.
Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.
Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?
With an output schema present, the description needn't detail return values, and it still gives a useful one-line summary of them. It covers purpose, when to use, query syntax, and sibling handoff; only behavioral caveats (rate limits, freshness) are missing, which is a modest gap for a read-only search tool.
Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.
Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?
Schema description coverage is 100%, so the schema already documents all five parameters including count, localization, need_content, and ori_question. The description's operator list (site:, -site:, -, "exact phrase", lang:, after:, before:) largely duplicates the query parameter's own schema description rather than adding new semantics. Baseline 3 is appropriate.
Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.
Does the description clearly state what the tool does and how it differs from similar tools?
Opens with a specific verb+resource ('Search the live web') and immediately states the return shape (structured sources with title, url, snippet, summary, publish date, authority). It is clearly distinguishable from its only sibling web_fetch, which is scoped to reading a single page.
Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.
Does the description explain when to use this tool, when not to, or what alternatives exist?
Explicitly names the trigger conditions: recent events, facts that cannot be confirmed from memory, anything past the training cutoff. It also routes to the alternative ('Follow up with web_fetch to read a page in full'), so an agent knows the division of labor between the two tools.
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.
2 tool updates
v1.1.0- First observed
web_fetch - First observed
web_search
TDQS
Scored across 2 tools
The two tools split cleanly along the search/read axis: web_search discovers sources, web_fetch reads a single page in full. The descriptions explicitly cross-reference each other ('Follow up with web_fetch', 'a url returned by web_search'), leaving no realistic misselection risk.
Both names use the same web_<action> pattern (web_search, web_fetch), same style, same prefix, unambiguous verbs. Fully predictable.
Two tools is on the thin side per the general guidance, but for a search server this is exactly the minimal viable pair—search then fetch—and each tool clearly earns its place with no filler.
Search plus full-page fetch covers the core discover-then-read lifecycle for a web search domain, with operators documented for refinement. Minor gaps exist (e.g. no batch/multi-URL fetch or crawl), but agents can work around them by calling web_fetch repeatedly.
Maintenance
Related MCP Connectors
Web data for agents. Extract web pages, crawl websites, discover URLs, and search the web.
Web search and page reading for AI agents, including JSON APIs, RSS feeds and YouTube.
Web search, fetch, extract, and research for AI agents. Markdown output + AI-synthesized answers.
Web search and page fetch for AI agents. Results come from a shared cache; cached calls cost less.
Related MCP Servers
- AlicenseBqualityCmaintenanceEnables 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.188 npm1MIT
- AlicenseNot gradedqualityCmaintenanceEnables 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.87 npm2MIT
- AlicenseAqualityCmaintenanceEnables MCP clients to run ranked web searches with DeepSeek's search operators and to retrieve pages as titles and Markdown through DeepSeek's official Search and Fetch APIs, without invoking a chat model. Results are returned as structured content plus matching JSON text, with options for result count, page content, localization, and original-question context.250 npm3MIT
- AlicenseNot gradedqualityCmaintenanceEnables 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.1MIT