mcp-web-search-server
mcp-web-search-server
独立的 MCP 服务器,通过 HTTP 暴露 web_search 和 web_fetch 工具。任何 MCP 客户端(Claude Desktop、Cursor 等)都可以连接它来执行网页搜索和获取网页。
开箱即用,无需 API 密钥:web_search/web_search_exa 使用 Exa 的公共 MCP 端点,该端点接受无需身份验证(限速)的请求。设置 EXA_API_KEY 可获得更高的速率限额,或设置 PARALLEL_API_KEY 以同时启用 web_search_parallel。
工具
工具 | 描述 |
| 获取并解析 URL,返回 markdown 或纯文本 |
| 使用 Exa 或 Parallel AI 搜索网页(按会话自动选择) |
| 专门使用 Exa AI 进行搜索 |
| 专门使用 Parallel AI 进行搜索 |
工作原理:
┌──────────────┐ MCP HTTP ┌──────────────────────────┐ HTTP ┌──────────────┐
│ MCP Client │ ◄───────────────► │ web-search-server │ ◄──────────► │ Exa AI │
│ (Claude, │ Streamable │ :9877/mcp │ │ mcp.exa.ai │
│ Cursor, │ │ │ └──────────────┘
│ etc.) │ │ Tools: │
└──────────────┘ │ • web_search (auto) │ ── HTTP ──► ┌──────────────┐
│ • web_search_exa │ │ Parallel │
│ • web_search_parallel │ │ search. │
│ • web_fetch │ │ parallel.ai │
└──────────────────────────┘ └──────────────┘关键设计决策:
纯 async/await — 无框架,仅使用原生
fetch(Bun 的 fetch)流式 HTTP 传输 — 使用来自
@modelcontextprotocol/sdk的WebStandardStreamableHTTPServerTransport,每个连接的客户端对应一个会话(传输层 + 服务器实例)提供商选择 — 通过会话 ID 的哈希为通用的
web_search工具选择 exa/parallel,并可通过环境变量覆盖HTML→Markdown — 使用 turndown 进行 markdown 提取,并使用小型状态机进行纯文本提取
Related MCP server: free-web-mcp
快速入门
# Install dependencies
bun install
# Run the server (default port 9877)
bun run src/index.ts配置
环境变量:
变量 | 默认值 | 描述 |
|
| 要监听的 HTTP 端口 |
|
| 要绑定的主机 |
| - | 可选的 Exa API 密钥,用于更高的速率限额 |
| - | Parallel API 密钥(启用 |
|
| 设置为 |
| 根据 | 无需密钥强制启用 Parallel |
| 基于哈希 | 为 |
从 MCP 客户端连接
将你的 MCP 客户端指向:http://localhost:9877/mcp
这是一个使用流式 HTTP 传输的标准 MCP 服务器。
使用示例
以 markdown 格式获取网页
{
"name": "web_fetch",
"arguments": {
"url": "https://example.com",
"format": "markdown"
}
}搜索网页
{
"name": "web_search",
"arguments": {
"query": "latest JavaScript features 2026",
"numResults": 5
}
}开发
# Type check
bunx tsc --noEmit
# Run in foreground
bun run src/index.ts架构
web_fetch使用原生 fetch,进行 HTML→Markdown 转换(turndown),并以 Cloudflare 作为回退MCP 服务器使用
@modelcontextprotocol/sdk中的WebStandardStreamableHTTPServerTransport监听标准 HTTP(无需 stdio)
web_search/web_fetch 工具的实现最初改编自 OpenCode 的内置网页搜索工具,随后被提取到这个独立服务器中。
许可证
This server cannot be deployed
Maintenance
Related MCP Connectors
Scrape, crawl and search the web for AI agents via MCP.
Web MCP: scrape/crawl sites, web search, brand assets, app stores, YouTube, Reddit, Hacker News.
Live AI-native web search with citations. One tool for every MCP client. Flat per-request pricing.
Free web search for AI agents. No API key required. Hosted MCP in active development.
Related MCP Servers
- AlicenseNot gradedqualityDmaintenanceEnables web search through Exa or Parallel APIs for MCP-compatible AI clients like Cursor and Claude Code.10 npm1MIT
- AlicenseAqualityBmaintenanceEnables AI agents to search the web and fetch webpage content as clean text via MCP, with optional headless rendering for dynamic pages.3MIT
- AlicenseCqualityBmaintenanceEnables MCP clients to run web searches and optionally fetch webpages through Moonshot's open platform API, using a configured API key.2184 npmMIT
- FlicenseNot gradedqualityAmaintenanceEnables MCP clients to search the web through SearXNG and crawl single pages or entire sites with Crawl4AI, producing clean markdown for LLM context.-