dsh-bing-search
dsh-bing-search
为 DeepSeek Harness (DSH) 提供 Web 搜索,以一个小型 MCP 服务器实现,并由 curl_cffi 驱动。
search 顺序:
探测 DuckDuckGo HTML(
html.duckduckgo.com)并将可达性缓存约 60 秒。在中国大陆,除非配置了代理,否则此探测通常会失败。当 DDG 可达时,使用 DDG。
当 DDG 不可用、被限流(HTTP 202 / 验证挑战)或结果集为
quality_label=poor时,回退到 Bing。按语言路由 Bing:中文 /
zh-*市场访问cn.bing.com,否则访问www.bing.com。
每次搜索响应都包含 quality_score(0–1)和 quality_label(good / weak / poor)。将 poor 视为不可用(词典页面、首词元垃圾结果)。不要引用这些标题。
它为 DSH 智能体提供三个浏览器风格的工具:
mcp__web__search— 搜索公共网络并返回规范化的自然结果。mcp__web__open— 打开公共网页并提取可读文本。mcp__web__find— 在长页面中查找文本并返回附近上下文。
DSH agent
-> @deepseek-ai/dsh-mcp-client
-> dsh-bing-search (MCP/stdio)
-> curl_cffi.AsyncSession(impersonate="chrome")
-> html.duckduckgo.com (if reachable)
-> else cn.bing.com / www.bing.com中国大陆: 如果没有代理或 VPN,DuckDuckGo 通常无法访问。这是预期情况。此时插件会使用 Bing,并将 warnings 设置为 duckduckgo_unreachable。MCP 子进程不会继承你的 shell 中的 HTTP_PROXY / HTTPS_PROXY(trust_env=False)。要强制使用代理,请在插件进程上设置 DSH_WEB_PROXY(例如,在 cordis 的 env: 映射中设置为 http://127.0.0.1:10808)。不要假定 DDG 在典型的中国大陆家庭或校园网络上可用。
社区插件:DeepSeek Harness 要求第三方插件使用
dsh-pluginGitHub 主题以便被发现。
最快安装:将本仓库交给智能体
如果你的编码智能体具有终端和文件系统访问权限(Codex、Claude Code、Pi、OpenCode 等),请粘贴以下内容:
Install this DeepSeek Harness plugin into my current DSH setup:
https://github.com/Biogod2020/dsh-bing-search
Read the repository README and INSTALL.md first. Install it with uv, detect my active
DSH profile, add it through cordis.patch.yml using the required `insert` patch form,
preserve all unrelated config, use the absolute path of the installed dsh-bing-search
executable, then verify that mcp__web__search, mcp__web__open, and mcp__web__find are
registered. Finally run one real web search smoke test and report what changed.这是推荐的路径。INSTALL.md 包含一份为智能体编写的确定性安装契约。
Related MCP server: webmcp
手动安装
1. 安装可执行文件
需要 Python 3.10+。使用 uv:
uv tool install --force git+https://github.com/Biogod2020/dsh-bing-search.git找到工具 bin 目录:
uv tool dir --bin在下面的 DSH 配置中使用 dsh-bing-search(或 Windows 上的 dsh-bing-search.exe)的绝对路径。
如需开发而不是安装工具:
git clone https://github.com/Biogod2020/dsh-bing-search.git
cd dsh-bing-search
uv sync --extra dev仓库包含 uv.lock,用于可复现的开发安装。
2. 将其添加到 DSH
DSH 配置文件将根 cordis.yml 与补丁层 cordis.patch.yml 结合。通过补丁层添加新插件时,条目必须包装在 insert 中:
- insert:
- id: mcp-web
name: '@deepseek-ai/dsh-mcp-client'
config:
serverName: web
transport: stdio
command: /ABSOLUTE/PATH/TO/dsh-bing-search
args: []
toolCallTimeoutMs: 30000
failOnStartupError: true
reconnect:
enabled: true
initialDelayMs: 500
maxDelayMs: 30000
maxAttempts: 10不要向 cordis.patch.yml 添加裸的 - id: mcp-web 条目:裸条目会修补现有 ID,未知 ID 可能会被跳过。如果你直接编辑根 cordis.yml,普通的裸插件条目是正确的。参见 cordis.example.yml。
3. 验证
DSH 重新加载配置文件后,模型应该能看到:
mcp__web__search
mcp__web__open
mcp__web__find然后让智能体搜索一些当前内容并打开一个结果。成功的往返验证了搜索访问和 MCP 注册。更改插件代码后,请重启 DSH(或 MCP 子进程);stdio 进程不会热重载 Python。
工具
search
{
"query": "DeepSeek Harness GitHub",
"count": 8,
"offset": 0,
"market": "en-US",
"safe_search": "Moderate"
}返回:
字段 | 含义 |
|
|
| 自然搜索结果 |
| 来自规范 URL 的稳定 ID |
| 查询与标题/摘要的 0–1 重叠度 |
|
|
| 回退原因和质量说明 |
对于中文查询,请使用 market=zh-CN。如果查询包含 CJK 字符,即使 market 为 en-US,Bing 回退仍会使用 cn.bing.com。
DuckDuckGo 的 /l/?uddg= 和 Bing 的 /ck/a 重定向在可能的情况下会被解码。常见的跟踪参数会被去除,重复的 URL 会被合并。
对于人物、论文或带插图的博客,请先搜索作者姓名或简短专有名词。如果 quality_label 为 poor,不要再继续加长查询。中文学术元数据应属于专门的语料库(例如 CNKI),而不是这种通用网络搜索。
open
{
"url": "https://example.com/article",
"max_chars": 24000
}使用 curl_cffi 获取公共 HTTP(S) 页面,执行 DNS/IP 检查和安全的重定向,限制响应大小,并提取可读文本 而无需执行 JavaScript。
open 专为类文章 HTML 而生。它不是浏览器。DSH 实际运行表明,天气及其他组件繁重的网站(tianqi.com、weather.com.cn 等)往往会产生导航残留或近乎空白的文本:Trafilatura 找不到主要文章,然后回退逻辑会导出整个 DOM。status 仍然可能是 ok。对于这些页面,请信任搜索的 snippet,或 open 一个更简单的文章 URL。不要期望获得实时温度、地图或其他由 JS 渲染的 UI。
find
{
"url": "https://example.com/article",
"pattern": "DeepSeek",
"max_matches": 5,
"context_chars": 700
}返回匹配的区域,而不会将整个页面注入模型上下文。
为什么用三个工具,而不是一个巨大的 search_and_summarize 工具?
插件保持检索的确定性,并让 DSH 模型控制研究循环:
search -> inspect candidates -> open -> find / search again -> synthesize插件负责 HTTP、解析、清理、缓存、引擎回退、来源追踪和质量标记。智能体决定搜索什么、信任哪些来源、何时重新表述查询,以及何时已收集到足够证据。智能体必须读取 quality_label 和 warnings。
配置
环境变量 | 默认值 | 用途 |
|
| 仅当设置为非默认值(测试)时覆盖 Bing HTML 端点。否则根据语言选择主机 |
|
|
|
| 空 | HTTP/HTTPS/SOCKS 代理。进程使用 |
|
| 传输超时 |
|
| 连接超时 |
|
|
|
|
| 搜索页面的最大响应体大小 |
|
| 最大重定向次数 |
|
| 进程内最大并发请求数 |
|
| 搜索缓存 TTL |
|
| 页面缓存 TTL |
测试
离线测试(解析器、质量评分、语言环境路由、DDG 优先 / Bing 回退):
uv run pytest -m "not live"实时冒烟测试:
RUN_LIVE_BING=1 uv run pytest -m live -s标记名称仍然是 live / RUN_LIVE_BING。实时运行会先访问 DDG,仅当 DDG 不可用时才使用 Bing。
CI 覆盖 Python 3.10、3.12、3.13 和 3.14。
设计与安全说明
这是一个非官方的 DuckDuckGo HTML + Bing HTML 适配器。它不使用已退役的 Bing Search API。
DDG 标记解析代码位于
src/dsh_bing_search/providers/ddg.py。Bing 标记解析代码位于
src/dsh_bing_search/providers/bing_parser.py。质量评分位于
src/dsh_bing_search/quality.py,并且与引擎无关。请求使用
curl_cffi.AsyncSession并进行浏览器模拟。用户提供的页面 URL 仅限于公共 HTTP(S) 目标,并启用了安全的重定向处理。
响应体大小受限。
验证码 / 验证挑战 / HTTP 202 页面会报告为
status="blocked";插件不会尝试绕过它们。www.bing.com上的无头 Bing 通常返回结构有效但不相关的卡片。cn.bing.com对某些热门中文查询有帮助;长尾名称和标题仍然可能坍缩到第一个词元。这就是质量标记的作用。open不会自动重试缓慢的目标站点;如有需要,请增加超时环境变量。
社区
DeepSeek Harness 目前处于开发者预览阶段,因此插件接口可能仍会演变。如需 DSH 相关的支持和发现:
浏览
dsh-plugin主题。加入官方仓库中链接的 DSH 社区频道。
欢迎贡献和解析器修复。
许可证
MIT
This server cannot be installed
Maintenance
Resources
Unclaimed servers have limited discoverability.
Looking for Admin?
If you are the server author, to access and configure the admin panel.
Related MCP Servers
- Flicense-qualityDmaintenanceThis MCP server provides tools for AI agents to search the web, fetch page content, and query specific elements from pages using DuckDuckGo.18
- Alicense-qualityCmaintenanceMCP server for web search and content extraction using DuckDuckGo or SearXNG, with Playwright-based fetching and LLM-powered data extraction.140MIT
- AlicenseAqualityCmaintenanceA general MCP server providing web search capabilities using DeepSeek's native online search API.114027MIT
- Alicense-qualityDmaintenanceMCP server for internet search via direct Google and DuckDuckGo HTML scraping with AI-powered result normalization and optional summarization, requiring no API keys for search.MIT
Related MCP Connectors
Serper MCP — wraps the Serper Google Search API (serper.dev)
MCP server for Google search results via SERP API
Multi-engine search for AI agents. Trust scoring, local corpus, MCP-native. Self-hostable, BYOK.
Latest Blog Posts
- Who's Calling? MCP Hosts Are an Identity Blind Spot (And the Spec Knows It)By Om-Shree-0709 on .mcpAgent IdentityOAuth 2.1
- Your AI Chatbot Just Exposed Your CEO's Salary to an InternBy Om-Shree-0709 on .Agent IdentityMCP SecurityOAuth Delegation
- Why MCP Servers Need Execution Sandboxing (And Why Your Current Stack Isn't Enough)By Om-Shree-0709 on .Agentic AiPrompt InjectionWebAssembly
MCP directory API
We provide all the information about MCP servers via our MCP API.
curl -X GET 'https://glama.ai/api/mcp/v1/servers/Biogod2020/dsh-bing-search'
If you have feedback or need assistance with the MCP directory API, please join our Discord server