ai-search-mcp
AI Search MCP
专为 Agent 打造的上网搜索 MCP 服务器:开箱即用的免费搜索引擎、可插拔的高质量引擎、内置缓存、时间过滤,以及一次调用完成整轮调研的
research组合工具。An agent-friendly web search MCP server — zero-config free engines, region-aware failover, freshness filtering, and a one-call
researchtool.
为什么做这个(Why)
搜索是 Agent 最高频的工具,但现有方案都有硬伤:
现有方案 | 问题 |
官方 | 只能抓已知 URL,不会搜索 |
Tavily / Brave / Exa 官方 MCP | 质量高,但全部要付费 API Key |
社区 DuckDuckGo MCP | 免费但脆弱,输出非结构化,无缓存/重试 |
ai-search-mcp 填补了这个空档:零配置就能用(DuckDuckGo / Bing / 百度 / 搜狗),自动按区域选择最合适的引擎并故障转移,支持时效过滤,还能把「搜→选→抓→总结」的整轮调研压成一次 research 调用。
Related MCP server: websearch-skill
特性(Features)
🆓 零配置开箱即用:
npx ai-search-mcp直接跑,不需要任何 API Key🔌 多引擎可插拔:免费引擎
duckduckgo·bing·baidu·sogou+ 付费引擎brave·tavily🌏 区域感知自动选引擎:
SEARCH_ENGINE=auto(默认)→ 中国区域走bing→baidu→sogou,其他区域走duckduckgo→bing;429/超时自动故障转移,支持逗号分隔引擎链🕒 时间过滤:
freshness=day|week|month|year或timeRange="YYYY-MM-DD..YYYY-MM-DD",按引擎自动映射🧠 Agent 友好输出:结构化 JSON(
{ id, title, url, snippet, domain }),不是原始 HTML;每条结果带稳定id,可直接引用🧭
research组合工具:一次调用 = 搜索 + 抓取 Top 页 → 证据简报(消灭 5~10 次工具往返)⚡ 内置缓存(TTL,默认 10 分钟):减少重复网络请求,更快更省
🛡️ 工程兜底:超时、指数退避重试、统一错误码,
RATE_LIMITED错误附带suggestedEngine/retryAfter建议🐢 礼貌爬虫内置:按引擎限频(默认 8 次/分)+ 随机请求间隔,主动避免触发平台风控,不做任何反爬对抗(合规优先)
📄
fetch_page工具:任意 URL(或搜索结果id)转成可读 Markdown🌏 代理支持:
SEARCH_HTTP_PROXY/HTTP(S)_PROXY🧪 零构建纯 JS(CommonJS),130 个单元测试 + 端到端冒烟测试
快速开始(Quick Start)
需要 Node.js >= 18。
# 直接用 npx 运行(无需安装)
npx -y ai-search-mcp
# 或全局/本地安装
npm i -g ai-search-mcp
ai-search-mcpClaude Desktop
在 claude_desktop_config.json 中加入:
{
"mcpServers": {
"ai-search-mcp": {
"command": "npx",
"args": ["-y", "ai-search-mcp"]
}
}
}Cursor / Cline / 其他支持 MCP 的客户端
{
"mcpServers": {
"ai-search-mcp": {
"command": "npx",
"args": ["-y", "ai-search-mcp"],
"env": {
"SEARCH_REGION": "cn-zh"
}
}
}
}中国用户建议加上
SEARCH_REGION=cn-zh,会自动走国内可直连的引擎链(bing → baidu → sogou),免代理。
从源码运行
git clone https://github.com/zhulingyu666/ai-search-mcp.git
cd ai-search-mcp
npm install
npm start工具说明(Tools)
search — 搜索
{
"query": "2026年 大模型 最新进展",
"maxResults": 10,
"site": "github.com",
"region": "us-en",
"freshness": "week"
}返回(结构化 JSON):
{
"query": "2026年 大模型 最新进展",
"queryRewritten": "大模型 最新进展",
"queryYear": 2026,
"engine": "bing",
"engineSwitched": false,
"cached": false,
"total": 10,
"deduped": 2,
"freshnessApplied": true,
"freshnessAutoInferred": true,
"timeRange": "2025-08-25..2026-08-25",
"results": [
{
"id": "a1b2c3d4",
"title": "...",
"url": "https://...",
"snippet": "...",
"domain": "example.com"
}
]
}中文查询自动改写:当查询含中文且出现「20xx年」年份词(如「2026年 大模型 最新进展」)时,工具会移除年份词并自动附加
freshness=year补偿时间意图——因为 Bing 等引擎对中文分词弱,年份前缀会导致返回「2026年百科/日历」等跑题结果。改写通过queryRewritten/queryYear/freshnessAutoInferred透明返回,Agent 可自行判断是否接受。
参数 | 类型 | 默认 | 说明 |
| string | — | 搜索关键词(必填) |
| number | 10 | 返回条数(1–20) |
| string | — | 限定单个域名,如 |
| string[] | — | 只返回这些域名的结果,如 |
| string[] | — | 排除这些域名的结果,如 |
| string | — | 区域提示:DDG |
| string | — |
|
| string | — | 精确时间窗 |
每条结果带稳定
id(sha1 前缀)。把这个id传给fetch_page即可深读该页,无需再手拼 URL。
research — 一次调用完成整轮调研
替代 Agent「搜索 → 选页 → 抓取 → 总结」的循环,一次调用搞定:
{
"query": "2026 LLM open source models comparison",
"maxResults": 5,
"fetchTopN": 2,
"freshness": "month"
}返回证据简报(evidence brief):
{
"query": "...",
"engine": "bing",
"overview": { "total": 5, "results": [ { "id": "...", "title": "...", "url": "...", "snippet": "...", "domain": "..." } ] },
"pages": [ { "id": "...", "url": "...", "title": "...", "headings": [ { "level": 1, "text": "..." } ], "content": "...", "length": 4000, "truncated": false } ],
"note": "证据简报已就绪,请基于页面内容总结并标注来源 URL。"
}多页面并行抓取;单页失败记作
{ url, error },不影响整体结果智能选页:pages 按域名多样性选取(先每个域名取排名最高的一条,再按排名补足),避免单站垄断——某个站反爬 403 时其他域名的页面不受影响;
rank字段标注该结果在搜索结果中的原始排名extractMode(默认summary):summary返回去噪后的正文要点(省 token),full返回整页 Markdown总结由宿主模型完成——MCP 内部不依赖任何 LLM,保持零外部依赖、厂商无关
fetch_page — 抓取网页转结构化内容
{
"url": "https://example.com/article",
"extractMode": "summary",
"maxLength": 8000
}extractMode:summary(默认省 token,返回去噪正文mainText)/full(返回整页markdown)返回
{ url, title, description, headings, mainText, markdown, length, truncated, cached }——headings是页面标题大纲,Agent 可先看结构再决定是否深读
也可以用结果 id:{ "id": "a1b2c3d4", "maxLength": 8000 }。
配置(环境变量)
变量 | 默认 | 说明 |
|
| 单个引擎或逗号分隔引擎链(如 |
| — | 引擎自动选择的默认区域,如 |
|
| 默认结果条数(1–20) |
|
| 缓存 TTL(秒,0 表示关闭) |
| — | 缓存持久化文件路径,如 |
|
| 单次请求超时(毫秒) |
|
| 每个引擎每分钟最大请求数(0 关闭限频) |
|
| 请求间随机延迟范围(毫秒,0 关闭) |
|
|
|
|
|
|
|
|
|
|
|
|
| — | 使用 |
| — | 使用 |
| — | 代理地址,如 |
| 内置 | 自定义 User-Agent |
引擎对比
引擎 | 免费 | API Key | 时间过滤 | 说明 |
| ✅ | ❌ | ❌ | 海外专用(墙内不可达);索引质量全球最佳,反爬严,需海外 IP + Cookie 会话 |
| ✅ | ❌ | ✅( | 全球通用;中国区域默认,中英文覆盖好,国内免代理直连 |
| ✅ | ❌ | ✅( | 全球备选;中国大陆直连可能超时(需代理) |
| ✅ | ❌ | ❌ | 海外专用;俄语/CIS 内容强,部分网络可达性好,反爬中等 |
| ✅ | ❌ | ❌ | 360 搜索;数据中心/国内 IP 均可直连,反爬相对宽松,中文原生引擎 |
| ✅ | ❌ | ❌ | 仅限国内;中文索引强,但反爬严(数据中心 IP 下带 Cookie 仍会触发图形验证码) |
| ✅ | ❌ | ❌ | 仅限国内;微信内容覆盖好,但缺 JS 生成的 SNUID 会话会被 302 拦回 |
| ❌ | ✅ | ✅( | 官方 API,质量高,有免费额度 |
| ❌ | ✅ | ✅( | 专为 LLM/RAG 检索设计 |
网络注意事项
中国大陆免代理:默认
SEARCH_ENGINE=auto+SEARCH_REGION=cn-zh→bing → so360 → baidu → sogou,全部直连可用,无需任何配置。其中 360 搜索(so360)对数据中心/机房 IP 的容忍度最高,是最可靠的国内原生中文引擎。海外部署:不设
SEARCH_REGION(或设为非cn前缀)→ 默认链google → bing → duckduckgo → yandex,Google 质量最优、Bing 最稳,任一失败自动转移。Google/Yandex 在墙内不可达/被验证码拦截属预期(当前网络会先超时/报RATE_LIMITED后自动切换)。免费引擎会限流。429 会以结构化错误返回(
RATE_LIMITED,带suggestedEngine和retryAfter);引擎链会在 429/超时时自动故障转移。部分站点(如百度百科、很多国内门户)会拒绝脚本抓取(HTTP 403):
fetch_page返回结构化错误,research将对应页标记为失败并继续。需要访问 DuckDuckGo / Brave / Tavily 但处于墙内?用代理:
SEARCH_ENGINE=duckduckgo SEARCH_HTTP_PROXY=http://127.0.0.1:7890 ai-search-mcp礼貌爬虫定位:工具内置按引擎限频(默认 8 次/分)与随机请求间隔;百度/搜狗通过首页播种会话 Cookie(BAIDUID / SUID)提升成功率,但不做验证码绕过、UA 伪造轮换、代理池轮换等反反爬对抗——这是合规红线。被 403/验证码拦截时请降频或切换引擎。
百度/搜狗可用性说明(实测):这两个引擎对网络环境很敏感——数据中心/海外 IP 下,百度即使带播种 Cookie 也会被强制图形验证码(
wappass),搜狗缺少 JS 生成的 SNUID 会被 302 拦回(antispider)。因此默认环境下它们会自动故障转移到 Bing/360;若你在大陆住宅 IP 且百度/搜狗可达的环境中运行,可设SEARCH_LANG_ROUTING=1让中文查询优先走百度/搜狗/360(原生中文引擎,分词更好)。我们遵循目标站点的
robots.txt与服务条款;本工具只返回搜索摘要与链接,不转载全文内容。
开发(Development)
npm test # 126 个单元测试(Node 内置 test runner)
node scripts/smoke-test.js # 端到端冒烟:search + freshness + research(需要网络)日志示例(stderr,SEARCH_LOG_LEVEL=debug)
[ai-search-mcp] [info] ready (version 0.3.2, engine=auto, region=cn-zh, logLevel=debug)
[ai-search-mcp] [info] rewrite q="2026年 大模型 最新进展" -> q="大模型 最新进展" +freshness=year
[ai-search-mcp] [info] search q="大模型 最新进展" engine=bing cached=false took=972ms total=3 deduped=1
[ai-search-mcp] [info] fetch url=https://example.com/ len=130 mode=summary took=1189ms
[ai-search-mcp] [debug] engine-fail engine=baidu err=RATE_LIMITED took=1203ms
[ai-search-mcp] [warn] fetch-fail url=https://baike.baidu.com/... err=ENGINE_ERROR took=512ms许可证(License)
免责声明:本项目为独立开源项目,与 DuckDuckGo、Bing/Microsoft、Brave、Tavily、百度、搜狗均无关联、背书或赞助关系。百度/搜狗基于公开 HTML 解析,若这些站点变更页面结构可能导致解析失效。
Maintenance
Resources
Unclaimed servers have limited discoverability.
Looking for Admin?
If you are the server author, to access and configure the admin panel.
Tools
Related MCP Servers
- FlicenseNot gradedqualityDmaintenanceProvides comprehensive search capabilities including web search, content extraction, news search, academic search, and AI-powered multi-source research. Enables natural language access to web content and research through a production-ready MCP server.
- AlicenseAqualityBmaintenanceEnables AI agents to perform multi-engine web search, fetch web pages, and extract clean Markdown content via MCP, with no API keys required.35MIT
- AlicenseNot gradedqualityBmaintenanceEnables AI agents to perform web searches with full content retrieval and multi-engine provenance, including trust scoring and local corpus persistence, via MCP integration.42Apache 2.0
- AlicenseAqualityAmaintenanceA multi-engine web search MCP server that integrates with coding agents, offering parallel search, page fetching, X/Twitter search, deep research, and configurable free/API layers.65MIT
Related MCP Connectors
Stealth web browser for agents: search, fetch, click and type through persistent sessions over MCP.
Web research for agents: quality-scored Google search, webpage extraction, and deep research.
Multi-engine search for AI agents. Trust scoring, local corpus, MCP-native. Self-hostable, BYOK.
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/zhulingyu666/ai-search-mcp'
If you have feedback or need assistance with the MCP directory API, please join our Discord server