PW

pranavms13/web-search-mcp

开发工具

本页由 AI 翻译,技术细节请以原文为准。 查看原文

16 stars 11 forks 质量 78 趋势 25MIT

一个模式上下文协议(MCP)服务器,它使用无头Chrome浏览器提供网络搜索功能来刮去Google,DuckDuckGo和Bing搜索结果.

概览

一个模型上下文协议(MCP)服务器,通过刮取Google,DuckDuckGo,和Bing搜索结果通过无头浏览器提供网络搜索功能. - 搜索 Google 、 DuckDuckGo 和 Bing 在引擎被屏蔽或返回无时自动回落 - 标题、 URL 、 域、 片段和排名 - 将 URL 重新定向到其真实目的地 - : 从任何网页获取并提取文本内容 - : Selenium + 无头 Chrome (默认) 或 轻量级 Oscura 无头浏览器, 通过环境变量选择 - : 完全兼容 Claude Desktop 和其他 MCP 客户端 在多引擎(Google → DuckDuckGo → Bing)上搜索网络,自动回落并返回结构化结果.

概述(AI 翻译)

一个模型上下文协议(MCP)服务器,通过刮取Google,DuckDuckGo,和Bing搜索结果通过无头浏览器提供网络搜索功能.

□ 特性

  • ** 多引擎搜索**:搜索Google、DuckDuckGo和Bing在引擎被阻断或不返回时自动回落
  • ** 确定的结果**: 标题、 URL 、 域名、 片段和排名—— 将 URL 重新定向到其真实目的地
  • 网页内容:从任何网页获取并取出文本内容
  • 可移植浏览器后端:通过环境变量选择的硒 + 无头 Chrome(默认)或轻量级 Obscura 无头浏览器
  • ** MCP兼容**:与克洛德桌面和其他MCP客户端完全兼容

□可用工具

search_web 在多引擎(Google → DuckDuckGo → Bing)上搜索网络,自动回落并返回结构化结果.

** 参数:**

  • [[T1] (字符串): 搜索查询字符串
  • max_results(int,可选):返回的最大结果数(默认:10,最大:100)
  • [[T3] (bool,可选): 是否包含文本片段( 默认: 真)

** 返回:**

  • 搜索结果清单,包括:

本页由 AI 翻译,技术细节请以原文为准。

README

以下为原文 README 节选,完整内容请查看原文。

Web Search MCP

A Model Context Protocol (MCP) server that provides web search functionality by scraping Google, DuckDuckGo, and Bing search results through a headless browser.

Features

  • Multi-Engine Search: Searches Google, DuckDuckGo, and Bing with automatic fallback when an engine is blocked or returns nothing
  • Structured Results: Titles, URLs, domains, snippets, and rankings — with redirect URLs unwrapped to their real destinations
  • Web Page Content: Fetch and extract text content from any webpage
  • Pluggable Browser Backends: Selenium + headless Chrome (default) or the lightweight Obscura headless browser, selected via an environment variable
  • MCP Compatible: Fully compatible with Claude Desktop and other MCP clients

Tools Available

search_web

Search the web across multiple engines (Google → DuckDuckGo → Bing) with automatic fallback and return structured results.

Parameters:

  • query (string): The search query string
  • max_results (int, optional): Maximum number of results to return (default: 10, max: 100)
  • include_snippets (bool, optional): Whether to include text snippets (default: true)

Returns:

  • List of search results with:
    • title: Page title
    • url: Full URL (redirect wrappers resolved to the real destination)
    • domain: Domain name
    • snippet: Text snippet (if enabled)
    • rank: Search result ranking
    • source_engine: Which engine produced the result (google, duckduckgo, or bing)

get_webpage_content

Fetch and return the text content of a webpage.

Parameters:

  • url (string): The URL of the webpage to fetch
  • max_length (int, optional): Maximum content length (default: 5000, max: 20000)

Returns:

  • Dictionary with:
    • url: The requested URL
    • title: Page title
    • content: Extracted text content
    • length: Content length in characters

get_search_engine_status

Report the active browser backend and the availability of each search engine.

Returns:

  • Dictionary with a backend key (selenium or obscura) plus each engine name mapped to available or blocked.

reset_search_engines

Clear the list of engines marked as blocked during the session (useful if an engine recovers).

Returns:

  • A status message string.

Installation

  1. Install dependencies:

    # Using uv (recommended)
    uv sync
    
    # Or using pip
    pip install -e .
    
  2. Install a browser backend (pick one):

    • Selenium (default) — requires Chrome:
      • On macOS: brew install --cask google-chrome
在 GitHub 查看完整 README

安装

uvx git+https://github.com/pranavms13/web-search-mcp
新手?先看 mcpskill.org 教程 →

配置

{ "mcpServers": { "web-search-mcp": { "command": "uvx", "args": ["git+https://github.com/pranavms13/web-search-mcp"] } } }