Skip to main content
Glama
Biogod2020
by Biogod2020

dsh-bing-search

简体中文

Web search for DeepSeek Harness (DSH), implemented as a small MCP server and powered by curl_cffi.

search order:

  1. Probe DuckDuckGo HTML (html.duckduckgo.com) and cache reachability for about 60 seconds. From mainland China this probe often fails unless a proxy is configured.

  2. Use DDG when it is reachable.

  3. Fall back to Bing when DDG is down, rate-limited (HTTP 202 / challenge), or the result set is quality_label=poor.

  4. Route Bing by language: Chinese / zh-* markets go to cn.bing.com, otherwise www.bing.com.

Every search response includes quality_score (0–1) and quality_label (good / weak / poor). Treat poor as unusable (dictionary pages, first-token junk). Do not cite those titles.

It gives a DSH agent four browser-style tools:

  • mcp__web__search — search the public web and return normalized organic results.

  • mcp__web__search_images — search image indexes and rank results with explainable text scores (see docs/search_images.md).

  • mcp__web__open — open a public web page and extract readable text.

  • mcp__web__find — find text inside a long page and return nearby context.

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

Mainland China: DuckDuckGo is often unreachable without a proxy or VPN. That is expected. The plugin then uses Bing and sets warnings to duckduckgo_unreachable. The MCP child does not inherit your shell HTTP_PROXY / HTTPS_PROXY (trust_env=False). To force a proxy, set DSH_WEB_PROXY on the plugin process (for example http://127.0.0.1:10808 in the cordis env: map). Do not assume DDG will work on a typical mainland home or campus network.

Community plugin: DeepSeek Harness asks third-party plugins to use the dsh-plugin GitHub topic for discovery.

Fastest install: give this repo to an agent

If your coding agent has terminal and filesystem access (Codex, Claude Code, Pi, OpenCode, etc.), paste this:

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.

That is the recommended path. INSTALL.md contains a deterministic install contract written for agents.

Related MCP server: webmcp

Manual install

1. Install the executable

Python 3.10+ is required. With uv:

uv tool install --force git+https://github.com/Biogod2020/dsh-bing-search.git

Find the tool bin directory:

uv tool dir --bin

Use the absolute path to dsh-bing-search (or dsh-bing-search.exe on Windows) in the DSH config below.

For development instead of a tool install:

git clone https://github.com/Biogod2020/dsh-bing-search.git
cd dsh-bing-search
uv sync --extra dev

The repository includes uv.lock for reproducible development installs.

2. Add it to DSH

DSH profiles combine a root cordis.yml with a patch layer cordis.patch.yml. When adding a new plugin through the patch layer, the entry must be wrapped in 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

Do not add a bare - id: mcp-web entry to cordis.patch.yml: bare entries patch existing IDs and an unknown ID can be skipped. If you are editing the root cordis.yml directly, a normal bare plugin entry is correct. See cordis.example.yml.

3. Verify

After DSH reloads the profile, the model should see:

mcp__web__search
mcp__web__search_images
mcp__web__open
mcp__web__find

Then ask the agent to search for something current and open one result. A successful round trip verifies both search access and MCP registration. Recycle the MCP child after changing Python; the stdio process does not hot-reload. The optional native dsh-image-audit plugin (search_and_audit_images) is a separate Cordis insert — see dsh-image-audit/README.md.

Tools

{
  "query": "DeepSeek Harness GitHub",
  "count": 8,
  "offset": 0,
  "market": "en-US",
  "safe_search": "Moderate"
}

Returns:

Field

Meaning

provider

duckduckgo or bing

title / url / snippet / rank

Organic result

source_id

Stable ID from the canonical URL

quality_score

0–1 overlap of the query with titles/snippets

quality_label

good / weak / poor

warnings

Fallback reason and quality notes

Use market=zh-CN for Chinese queries. If the query contains CJK, Bing fallback still uses cn.bing.com even when market is en-US.

DuckDuckGo /l/?uddg= and Bing /ck/a redirects are decoded where possible. Common tracking parameters are stripped and duplicate URLs are merged.

For people, papers, or illustrated blogs, search the author name or a short proper noun first. If quality_label is poor, do not keep lengthening the query. Chinese academic metadata belongs in a specialized corpus (for example CNKI), not this general web search.

open

{
  "url": "https://example.com/article",
  "max_chars": 24000
}

Fetches public HTTP(S) pages with curl_cffi, applies DNS/IP checks and safe redirects, limits response size, and extracts readable text without executing JavaScript.

open is built for article-like HTML. It is not a browser. Live DSH runs showed that weather and other widget-heavy sites (tianqi.com, weather.com.cn, and similar) often yield navigation chrome or near-empty text: Trafilatura finds no main article, then the fallback dumps the whole DOM. status can still be ok. For those pages, trust the search snippet, or open a simpler article URL. Do not expect live temperature, maps, or other JS-rendered UI.

find

{
  "url": "https://example.com/article",
  "pattern": "DeepSeek",
  "max_matches": 5,
  "context_chars": 700
}

Returns matching regions without injecting the entire page into the model context.

Why three tools instead of one giant search_and_summarize tool?

The plugin keeps retrieval deterministic and lets the DSH model control the research loop:

search -> inspect candidates -> open -> find / search again -> synthesize

The plugin handles HTTP, parsing, cleaning, caching, engine fallback, provenance, and a quality mark. The agent decides what to search, which sources to trust, when to reformulate the query, and when enough evidence has been collected. The agent must read quality_label and warnings.

Configuration

Environment variable

Default

Purpose

DSH_BING_SEARCH_URL

https://www.bing.com/search

Override Bing HTML endpoint only when set to a non-default value (tests). Otherwise the host is chosen by language

DSH_WEB_IMPERSONATE

chrome

curl_cffi browser fingerprint

DSH_WEB_PROXY

empty

HTTP/HTTPS/SOCKS proxy. The process uses trust_env=False and does not inherit HTTP_PROXY

DSH_WEB_TIMEOUT_SECONDS

20

Transfer timeout

DSH_WEB_CONNECT_TIMEOUT_SECONDS

8

Connect timeout

DSH_WEB_MAX_BODY_BYTES

5242880

Maximum body size for open

DSH_BING_MAX_BODY_BYTES

2097152

Maximum search-page body size

DSH_WEB_MAX_REDIRECTS

8

Maximum redirects

DSH_WEB_CONCURRENCY

8

Maximum in-process concurrent requests

DSH_BING_CACHE_TTL_SECONDS

90

Search cache TTL

DSH_WEB_CACHE_TTL_SECONDS

600

Page cache TTL

Tests

Offline tests (parsers, quality score, locale routing, DDG-first / Bing fallback):

uv run pytest -m "not live"

Live smoke test:

RUN_LIVE_BING=1 uv run pytest -m live -s

The marker name is still live / RUN_LIVE_BING. A live run hits DDG first and only uses Bing if DDG is unavailable.

CI covers Python 3.10, 3.12, 3.13 and 3.14.

Design and safety notes

This is an unofficial DuckDuckGo HTML + Bing HTML adapter. It does not use the retired Bing Search API.

  • DDG markup lives in src/dsh_bing_search/providers/ddg.py.

  • Bing markup lives in src/dsh_bing_search/providers/bing_parser.py.

  • Quality scoring lives in src/dsh_bing_search/quality.py and is engine-agnostic.

  • Requests use curl_cffi.AsyncSession with browser impersonation.

  • User-supplied page URLs are restricted to public HTTP(S) targets and safe redirect handling is enabled.

  • Response bodies are size-limited.

  • CAPTCHA / challenge / HTTP 202 pages are reported as status="blocked"; the plugin does not attempt to bypass them.

  • Headless Bing on www.bing.com often returns structurally valid but unrelated cards. cn.bing.com helps some hot Chinese queries; long-tail names and titles can still collapse to the first token. That is what the quality mark is for.

  • open does not automatically retry slow target sites; increase the timeout environment variables if needed.

Community

DeepSeek Harness is currently in developer preview, so plugin interfaces may still evolve. For DSH-specific support and discovery:

Contributions and parser fixes are welcome.

License

MIT

Available Tools

4 tools
findFind in Web PageA

Find a literal phrase in a page and return compact context windows around matches.

ParametersJSON Schema
NameRequiredDescriptionDefault
urlYes
patternYes
max_matchesNo
context_charsNo

Output Schema

ParametersJSON Schema
NameRequiredDescription
urlYes
errorNo
statusYes
matchesNo
patternYes
source_idNo
total_matchesNo

TDQS

A3.6/5.0
Behavior3/5

Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?

With no annotations, the description carries the behavioral disclosure burden. It does reveal key behavior: matching is literal rather than regex or semantic, and the response consists of compact context windows around matches. However, it does not mention case sensitivity, failure modes, page loading behavior, or limits, leaving notable gaps.

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness5/5

Is the description appropriately sized, front-loaded, and free of redundancy?

A single sentence contains the core action, the matching mode, and the response shape with no redundant words. It is front-loaded and easy to parse.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness3/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

The description is adequate for a simple tool, and the output schema likely covers return values. But with no annotations and no parameter documentation, it lacks details about max_matches behavior, exact context window semantics, and when to prefer sibling tools. It is minimally sufficient but not fully complete.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters2/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

Schema description coverage is 0%, so the description must compensate. It clarifies that 'pattern' is a literal phrase and 'context_chars' relates to compact context windows, but it does not explain 'max_matches', 'url', defaults, or the exact relationship between parameters and output. This is only partial compensation for the missing schema descriptions.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose5/5

Does the description clearly state what the tool does and how it differs from similar tools?

The description states a specific verb and resource: finding a literal phrase in a page and returning compact context windows around matches. The word 'literal' helps distinguish it from the sibling 'search' tool, which implies broader or semantic search. This is a clear, specific purpose statement.

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines3/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

The description implies usage: use this tool when an exact literal phrase is needed within a page. However, it does not explicitly say when not to use it or mention alternatives like 'search' or 'search_images'. The usage guidance is present only by implication.

Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.

openOpen Web PageA

Fetch a public HTTP(S) page with curl_cffi and return cleaned readable text.

Use after search when result snippets are insufficient. Private/local addresses are rejected, redirect targets use curl_cffi safe-follow mode, and response bytes are capped.

ParametersJSON Schema
NameRequiredDescriptionDefault
urlYes
max_charsNo

Output Schema

ParametersJSON Schema
NameRequiredDescription
textNo
errorNo
titleNo
statusYes
final_urlNo
source_idNo
truncatedNo
elapsed_msNo
content_typeNo
fetched_bytesNo
requested_urlYes

TDQS

A4.2/5.0
Behavior4/5

Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?

With no annotations, the description carries the behavioral burden and discloses several useful traits: public-only access, rejection of private/local addresses, safe-follow redirect mode, and a response byte cap. It could also mention error behavior or timeout handling, but the provided constraints are substantial.

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness5/5

Is the description appropriately sized, front-loaded, and free of redundancy?

Two tight sentences front-load the purpose, then add usage context and behavioral constraints. No filler, every sentence earns its place.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness3/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

The tool is simple and the description covers URL type, output format, redirect behavior, and a cap. The main gap is max_chars semantics, which matters because there is no schema-level documentation and no annotations.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters2/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

Schema description coverage is 0%, so the description must compensate. It adds that URL must be public HTTP(S), but it never explains the max_chars parameter or how the response cap relates to it. An agent cannot confidently tune max_chars based on this text.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose5/5

Does the description clearly state what the tool does and how it differs from similar tools?

States a specific verb ('Fetch'), resource ('public HTTP(S) page'), and output ('cleaned readable text'). This distinguishes it from siblings like search and search_images: it retrieves page content rather than result snippets or images.

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines5/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

Explicitly says 'Use after search when result snippets are insufficient,' giving a clear trigger condition and relationship to the primary sibling. It also states a when-not: private/local addresses are rejected.

Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.

search_imagesSearch ImagesA

Search image indexes and rank results with pure text so vision is not required.

auto (default) tries Bing Images first and falls back to Wikimedia Commons when the top text score is below ~40, so one call yields a ranked set. bing_images parses Bing Images metadata (original URL / thumbnail / source page / title). commons queries Wikimedia Commons, a curated and licence-clear platform. Every result carries a 0-100 text score, a domain hint and explainable signals; pick the highest score, treat scores below ~40 as unverified, and optionally verify with find/open on the source page before downloading.

Args: query: What the image should depict. Compact concrete nouns plus the qualifier that uniquely identifies the subject (e.g. "复旦光华楼", "台州城墙"). "复旦光华楼" is better than "光华楼". Do not write whole sentences. If a compact query is still ambiguous or hits the wrong entity, write more (place, institution, year, type). count: Number of ranked image results to return, from 1 to 20. market: Locale such as en-US or zh-CN (Bing Images; Commons is language-neutral). provider: auto (default), bing_images, or commons.

ParametersJSON Schema
NameRequiredDescriptionDefault
countNo
queryYes
marketNoen-US
providerNoauto

Output Schema

ParametersJSON Schema
NameRequiredDescription
errorNo
queryYes
marketNo
statusYes
resultsNo
providerNo
warningsNo
elapsed_msNo
returned_countNo
requested_countNo

TDQS

A4.7/5.0
Behavior5/5

Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?

With no annotations provided, the description carries the full burden, and it does so thoroughly. It discloses the ranking mechanism, the auto fallback threshold, what each provider does, and the exact result signals: 0-100 text score, domain hint, and explainable signals. It even tells the agent how to assess confidence and when verification is needed, which goes well beyond a minimal tool description.

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness4/5

Is the description appropriately sized, front-loaded, and free of redundancy?

The description is front-loaded with purpose and behavior, and the Args section is logically organized. It is longer than typical descriptions, but that length is justified by the zero-coverage schema and the need to explain provider behavior and scoring. Minor redundancy exists because provider defaults and enum values are repeated from the schema, but the added context still earns its place.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness5/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

Given the tool's provider-switching complexity, fallback threshold, scoring semantics, and four parameters, the description provides everything needed to select and invoke it correctly. It explains query formulation, ranking confidence, provider differences, and optional verification workflow. The output schema covers return structure, so the description does not need to detail the exact JSON response.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters5/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

Schema description coverage is 0%, so the description must fully compensate for the schema's lack of parameter documentation. It does: `query` has concrete examples and wording advice ('复旦光华楼' is better than '光华楼'), `count` is bounded 1-20, `market` is explained as locale-specific to Bing while Commons is language-neutral, and `provider` enumerates the options. This is excellent parameter documentation.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose5/5

Does the description clearly state what the tool does and how it differs from similar tools?

The description opens with a specific verb and resource: 'Search image indexes and rank results with pure text so vision is not required.' This clearly distinguishes the tool from the sibling `search`, `open`, and `find` by emphasizing image indexes and text-based ranking. The provider variants (bing_images, commons) further specify exactly what kind of image search this is.

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines4/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

The description gives usable routing guidance: `auto` is the default, it falls back to Commons below ~40 text score, and results below ~40 should be treated as unverified. It also recommends verifying with `find`/`open` before downloading, which indirectly differentiates this search tool from sibling file/URL tools. It lacks an explicit 'when not to use this tool' statement, but the behavioral and provider guidance is clear enough.

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. Dates show when Glama detected each change.

  1. 4 tool updatesv0.1.0
    • First observedfind
    • First observedopen
    • First observedsearch
    • First observedsearch_images

TDQS

A4.3/5.0
Disambiguation5/5

Each tool targets a clearly distinct action: web search, image search, page retrieval, and in-page phrase matching. Search and search_images are separated by media type, while open and find both operate on pages but serve complementary pre- and post-retrieval needs, so an agent can select without confusion.

Naming Consistency5/5

All tool names are short imperative verbs in snake_case: search, search_images, open, find. The only compound name, search_images, naturally follows a verb_noun pattern, and the overall naming is predictable and consistent.

Tool Count5/5

Four tools form a tightly scoped search-and-browse toolset. Each tool earns its place: web search, image search, full-page reading, and targeted phrase lookup. The count is neither thin nor bloated for the server's stated purpose.

Completeness5/5

The server covers the full core workflow: discovering content via web or image search, opening pages when snippets are insufficient, and locating specific phrases within pages. Pagination, locale, safesearch, and provider fallback options also cover important search variations, leaving no obvious dead ends.

Maintenance

ActivityMaintained
ResponsivenessNo issues

Resources

Unclaimed servers have limited discoverability.

Looking for Admin?

If you are the server author, to access and configure the admin panel.

Related MCP Connectors

Related MCP Servers

  • A
    license
    Not graded
    quality
    C
    maintenance
    MCP server for web search and content extraction using DuckDuckGo or SearXNG, with Playwright-based fetching and LLM-powered data extraction.
    139
    MIT
  • A
    license
    Not graded
    quality
    D
    maintenance
    MCP 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

Latest Blog Posts

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