web-search-mcp
Routes server-side search queries to OpenAI-compatible LLM gateways, supporting the responses/chat API styles with automatic failover.
Routes server-side search queries to Perplexity's API, with configurable search modes and automatic fallback among providers.
Click on "Install Server".
Wait a few minutes for the server to deploy. Once ready, it will show a "Started" state.
In the chat, type
@followed by the MCP server name and your instructions, e.g., "@web-search-mcpsearch for the latest news on AI safety"
That's it! The server will respond to your query, and you can continue using it as needed.
Here is a step-by-step guide with screenshots.
web-search-mcp
多供应商 LLM 服务端搜索网关:把搜索请求转发给支持服务端搜索(DEEP_SEARCH)的 LLM 中转网关,多供应商自动兜底。提供 REST 与 MCP(streamable HTTP)两种接口。
零第三方依赖(纯 Go 标准库),Docker 多阶段构建,镜像解压约 15MB
中文请求体统一 ASCII 转义(\uXXXX),规避网关中文乱码问题
支持 ECH(Encrypted Client Hello)
环境变量
变量 | 说明 |
| 监听端口,默认 8080 |
| 默认单请求超时(毫秒),默认 90000;可被 |
网关配置全部由请求头动态提供,修改配置无需重启容器。
Related MCP server: MCP Web Search Server
请求头协议
头 | 示例 | 说明 |
|
| 全局参数(可选) |
| 网关数组 JSON | 按数组顺序兜底,改配置即切换,无需重启 |
X-Search-Config 全局参数
字段 | 说明 |
| 单请求超时(毫秒),0=默认 |
| 网络失败/5xx 重试轮数,0-10,默认 3 |
| DoH 端点数组( |
X-Search-Providers 数组元素
{
"name": "primary",
"baseURL": "https://api.example.com/v1",
"apiKey": "sk-你的key",
"model": "grok-4.3",
"apiStyle": "auto",
"channel": "auto",
"ech": true,
"echHost": "cdn.example.net",
"timeoutMs": 90000,
"ips": ["1.2.3.4"]
}字段 | 必填 | 说明 |
| 供应商名(错误报告/日志用) | |
| ✅ | 网关地址,如 |
| ✅ | Bearer token |
| ✅ | 模型名 |
|
| |
|
| |
| 通道参数透传(如 | |
| 是否启用 ECH(默认 false) | |
| 查询 HTTPS 记录(获取 ECHConfig)的域名;缺省=baseURL 的 host | |
| 单网关超时覆盖 | |
| 调试:显式 IP 列表( | |
| 预留排序字段 |
ECH(Encrypted Client Hello)
网关配置开启 ech: true 时,通过 echHost(缺省为 baseURL 的 host)获取 ECHConfig 并用于 TLS 握手。
HTTP API
端点 | 说明 |
|
|
| MCP Streamable HTTP(initialize/tools/list/tools/call,非流式) |
| 健康检查 |
| 说明网关由请求头动态提供 |
POST /search 响应
{
"ok": true,
"query": "...",
"answer": "回答文本(含 [n](url) 来源引用)",
"searched": true,
"sources": [{"url": "https://...", "title": "..."}],
"usage": {"input_tokens": 112, "output_tokens": 500},
"provider": "primary",
"model": "grok-4.3",
"search_calls": 1,
"latencyMs": 15700
}全供应商失败时返回 502 + errors 数组(每个供应商的失败原因)。
MCP 接入(Reasonix / Claude 等客户端)
在 MCP 客户端配置 HTTP MCP server:
[[plugins]]
name = "web-search"
type = "http"
url = "https://your-domain.example.com/web_search/mcp"
headers = { "X-Search-Providers" = "${SEARCH_PROVIDERS}" }
call_timeout_seconds = 180工具名 web_search,参数:query(必填)、provider(可选,指定供应商)。
网络容错
每次请求重新 DNS 解析(不缓存固定 IP,天然支持 CDN 节点轮换)
连接失败/超时/5xx 自动重试(默认 3 轮,
retries可调);每轮重新解析、跳过已失败 IP4xx(403 等)不重试,网关错误原文透传(据此换模型/网关)
开发
go test ./... # 44 用例:配置/ECH/DoH/通道/MCP 协议全覆盖
go build -o bin/web-search-mcp .Docker 部署
docker run -d --name web-search -p 8080:8080 \
-e PORT=8080 \
ghcr.io/mdzz-123/web-search-mcp:latest网关配置经请求头传入(见上文协议),容器无需任何供应商环境变量。
This server cannot be installed
Maintenance
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
- Alicense-qualityDmaintenanceMCP server for internet search via direct Google and DuckDuckGo HTML scraping with AI-powered result normalization and optional summarization, requiring no API keys for search.MIT
- AlicenseAqualityBmaintenanceMCP server for web search with LLM-optimized results and anti-detection mechanisms.340MIT
- Flicense-qualityCmaintenanceA remote MCP server that routes web search queries across multiple providers (HTTP APIs, external MCP servers, LLM with grounding) with intelligent fallback and quota management.
- AlicenseAqualityCmaintenanceMCP server that searches 9 sources, scrapes full content, reranks results, and synthesizes cited answers with free LLMs.5MIT
Related MCP Connectors
MCP server for Google search results via SERP API
Multi-engine search for AI agents. Trust scoring, local corpus, MCP-native. Self-hostable, BYOK.
MCP server providing access to the Scorecard API to evaluate and optimize LLM systems.
Latest Blog Posts
- Who's Calling? MCP Hosts Are an Identity Blind Spot (And the Spec Knows It)By Om-Shree-0709 on .mcpAgent IdentityOAuth 2.1
- Your AI Chatbot Just Exposed Your CEO's Salary to an InternBy Om-Shree-0709 on .Agent IdentityMCP SecurityOAuth Delegation
- Why MCP Servers Need Execution Sandboxing (And Why Your Current Stack Isn't Enough)By Om-Shree-0709 on .Agentic AiPrompt InjectionWebAssembly
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/MDZZ-123/web-search-mcp'
If you have feedback or need assistance with the MCP directory API, please join our Discord server