MCP Web Search Server

MCP Web Search Server

Enables privacy-focused web searches, social media lookups, and web archive retrieval across multiple engines including DuckDuckGo, Brave, Reddit, YouTube, and Wayback Machine with built-in caching and security features.

Category
访问服务器

README

📂 MCP Web Search Server

A privacy‑focused web, social media, and archive search server exposing tools via the Model Control Protocol (MCP) for controlled access to external search capabilities.


Table of Contents


🎯 Features

  • Parallel search across multiple privacy‑focused web engines.
  • Social media lookup for public content on major platforms.
  • Archive retrieval from Wayback Machine, archive.today, Google Cache and others.
  • Dynamic listing of supported engines and archive services.
  • Result caching with LRU eviction to speed up repeated queries.

📦 Installation & Quick Start

# Clone the repository (if applicable)
git clone https://github.com/undici77/MCPWebSearch.git
cd MCPWebSearch

# Run the startup script (adjust name if different)
./run.sh -d /path/to/working/directory

1️⃣ Create & activate a Python virtual environment (.venv).
2️⃣ Install all required dependencies from requirements.txt.
3️⃣ Launch the MCP Search Server (main.py) which listens on stdin/stdout for JSON‑RPC messages.

📌 Ensure the startup script is executable: chmod +x run.sh


⚙️ Command‑Line Options

Option Description
-d, --directory Path to the working directory (default: current process dir).

The server itself does not require additional CLI flags; all configuration is performed via JSON‑RPC.


🤝 Integration with LM Studio

Add an entry to your mcp.json so LM Studio can start the server automatically:

{
  "mcpServers": {
    "web-search": {
      "command": "/absolute/path/to/run.sh",
      "args": [
        "-d",
        "/absolute/path/to/working/directory"
      ],
      "env": { "WORKING_DIR": "." }
    }
  }
}

📌 Make the script executable (chmod +x /absolute/path/to/run.sh) and run ./run.sh once to install the virtual environment before launching LM Studio.


📡 MCP API Overview

All communication follows JSON‑RPC 2.0 over stdin/stdout.

initialize

{
  "jsonrpc": "2.0",
  "id": 1,
  "method": "initialize",
  "params": {}
}

Response: protocol version (2024-11-05), server capabilities (tool enumeration) and basic server info (name, version).

tools/list

{
  "jsonrpc": "2.0",
  "id": 2,
  "method": "tools/list",
  "params": {}
}

Response: an array of tool definitions (name, description, input schema).

tools/call

{
  "jsonrpc": "2.0",
  "id": 3,
  "method": "tools/call",
  "params": {
    "name": "<tool_name>",
    "arguments": { … }
  }
}

Note: The tool identifier key is name, not tool.


🛠️ Available Tools

web_search

Search the web using multiple privacy‑focused engines in parallel.

Name Type Required Description
query string ✅ Search query (max 500 characters).
engine string ❌ (default all) Engine to use (duckduckgo, brave, startpage, ecosia, mojeek, yandex or all).
max_results integer ❌ (default 20) Max results per engine (1‑50).

Example

{
  "jsonrpc": "2.0",
  "id": 10,
  "method": "tools/call",
  "params": {
    "name": "web_search",
    "arguments": {
      "query": "privacy focused search engines",
      "engine": "duckduckgo",
      "max_results": 15
    }
  }
}

The server returns a formatted text block containing titles, URLs and snippets from each selected engine.


social_search

Search public content on major social‑media platforms.

Name Type Required Description
query string ✅ Search query (max 500 characters).
platform string ❌ (default all) Platform to search (twitter, reddit, youtube, github, stackoverflow, medium, pinterest, tiktok, instagram, facebook, linkedin or all).

Example

{
  "jsonrpc": "2.0",
  "id": 11,
  "method": "tools/call",
  "params": {
    "name": "social_search",
    "arguments": {
      "query": "AI ethics research",
      "platform": "reddit"
    }
  }
}

The response contains direct URLs that can be opened in a browser.


archives_search

Find archived versions of a URL across multiple web‑archive services.

Name Type Required Description
url string ✅ Complete URL (must include http:// or https://).
service string ❌ (default all) Archive service (wayback, archive_today, google_cache, bing_cache, yandex_cache, cachedview, ghostarchive or all).
check_availability boolean ❌ (default false) When true, the server queries the Wayback Machine API for snapshot statistics.

Example

{
  "jsonrpc": "2.0",
  "id": 12,
  "method": "tools/call",
  "params": {
    "name": "archives_search",
    "arguments": {
      "url": "https://example.com",
      "service": "wayback",
      "check_availability": true
    }
  }
}

The response lists archive URLs and, if requested, snapshot counts and timestamps.


list_engines

List all available privacy‑focused search engines.

Name Type Required Description
(No parameters) — — —

Example

{
  "jsonrpc": "2.0",
  "id": 13,
  "method": "tools/call",
  "params": {
    "name": "list_engines",
    "arguments": {}
  }
}

The server returns a markdown‑formatted overview of each engine and usage notes.


list_archives_services

List all supported web‑archive services.

Name Type Required Description
(No parameters) — — —

Example

{
  "jsonrpc": "2.0",
  "id": 14,
  "method": "tools/call",
  "params": {
    "name": "list_archives_services",
    "arguments": {}
  }
}

The response includes a description of each service, its ID and key features.


clear_cache

Clear the internal search‑result cache.

Name Type Required Description
(No parameters) — — —

Example

{
  "jsonrpc": "2.0",
  "id": 15,
  "method": "tools/call",
  "params": {
    "name": "clear_cache",
    "arguments": {}
  }
}

The server replies with a confirmation message.


🔐 Security Features

  • Query sanitisation – strips control characters, removes HTML tags and enforces MAX_QUERY_LENGTH (500).
  • Strict URL validation – accepts only http:// or https:// schemes with a valid domain.
  • Blocked patterns – regexes prevent <script> injection, javascript: URIs and event‑handler attributes.
  • Input schema enforcement – each tool validates required fields via the JSON‑RPC inputSchema.
  • Rate limiting – an asyncio semaphore caps concurrent external requests (MAX_CONCURRENT_SEARCHES).

© 2025 Undici77 – All rights reserved.

推荐服务器

Baidu Map

Baidu Map

百度地图核心API现已全面兼容MCP协议,是国内首家兼容MCP协议的地图服务商。

官方
精选
JavaScript
Playwright MCP Server

Playwright MCP Server

一个模型上下文协议服务器,它使大型语言模型能够通过结构化的可访问性快照与网页进行交互,而无需视觉模型或屏幕截图。

官方
精选
TypeScript
Magic Component Platform (MCP)

Magic Component Platform (MCP)

一个由人工智能驱动的工具,可以从自然语言描述生成现代化的用户界面组件,并与流行的集成开发环境(IDE)集成,从而简化用户界面开发流程。

官方
精选
本地
TypeScript
Audiense Insights MCP Server

Audiense Insights MCP Server

通过模型上下文协议启用与 Audiense Insights 账户的交互,从而促进营销洞察和受众数据的提取和分析,包括人口统计信息、行为和影响者互动。

官方
精选
本地
TypeScript
VeyraX

VeyraX

一个单一的 MCP 工具,连接你所有喜爱的工具:Gmail、日历以及其他 40 多个工具。

官方
精选
本地
graphlit-mcp-server

graphlit-mcp-server

模型上下文协议 (MCP) 服务器实现了 MCP 客户端与 Graphlit 服务之间的集成。 除了网络爬取之外,还可以将任何内容(从 Slack 到 Gmail 再到播客订阅源)导入到 Graphlit 项目中,然后从 MCP 客户端检索相关内容。

官方
精选
TypeScript
Kagi MCP Server

Kagi MCP Server

一个 MCP 服务器,集成了 Kagi 搜索功能和 Claude AI,使 Claude 能够在回答需要最新信息的问题时执行实时网络搜索。

官方
精选
Python
e2b-mcp-server

e2b-mcp-server

使用 MCP 通过 e2b 运行代码。

官方
精选
Neon MCP Server

Neon MCP Server

用于与 Neon 管理 API 和数据库交互的 MCP 服务器

官方
精选
Exa MCP Server

Exa MCP Server

模型上下文协议(MCP)服务器允许像 Claude 这样的 AI 助手使用 Exa AI 搜索 API 进行网络搜索。这种设置允许 AI 模型以安全和受控的方式获取实时的网络信息。

官方
精选