DeepSeek Scout MCP
把 DeepSeek 的网页搜索与网页抓取接口 封装成 MCP 工具,让任何支持 MCP 的客户端(Claude Desktop、Cursor、魔搭社区等)直接获得联网搜索与网页抓取能力。
底层是 DeepSeek 自研搜索引擎 —— 长期为 DeepSeek 网页端与 API 端提供搜索能力,每天稳定处理全球数亿次搜索请求。
为什么值得用
- 覆盖广:AI 原生通用搜索引擎,索引全球千亿级网页,支持多语言搜索
- 质量高:实时返回高相关、高权威、高时效的结果;每条结果自带
rerank_score(0~3)、authority(0~4)和发布时间,便于二次筛选 - 抗污染:对 SEO 作弊、GEO 操纵与低质 AIGC 有专门的识别过滤机制,更倾向权威可信来源
- 接入成本低:以 stdio 方式运行,进程由客户端拉起、不占端口;API Key 走环境变量
DEEPSEEK_API_KEY,不写进代码;两个工具直连 DeepSeek,无中间状态与缓存,Search 与 Fetch 均为只读请求
服务配置
{
"mcpServers": {
"deepseek-scout": {
"command": "uvx",
"args": [
"deepseek-scout-mcp@latest"
],
"env": {
"DEEPSEEK_API_KEY": "<YOUR_DEEPSEEK_API_KEY>"
}
}
}
}
把这段 JSON 放进客户端的 MCP 配置即可,uvx 会自动拉取并运行最新发布版。API Key 在 platform.deepseek.com/api_keys 创建。
安装
# 无需安装,uvx 直接运行(推荐)
uvx deepseek-scout-mcp
# 或安装为命令
pip install deepseek-scout-mcp
# 或从源码
git clone https://github.com/weigu77/deepseek-scout-mcp
cd deepseek-scout-mcp && pip install -e .
工具
deepseek_search
按关键词搜索网页,返回结构化结果列表。
| 参数 | 类型 | 必填 | 默认 | 说明 |
|---|---|---|---|---|
query |
string | 是 | — | 搜索词,1~128 个字符,不能全为空白,支持下方搜索语法 |
count |
integer | 否 | 10 |
返回结果条数,1~50 |
ori_question |
string | 否 | null |
触发本次搜索的用户原始问题,有助于理解搜索意图 |
localization |
string | 否 | "" |
用于优先返回本地化搜索结果的 IP 地址 |
need_content |
boolean | 否 | false |
是否在 content 中返回网页正文 |
返回 results 数组,每项字段:
| 字段 | 类型 | 说明 |
|---|---|---|
rerank_score |
number | 排序分数,0~3,≥1.5 为优质结果 |
title |
string | 标题 |
url |
string | 结果链接 |
snippet |
string | 短摘要(约 100~200 字符),适合前端展示 |
summary |
string | 长摘要(约 600~800 字符),适合喂给模型 |
content |
string | 网页正文,need_content 为 false 时为空字符串 |
site_name |
string | null | 站点名称 |
site_icon |
string | null | 站点图标 URL |
date |
string | null | 发布时间,UTC 的 RFC 3339 格式 |
authority |
integer | 网页权威性,0~4(-1 表示未知),≥3 为极权威结果 |
搜索正常结束但没有匹配结果时返回空数组。
deepseek_fetch
抓取单个网页,以 Markdown 文本返回正文。
| 参数 | 类型 | 必填 | 说明 |
|---|---|---|---|
url |
string | 是 | 网页地址,长度 ≤ 8192,必须为含 host 的 HTTP/HTTPS URL,且不携带用户名或密码 |
返回 title(缺失时为空字符串)与 content(Markdown 正文)。抓取结果受目标站点可用性与访问策略影响。
搜索语法
query 中的操作符会原样传给 DeepSeek 搜索引擎,可在一条 query 中组合使用。
| 操作符 | 示例 | 说明 |
|---|---|---|
site: |
DeepSeek site:github.com |
限定站点;多个站点用空格分隔并以 OR 连接,如 DeepSeek site:github.com OR site:huggingface.co |
-site: |
DeepSeek -site:example.com |
排除站点,多个用空格分隔 |
- |
DeepSeek -广告 |
排除含指定关键词的网页,多个用空格分隔 |
-"..." |
DeepSeek -"release notes" |
排除含指定短语的网页,短语可含空格 |
"..." |
DeepSeek "精确短语" |
精确匹配短语,多个用空格分隔 |
lang: |
DeepSeek lang:zh,en |
限定语言,多个用逗号分隔 |
after: |
DeepSeek after:2025 / after:2025-01-01 |
限定发布日期之后 |
before: |
DeepSeek before:2026 / before:2026-06-01 |
限定发布日期之前 |
例如:
{
"query": "DeepSeek 模型 site:github.com OR site:huggingface.co lang:zh after:2025",
"count": 10
}
错误处理
接口错误以 DeepSeek 原始错误 JSON(OpenAI 兼容格式)返回,例如:
{
"error": {
"message": "'count' must be between 1 and 50",
"type": "invalid_request_error",
"param": null,
"code": "invalid_request_error"
}
}
| 状态码 | 含义 |
|---|---|
| 400 | 请求头或请求体不合法(JSON 格式错误、字段值无效等) |
| 401 | API Key 缺失或无效 —— 检查 DEEPSEEK_API_KEY 是否注入 |
| 402 | 账号余额不足 |
| 403 | Fetch 请求被安全策略拒绝 |
| 404 | Fetch 未获取到可用正文(URL 不可用、被拦截、内容类型不支持等) |
| 408 / 429 / 5xx | 读取超时、超出 QPS、服务端错误 —— 等待后重试 |
限速与计费
- Search 与 Fetch 分别独立限速,各 5 QPS(账号粒度,与使用哪个 Key 无关);Fetch 还对目标域名另有 QPS 限制。
- 按成功请求次数计费,不按 token 或结果条数:两者均为 5 元 / 1000 次。仅 HTTP 200 且有结果(Search 的
results非空、Fetch 返回正文)的请求才计费,失败、无结果、超时不计费。count不影响价格。 - 详见 官方文档。
本地运行
pip install -e .
python -m deepseek_scout_mcp
# 或
uvx deepseek-scout-mcp
以 stdio 方式启动,由 MCP 客户端通过上面的配置拉起进程。调试时可手工喂 JSON-RPC 消息,或直接用:
DEEPSEEK_API_KEY=sk-xxxx uvx deepseek-scout-mcp
已知问题
走魔搭托管地址 + fastmcp 系客户端时报 handshake protocol era
现象:
mcp.shared.exceptions.MCPError: this connection serves the handshake protocol era;
requests carrying the 2026-07-28 envelope are not accepted on it
原因:这条错误由魔搭网关返回,与本包无关(本包代码里没有这段字符串)。魔搭托管地址 https://mcp.api-inference.modelscope.net/<id>/mcp 只服务握手时代协议(2025-06-18),而 fastmcp 的客户端默认 mode="auto",连接时会先探测 server/discover 并切到 2026-07-28 协议,之后每个请求都被网关拒绝。
影响范围:
- 本地 stdio 方式(本 README 推荐的配置)不受影响 —— 不经过任何网关
- 只讲握手时代协议的客户端(Claude Desktop、Cursor 等)也不受影响
- 会中招的是代码里用了 fastmcp 系客户端、又没有指定协议模式的情况,典型是 LangChain 的
MCPAdapter
绕过方法:显式用 mode="legacy" 预构建客户端,再交给 MCPAdapter:
from fastmcp import Client
from fastmcp.client.transports import StreamableHttpTransport
from langchain.mcp import MCPAdapter
client = Client(
StreamableHttpTransport("https://mcp.api-inference.modelscope.net/<id>/mcp"),
mode="legacy",
)
async with MCPAdapter(target=client) as adapter:
tools = await adapter.list_tools()
该规避属于客户端侧设置,没法写进 MCP 客户端的 JSON 配置,只能在代码里改;若魔搭网关后续支持新版协议,此问题会自动消失。
相关链接
Metadata
Release files for deepseek-scout-mcp 0.1.7
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | Provenance | Actions |
|---|---|---|---|---|
| deepseek_scout_mcp-0.1.7.tar.gz | 80.3 kB | Without provenance | Details for deepseek_scout_mcp-0.1.7.tar.gz |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Actions Reset |
|---|---|---|---|---|
| deepseek_scout_mcp-0.1.7-py3-none-any.whl | Python 3 | none | any | Details for deepseek_scout_mcp-0.1.7-py3-none-any.whl |
Total release size: 89.0 kB
Release files / deepseek_scout_mcp-0.1.7.tar.gz
| Download URL | deepseek_scout_mcp-0.1.7.tar.gz |
|---|---|
| Size | 80.3 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
f77d6e9c44978a160ff599f5bf41038a45b4808f78a571e868571fe103e14cdf
|
|
BLAKE2b-256 checksum How to use checksums |
d402d33c62c9dcd9319e921e20755f4263756a1db87e2ebebbfe322f98033920
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
uv/0.12.16 {"installer":{"name":"uv","version":"0.12.16","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":null,"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":true}
|
Release files / deepseek_scout_mcp-0.1.7-py3-none-any.whl
| Download URL | deepseek_scout_mcp-0.1.7-py3-none-any.whl |
|---|---|
| Size | 8.7 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
61db55562978f56784714a26bb856cc9bbe50dbcce9c6b6b506d7ee726badc83
|
|
BLAKE2b-256 checksum How to use checksums |
4fd120fb86c0307d05ff2b0b04e87413f34600c9ebc80d746199f807e0932693
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
uv/0.12.16 {"installer":{"name":"uv","version":"0.12.16","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":null,"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":true}
|
Security for deepseek-scout-mcp 0.1.7
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
No provenance found
None of the files in this release were uploaded with provenance metadata.
A note on package security
PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.
To learn more about protecting yourself from malicious actors, visit our package security documentation.