Skip to main content
Glama
urtworkmail

Web Search MCP Server

by urtworkmail

Web Search MCP 服务器

Apify Actor MCP Compatible License

一个运行持久化 模型上下文协议 (MCP) 服务器 的 Apify Actor,为 AI 助手提供实时网络搜索能力。连接 Claude Desktop、Cursor 或任何兼容 MCP 的 AI 客户端,无需离开工作流即可搜索网络。

功能特性

  • 🔍 search_web — 通过 DuckDuckGo(免费,无需密钥)或 Brave Search(更高质量)进行网络搜索

  • 📰 search_news — 搜索最新新闻文章

  • 📄 fetch_page — 从任何 URL 获取并提取纯文本内容

  • 🔐 域名白名单 — 将 fetch_page 限制在已批准的域名内

  • 📊 审计日志 — 可选地将所有搜索记录到 Apify 数据集中

  • ⚡ 始终在线 — 在 Apify 待机模式下运行,实现 24/7 持久可用

Related MCP server: Local Research MCP Server

快速入门

1. 在 Apify 上运行

  1. 前往 Apify 控制台 并找到此 Actor

  2. 点击 免费试用 → 配置输入 → 启动

  3. 从 Actor 运行日志中复制 待机 URL (Standby URL)(看起来像 https://web-search-mcp.username.apify.actor)

2. 连接到 Claude Desktop

将以下内容添加到您的 Claude Desktop claude_desktop_config.json 中:

{
  "mcpServers": {
    "web-search": {
      "command": "npx",
      "args": ["-y", "mcp-remote", "https://YOUR-STANDBY-URL/sse"]
    }
  }
}

重启 Claude Desktop,您将在界面中看到这些工具。

3. 连接到 Cursor / 其他 MCP 客户端

将 SSE URL 设置为:https://YOUR-STANDBY-URL/sse

输入配置

参数

类型

默认值

描述

defaultMaxResults

integer

10

每次搜索返回的默认结果数量

braveApiKey

string

—

可选的 Brave Search API 密钥,以获得更好的结果

enableFetchTool

boolean

true

启用 fetch_page 工具

enableNewsTool

boolean

true

启用 search_news 工具

allowedDomains

string[]

[]

fetch_page 的白名单域名(留空表示允许所有)

logSearches

boolean

false

将所有查询记录到 Apify 数据集中

MCP 工具参考

search_web

搜索网络并获取排名结果。

参数:

  • query (string, 必填) — 搜索查询词

  • maxResults (integer, 可选, 默认: 10) — 结果数量 (1–50)

  • safeSearch (enum, 可选) — strict(严格)、moderate(中等)或 off(关闭)

返回: 包含标题、URL 和摘要的排名结果列表。


search_news

搜索最新新闻文章。

参数:

  • query (string, 必填) — 新闻搜索查询词

  • maxResults (integer, 可选) — 文章数量 (1–20)

返回: 包含发布时间(如有)的新闻文章列表。


fetch_page

获取网页并返回其纯文本内容。

参数:

  • url (string, 必填) — 要获取的完整 URL

  • maxLength (integer, 可选, 默认: 8000) — 最大字符数 (500–50000)

返回: 页面标题、元描述和提取的正文文本。

API 端点

端点

方法

描述

/sse

GET

MCP SSE 连接端点

/messages?sessionId=X

POST

MCP 消息处理器

/health

GET

健康检查 + 活动会话

/

GET

服务器信息和说明

架构

AI Client (Claude, Cursor, etc.)
        │ SSE connection
        ▼
  Express HTTP Server (:3000)
        │
  MCP Server (McpServer)
        │
  ┌─────┴──────────┐
  │   Search Tools  │
  └─────┬──────────┘
        │
  ┌─────┴─────────────────────┐
  │ DuckDuckGo HTML API        │ (default, no key needed)
  │ Brave Search REST API      │ (optional, with API key)
  └────────────────────────────┘

本地开发

git clone https://github.com/your-org/web-search-mcp
cd web-search-mcp
npm install
npm start

服务器将在 http://localhost:3000 启动。将任何 MCP 客户端连接到 http://localhost:3000/sse。

使用示例 (在 Claude 中)

连接后,您可以询问 Claude:

“搜索关于欧洲 AI 法规的最新新闻”

“2025 年最热门的 Python Web 框架有哪些?搜索网络并总结。”

“获取 https://example.com/blog/post 的内容并总结关键点。”

许可证

Apache 2.0 — 参见 LICENSE

Maintenance

ActivityInactive
ResponsivenessNo issues

Related MCP Connectors

Related MCP Servers