Skip to main content
Glama
Biogod2020
by Biogod2020

dsh-bing-search

简体中文

Búsqueda web para DeepSeek Harness (DSH), implementada como un pequeño servidor MCP y basada en curl_cffi.

orden de search:

  1. Comprueba el HTML de DuckDuckGo (html.duckduckgo.com) y cachea la accesibilidad durante unos 60 segundos. Desde la China continental esta comprobación suele fallar a menos que se configure un proxy.

  2. Usa DDG cuando sea accesible.

  3. Recurre a Bing cuando DDG está caído, limitado por tasa (HTTP 202 / challenge), o el conjunto de resultados es quality_label=poor.

  4. Enruta Bing por idioma: los mercados chinos / zh-* van a cn.bing.com, de lo contrario a www.bing.com.

Cada respuesta de búsqueda incluye quality_score (0–1) y quality_label (good / weak / poor). Trata poor como no utilizable (páginas de diccionario, basura de primer token). No cites esos títulos.

Ofrece a un agente DSH tres herramientas de estilo navegador:

  • mcp__web__search — busca en la web pública y devuelve resultados orgánicos normalizados.

  • mcp__web__open — abre una página web pública y extrae texto legible.

  • mcp__web__find — encuentra texto dentro de una página larga y devuelve el contexto cercano.

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

China continental: DuckDuckGo suele ser inaccesible sin un proxy o VPN. Esto es lo esperado. El plugin entonces usa Bing y establece warnings a duckduckgo_unreachable. El proceso hijo MCP no hereda tu HTTP_PROXY / HTTPS_PROXY del shell (trust_env=False). Para forzar un proxy, establece DSH_WEB_PROXY en el proceso del plugin (por ejemplo http://127.0.0.1:10808 en el mapa env: de cordis). No asumas que DDG funcionará en una red doméstica o universitaria típica de China continental.

Plugin comunitario: DeepSeek Harness pide a los plugins de terceros que usen el tema de GitHub dsh-plugin para su descubrimiento.

Instalación más rápida: dale este repositorio a un agente

Si tu agente de codificación tiene acceso al terminal y al sistema de archivos (Codex, Claude Code, Pi, OpenCode, etc.), pega esto:

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.

Ese es el camino recomendado. INSTALL.md contiene un contrato de instalación determinista escrito para agentes.

Related MCP server: webmcp

Instalación manual

1. Instala el ejecutable

Se requiere Python 3.10+. Con uv:

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

Encuentra el directorio bin de la herramienta:

uv tool dir --bin

Usa la ruta absoluta a dsh-bing-search (o dsh-bing-search.exe en Windows) en la configuración de DSH de abajo.

Para desarrollo en lugar de una instalación de herramienta:

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

El repositorio incluye uv.lock para instalaciones de desarrollo reproducibles.

2. Añádelo a DSH

Los perfiles de DSH combinan un cordis.yml raíz con una capa de parche cordis.patch.yml. Al añadir un nuevo plugin mediante la capa de parche, la entrada debe estar envuelta en 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

No añadas una entrada simple - id: mcp-web a cordis.patch.yml: las entradas simples parchean IDs existentes y un ID desconocido puede omitirse. Si editas directamente el cordis.yml raíz, una entrada simple de plugin normal es correcta. Consulta cordis.example.yml.

3. Verifica

Después de que DSH recargue el perfil, el modelo debería ver:

mcp__web__search
mcp__web__open
mcp__web__find

Luego pide al agente que busque algo actual y abra un resultado. Un viaje de ida y vuelta exitoso verifica tanto el acceso a la búsqueda como el registro MCP. Reinicia DSH (o el hijo MCP) después de cambiar el código del plugin; el proceso stdio no recarga Python en caliente.

Herramientas

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

Devuelve:

Campo

Significado

provider

duckduckgo o bing

title / url / snippet / rank

Resultado orgánico

source_id

ID estable de la URL canónica

quality_score

Superposición 0–1 de la consulta con títulos/fragmentos

quality_label

good / weak / poor

warnings

Motivo de la reserva y notas de calidad

Usa market=zh-CN para consultas en chino. Si la consulta contiene CJK, la reserva de Bing sigue usando cn.bing.com incluso cuando market es en-US.

Los redireccionamientos de DuckDuckGo /l/?uddg= y de Bing /ck/a se decodifican cuando es posible. Los parámetros de seguimiento comunes se eliminan y las URL duplicadas se fusionan.

Para personas, artículos o blogs ilustrados, busca primero el nombre del autor o un nombre propio corto. Si quality_label es poor, no sigas alargando la consulta. Los metadatos académicos chinos pertenecen a un corpus especializado (por ejemplo CNKI), no a esta búsqueda web general.

open

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

Obtiene páginas HTTP(S) públicas con curl_cffi, aplica comprobaciones DNS/IP y redireccionamientos seguros, limita el tamaño de la respuesta y extrae texto legible sin ejecutar JavaScript.

open está diseñado para HTML tipo artículo. No es un navegador. Ejecuciones en vivo de DSH mostraron que los sitios de clima y otros con muchos widgets (tianqi.com, weather.com.cn y similares) a menudo producen una interfaz de navegación o texto casi vacío: Trafilatura no encuentra un artículo principal, y entonces la reserva vuelca todo el DOM. status puede seguir siendo ok. Para esas páginas, confía en el snippet de la búsqueda, o abre una URL de artículo más simple. No esperes temperatura en vivo, mapas u otra interfaz renderizada por JS.

find

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

Devuelve las regiones coincidentes sin inyectar toda la página en el contexto del modelo.

¿Por qué tres herramientas en lugar de una gran herramienta search_and_summarize?

El plugin mantiene la recuperación determinista y permite que el modelo DSH controle el bucle de investigación:

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

El plugin maneja HTTP, análisis, limpieza, caché, reserva de motor, procedencia y una marca de calidad. El agente decide qué buscar, en qué fuentes confiar, cuándo reformular la consulta y cuándo se ha recopilado suficiente evidencia. El agente debe leer quality_label y warnings.

Configuración

Variable de entorno

Predeterminado

Propósito

DSH_BING_SEARCH_URL

https://www.bing.com/search

Sobrescribir el endpoint HTML de Bing solo cuando se establece a un valor no predeterminado (pruebas). De lo contrario, el host se elige por idioma

DSH_WEB_IMPERSONATE

chrome

Huella digital del navegador curl_cffi

DSH_WEB_PROXY

empty

Proxy HTTP/HTTPS/SOCKS. El proceso usa trust_env=False y no hereda HTTP_PROXY

DSH_WEB_TIMEOUT_SECONDS

20

Tiempo de espera de transferencia

DSH_WEB_CONNECT_TIMEOUT_SECONDS

8

Tiempo de espera de conexión

DSH_WEB_MAX_BODY_BYTES

5242880

Tamaño máximo del cuerpo para open

DSH_BING_MAX_BODY_BYTES

2097152

Tamaño máximo del cuerpo de la página de búsqueda

DSH_WEB_MAX_REDIRECTS

8

Máximo de redireccionamientos

DSH_WEB_CONCURRENCY

8

Máximo de solicitudes simultáneas en proceso

DSH_BING_CACHE_TTL_SECONDS

90

TTL de caché de búsqueda

DSH_WEB_CACHE_TTL_SECONDS

600

TTL de caché de página

Pruebas

Pruebas sin conexión (analizadores, puntuación de calidad, enrutamiento por configuración regional, DDG primero / reserva de Bing):

uv run pytest -m "not live"

Prueba de humo en vivo:

RUN_LIVE_BING=1 uv run pytest -m live -s

El nombre del marcador sigue siendo live / RUN_LIVE_BING. Una ejecución en vivo usa DDG primero y solo utiliza Bing si DDG no está disponible.

CI cubre Python 3.10, 3.12, 3.13 y 3.14.

Notas de diseño y seguridad

Este es un adaptador no oficial de HTML de DuckDuckGo + HTML de Bing. No utiliza la API de Búsqueda de Bing retirada.

  • El marcado de DDG se encuentra en src/dsh_bing_search/providers/ddg.py.

  • El marcado de Bing se encuentra en src/dsh_bing_search/providers/bing_parser.py.

  • La puntuación de calidad se encuentra en src/dsh_bing_search/quality.py y es independiente del motor.

  • Las solicitudes usan curl_cffi.AsyncSession con suplantación de navegador.

  • Las URL de páginas proporcionadas por el usuario están restringidas a destinos HTTP(S) públicos y se habilita el manejo seguro de redireccionamientos.

  • Los cuerpos de respuesta tienen un límite de tamaño.

  • Las páginas CAPTCHA / challenge / HTTP 202 se notifican como status="blocked"; el plugin no intenta omitirlas.

  • Bing sin interfaz en www.bing.com a menudo devuelve tarjetas estructuralmente válidas pero no relacionadas. cn.bing.com ayuda en algunas consultas chinas populares; los nombres y títulos de cola larga aún pueden colapsarse al primer token. Para eso está la marca de calidad.

  • open no reintenta automáticamente los sitios de destino lentos; aumenta las variables de entorno de tiempo de espera si es necesario.

Comunidad

DeepSeek Harness está actualmente en vista previa para desarrolladores, por lo que las interfaces de los plugins aún pueden evolucionar. Para soporte y descubrimiento específicos de DSH:

Las contribuciones y correcciones de analizadores son bienvenidas.

Licencia

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.

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

TDQS

A4.3/5.0

Scored across 4 tools

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

ActivitySlowing
ResponsivenessNo issues

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.
    140
    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