# dsh-balanced-search [Health: Active]

**Category:** 🔎 Search & Data Extraction  
**Repository:** https://github.com/tianmingwan/dsh-balanced-search  
**GitHub Stars:** 5  
**Views:** 0  
**Installs:** 0  
**Upvotes:** 0  
**Directory Page:** https://allmcps.com/mcp/dsh-balanced-search

## Description
Balanced web search plugin/MCP server for DeepSeek Harness: Keenable / Exa / Tavily / Firecrawl / AnySearch / TinyFish round-robin with automatic failover. / 均衡搜索插件：六家搜索 API 轮流调用，自动故障切换。

## Tools
Capabilities this server exposes over MCP:

- **balanced_search** — parameters / 参数：`query` / `max_results` / `time_range`
- **balanced_fetch** — parameters / 参数：`url` / `max_chars` / `live`
- **web_fetch** — parameter / 参数：`url` only / 仅 `url`。No `max_chars` / `live`; timeout and output cap are deployment policy / 没有这两个参数，超时与输出上限属部署策略。
- **search** — parameters / 参数：`query` / `max_results` / `time_range`
- **fetch** — parameters / 参数：`url` / `max_chars` / `live`
- **max_results** — 1–20, default 8 / 1–20，默认 8
- **time_range** — `day` / `week` / `month` / `year` (native for Tavily; Exa maps to `startPublishedDate`; Keenable maps to `published_after`; Firecrawl maps to a relative recency window (`tbs`); TinyFish maps to `recency_minutes`; AnySearch has **no** recency parameter at all, so it is skipped for time-filtered sear…
- **max_chars** — Maximum characters to return, default 30000, max 50000. AnySearch and TinyFish have no length parameter, so the cap is applied client-side (AnySearch's server already caps near 50k) / 抓取内容最大字符数，默认 30000，上限 50000。AnySearch 与 TinyFish 没有长度参数，截断在客户端完成（AnySearch 服务端正文本来就以约 50k 封顶）
- **live** — Fetch live from the source (bypass index/cache), default `false`. Honoured by Keenable, Exa, Firecrawl (`maxAge: 0` forces an origin re-scrape) and TinyFish (`ttl: 0`); Tavily's extract API and AnySearch's extract have no equivalent control. / 是否实时从源站抓取（绕过索引/缓存），默认 `false`。Keenable、Exa、Firecrawl（Fi…

## Claude Desktop Quick Installation
No generated config for this server: it installs through its own setup steps.

The project's own setup steps (from https://github.com/tianmingwan/dsh-balanced-search), copied verbatim. Follow them in order; they are not an mcpServers config.

1. Run:

```sh
dsh plugin --profile web add github:tianmingwan/dsh-balanced-search
```

2. Configure:

```sh
python -m venv .venv
```

3. Install:

```sh
.venv\Scripts\python.exe -m pip install -r requirements.txt
```

4. Install:

```sh
.venv/bin/python -m pip install -r requirements.txt
```

5. Start the server:

```sh
python server.py
```

6. Start the server:

```sh
.venv\Scripts\python.exe server.py   # Windows
```

## Documentation

## What dsh-balanced-search does

The dsh-balanced-search MCP server provides web search and page retrieval through six vendor APIs: Keenable, Exa, Tavily, Firecrawl, AnySearch, and TinyFish. It belongs in the Search & Data Extraction category and returns normalized search results with titles, links, and content summaries. URL retrieval produces clean Markdown text.

Two deployment forms are available. The DeepSeek Harness plugin registers `balanced_search` and `balanced_fetch`, and also assigns its provider to dsh's built-in `web_search` and `web_fetch`. The generic implementation exposes `search` and `fetch` through a Python MCP server using stdio, allowing MCP clients to launch it as a subprocess.

## How it works

The dsh-balanced-search MCP server uses round-robin selection among configured providers. A provider without its environment variable is left out, and a failed request moves to the next available provider. At least one provider key must be configured for the balanced provider to be available.

Search accepts a query, a result limit from 1 to 20, and an optional `day`, `week`, `month`, or `year` time range. The time filter is translated differently for each backend; AnySearch does not support recency filtering and is skipped for time-filtered searches. Fetch accepts a URL, a character limit, and a `live` option. The default output limit is 30,000 characters and the maximum is 50,000. Live retrieval bypasses indexes or caches only for providers that implement an equivalent control.

## Setup and configuration

For DeepSeek Harness, install Node.js 20 or later and run:

```sh
dsh plugin --profile web add github:tianmingwan/dsh-balanced-search
```

Restarting `dsh --profile web` adds the balanced tools and routes the built-in web tools through the balanced provider. This form does not require Python dependencies. A user-level dsh patch can later override or remove that routing while retaining the additional balanced tools.

For generic MCP use, create a Python virtual environment, install `requirements.txt`, and start `server.py`. The Python server reads process environment variables and also loads a `.env` file from its own directory. Configure one or more of `KEENABLE_API_KEY`, `EXA_API_KEY`, `TAVILY_API_KEY`, `FIRECRAWL_API_KEY`, `ANYSEARCH_API_KEY`, and `TINYFISH_API_KEY`.

## Tools and capabilities

The dsh-balanced-search MCP server exposes these MCP-facing tools:

- `balanced_search` and `search`: query the web with result-count and time-range options.
- `balanced_fetch` and `fetch`: retrieve a URL with an optional character cap and live-fetch setting.
- `web_fetch`: the dsh takeover form, accepting only a URL; timeout and output limits are deployment policy.

All six backends use REST APIs. Fetching occurs through vendor services rather than the local machine's HTTP provider, which can make vendor-side retrieval available in environments where that local provider cannot operate.

## Limitations and notes

Provider features are not identical. AnySearch has a hard limit of 10 results and no recency parameter. AnySearch and TinyFish do not accept a length parameter, so the client applies the character cap after retrieval. Tavily and AnySearch extraction do not expose an equivalent to the `live` control; the setting is honored only where the selected provider supports it.

The built-in dsh takeover fails when no provider key is configured. Vendor quotas, pricing, and rate limits vary and can change, so they should be checked in the providers' current documentation. The generic server is documented for stdio operation; the repository does not describe an HTTP transport mode.

_Full upstream README: https://allmcps.com/mcp/dsh-balanced-search/readme_

