Skip to main content
Glama
am24check

mcp-web-search-server

by am24check

mcp-web-search-server

独立的 MCP 服务器,通过 HTTP 暴露 web_searchweb_fetch 工具。任何 MCP 客户端(Claude Desktop、Cursor 等)都可以连接它来执行网页搜索和获取网页。

开箱即用,无需 API 密钥:web_search/web_search_exa 使用 Exa 的公共 MCP 端点,该端点接受无需身份验证(限速)的请求。设置 EXA_API_KEY 可获得更高的速率限额,或设置 PARALLEL_API_KEY 以同时启用 web_search_parallel

工具

工具

描述

web_fetch

获取并解析 URL,返回 markdown 或纯文本

web_search

使用 Exa 或 Parallel AI 搜索网页(按会话自动选择)

web_search_exa

专门使用 Exa AI 进行搜索

web_search_parallel

专门使用 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 │
                                   └──────────────────────────┘               └──────────────┘

关键设计决策:

  1. 纯 async/await — 无框架,仅使用原生 fetch(Bun 的 fetch)

  2. 流式 HTTP 传输 — 使用来自 @modelcontextprotocol/sdkWebStandardStreamableHTTPServerTransport,每个连接的客户端对应一个会话(传输层 + 服务器实例)

  3. 提供商选择 — 通过会话 ID 的哈希为通用的 web_search 工具选择 exa/parallel,并可通过环境变量覆盖

  4. HTML→Markdown — 使用 turndown 进行 markdown 提取,并使用小型状态机进行纯文本提取

Related MCP server: websearch-mcp-server

快速入门

# Install dependencies
bun install

# Run the server (default port 9877)
bun run src/index.ts

配置

环境变量:

变量

默认值

描述

PORT

9877

要监听的 HTTP 端口

HOSTNAME

0.0.0.0

要绑定的主机

EXA_API_KEY

-

可选的 Exa API 密钥,用于更高的速率限额

PARALLEL_API_KEY

-

Parallel API 密钥(启用 web_search_parallel

ENABLE_EXA

1(默认开启)

设置为 0 以禁用 web_search_exa

ENABLE_PARALLEL

根据 PARALLEL_API_KEY 推断

无需密钥强制启用 Parallel

WEBSEARCH_PROVIDER

基于哈希

web_search 强制指定 exaparallel

从 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_search 代理到 ExaParallel 的 MCP 端点

  • web_fetch 使用原生 fetch,进行 HTML→Markdown 转换(turndown),并以 Cloudflare 作为回退

  • MCP 服务器使用 @modelcontextprotocol/sdk 中的 WebStandardStreamableHTTPServerTransport

  • 监听标准 HTTP(无需 stdio)

web_search/web_fetch 工具的实现最初改编自 OpenCode 的内置网页搜索工具,随后被提取到这个独立服务器中。

许可证

MIT

A
license - permissive license
Not graded
quality - not tested
C
maintenance

Maintenance

Maintainers
Response time
Release cycle
Releases (12mo)
Commit activity

Resources

Unclaimed servers have limited discoverability.

Looking for Admin?

If you are the server author, to access and configure the admin panel.

Related MCP Servers

View all related MCP servers

Related MCP Connectors

  • Stealth web browser for agents: search, fetch, click and type through persistent sessions over MCP.

  • Fast, intelligent web search and web crawling. New mcp tool: Exa-code is a context tool for coding

  • Jina AI Reader/Search MCP — turn any URL into clean LLM-ready markdown, plus web search.

View all MCP Connectors

Latest Blog Posts

MCP directory API

We provide all the information about MCP servers via our MCP API.

curl -X GET 'https://glama.ai/api/mcp/v1/servers/am24check/mcp-web-search-server'

If you have feedback or need assistance with the MCP directory API, please join our Discord server