deepseek-harness
deepseek-ai
DeepSeek Harness: Everything is a Plugin.
PROJECT TOPICS
PROJECT README
English: A balanced web search plugin / MCP server that round-robins across Keenable (Keen Search) / Exa / Tavily and automatically fails over to the next provider. Returns normalized titles, links, and content summaries.
中文: 均衡搜索插件 / MCP 服务器:把 Keenable(Keen Search)/ Exa / Tavily 三个搜索 API 轮流调用(round-robin),某个服务失败时自动切换下一个,统一返回标题 / 链接 / 摘要。
This repository provides two forms / 本仓库同时提供两种形态:
balanced_search / balanced_fetch directly as dsh tools, no Python required. / 直接注册 balanced_search / balanced_fetch 两个 dsh 工具,无需 Python。search / fetch over stdio via server.py for any MCP client. / 通过 server.py 以 stdio 方式暴露 search / fetch,可供任意 MCP 客户端使用。Configure at least one search provider API key / 至少配置一个搜索服务的 API key:
KEENABLE_API_KEY=...
EXA_API_KEY=...
TAVILY_API_KEY=...
The dsh native plugin reads process environment variables directly. The Python MCP server also loads a .env file in the same directory. / dsh 原生插件直接读取进程环境变量;Python MCP 服务器还会自动读取同目录下的 .env 文件。
| File / 文件 | Description / 说明 |
|---|---|
index.js |
dsh native plugin entry; registers balanced_search / balanced_fetch / dsh 原生插件入口 |
cordis.patch.yml |
dsh bundle config layer / dsh bundle 配置层 |
package.json |
dsh bundle manifest / dsh bundle 声明 |
server.py |
Generic MCP server (stdio); exposes search / fetch / 通用 MCP server |
providers.py |
Python providers + round-robin / failover / Python 版 API 客户端与轮换 |
requirements.txt |
Python MCP server dependencies / Python MCP 服务器依赖 |
.env.example |
API key template (copy to .env) / API key 配置模板 |
.gitignore |
Excludes .env, virtualenvs, caches / 排除本地敏感与缓存文件 |
Requirements / 要求:DeepSeek Harness (dsh) installed, Node.js ≥ 20.
dsh plugin --profile web add github:tianmingwan/dsh-balanced-search
After restarting dsh --profile web, these tools will be available / 重启后会话中会出现两个工具:
balanced_searchbalanced_fetchNo Python dependencies required / 无需安装 Python 依赖。
python -m venv .venv
# Windows
.venv\Scripts\python.exe -m pip install -r requirements.txt
# Linux / macOS
.venv/bin/python -m pip install -r requirements.txt
# stdio mode for MCP clients / stdio 模式,供 MCP 客户端连接
python server.py
# or use the virtualenv Python / 或使用虚拟环境中的 Python
.venv\Scripts\python.exe server.py # Windows
.venv/bin/python server.py # Linux / macOS
{
"mcpServers": {
"balanced-search": {
"command": "/absolute/path/to/.venv/bin/python",
"args": ["/absolute/path/to/server.py"],
"env": {
"KEENABLE_API_KEY": "...",
"EXA_API_KEY": "...",
"TAVILY_API_KEY": "..."
}
}
}
}
balanced_search — parameters / 参数:query / max_results / time_rangebalanced_fetch — parameters / 参数:url / max_chars / livesearch — parameters / 参数:query / max_results / time_rangefetch — parameters / 参数:url / max_chars / livequery (required / 必填): Search keyword or natural language question / 搜索关键词或自然语言问题max_results: 1–20, default 8 / 1–20,默认 8time_range: day / week / month / year (native for Tavily; Exa maps to startPublishedDate; Keenable maps to published_after) / (Tavily 原生;Exa 映射为 startPublishedDate;Keenable 映射为 published_after)max_chars: Maximum characters to return, default 30000, max 50000 / 抓取内容最大字符数,默认 30000,上限 50000live: Fetch live from the source (bypass index/cache), default false / 是否实时从源站抓取(绕过索引/缓存),默认 falseSearch response / 搜索返回 JSON:
{
"provider": "keenable|exa|tavily",
"count": 1,
"results": [
{"title": "...", "url": "...", "content": "...", "published_at": "...", "score": 0.5}
]
}
Fetch response / 抓取返回 JSON:
{
"provider": "keenable|exa|tavily",
"result": {"url": "...", "title": "...", "content": "..."}
}
.env or client env injection.Balancer (currently round-robin + failover; can be changed to weighted or health-aware).SearchProvider subclass in providers.py and register it in build_balancer(); or add a Provider class in index.js.MIT
CLASSIFICATION EVIDENCE
系统优先读取 GitHub Topics,再与站内分类词典和词根规则比对。当前命中: 无有效分类标签。