Skip to main content
Glama
daidaiJ

websearch-mcpserver

by daidaiJ

websearch-mcpserver

轻量级 Web Search MCP Server — 零 API Key 即可运行

用 Go 编写的 MCP 搜索服务。内置百度网页、Bing、DuckDuckGo 等通用引擎和 9 个学术引擎,搜索、评分、缓存全部在本地完成。可作为 MCP 工具接入 Claude Code、Qwen Code、Cursor,也可作为 Go 模块嵌入自有服务。

免费、国内可用、结果可直接给 LLM 消费。 无 Key 也能搜;有 Key 才用 Key。


架构一览

分层设计:客户端最多面对 5 个 MCP 工具;引擎组由 mode 组装;评分、缓存、代理、抓取都在本进程内完成,查询不会经过第三方聚合服务。

层

做什么

接入

Claude Code / Qwen Code / Cursor / HTTP API / 嵌入 Go 模块

协议

/mcp 最多五个工具 · /searxng/search 兼容 LiteLLM · /__admin 进程管理 · /dashboard 可选本机控制台

编排

factory / mode 组装 · hybrid / apipool · enhance(RRF / Boost / MMR)

引擎

通用:百度网页 / 千帆 / Bing / DDG / Tavily / Exa / AnySearch / 豆包;学术 9 源并行

支撑

SQLite 缓存、系统代理自动检测、webfetch(SSRF 防护)、MinerU、LLM 流式摘要、Everything

更完整的回退链、代理检测与嵌入方式见 docs/architecture.md。


Related MCP server: Web Researcher MCP

面向 LLM 的工具链

五个检索工具互相衔接;已保存的长搜索、网页/PDF 正文通过 cleanfetch 分段读回,无需客户端访问容器文件。读取从 offset=0 开始,按 next_offset 续读到 eof=true。


核心特性

能力

说明

零 Key 搜索

engine 模式内置百度网页搜索 + Bing 并发,无需任何 API Key

多引擎融合

多种搜索模式、8 个通用引擎 + 9 个学术引擎,主引擎失败自动回退

相关性评分

RRF 融合排名 + 词汇对齐 / 域名品质 / 共识 / 权威 / 时效加分,低分自动裁剪;MMR 打散转载 / 镜像

响应透明

失败清单、日期与检索溯源;超限搜索保留候选预览,完整结果落盘后提供 result_ref,通过 cleanfetch 的引用读取模式分段读取

学术搜索

9 大学术引擎并行,按引用数 / 期刊权威 / PDF 可用性 / 新鲜度评分;DOI 跨引擎去重

网页抓取

cleanfetch 内置 SSRF / DNS rebinding 防护与超大文件预检,失败回退 Jina Reader

PDF 解析

本地 PDF 文本优先提取,扫描件可回退 MinerU OCR;远程 MinerU 返回含图片 ZIP 地址;原文件超出单任务上限(默认 600 页)时本地 qpdf 裁切所选页,可配置自动分批与单次页数预算后分批上传;MinerU 等待可调,超时保留状态与任务引用,可续查原任务

LLM 摘要

可选接入 OpenAI 兼容 API 生成结构化摘要,支持流式推送

系统代理

Clash 等开启系统代理后,海外引擎 / Jina Reader 自动走代理

本地文件检索

file_search 基于 Everything 索引毫秒级定位本地文件,目录白名单防越界,词汇对齐二次过滤防上下文爆炸(需 Everything HTTP Server)

本机控制台

可选 dashboard.enabled,/dashboard/ 只读观测界面:调用统计、来源健康、失败分类、白名单配置修改(默认关闭)

轻量部署

单二进制、无 CGO、引用计数进程管理,可嵌入 Go 模块


搜索与评分管线

结果不是原始聚合。多引擎回传后在本地做去重、融合排名和多样性重排,再可选生成摘要:


设计背景与目标

现成的 MCP 搜索方案各有短板:厂商服务(Tavily / Exa 等)要 Key、按量付费、数据过第三方、国内访问不稳;自建 SearXNG 要维护 Python 服务,结果是未优化的原始聚合。本项目把这些能力收回本地:单二进制自带多引擎融合、9 大学术源、抓取与 PDF 解析,让搜索成为 LLM 的免费、国内可用、结果可直接消费的基础能力。

完整的立项动机、与现成方案的逐维度对比、以及设计原则(本地优先隐私默认 / 零成本起步 / 丰简由人 / 解耦可组合 / 面向 LLM 的完整工具链 / 场景化优化)见 docs/design.md。


快速开始

# 1. 下载二进制: https://github.com/daidaiJ/websearch-mcpserver/releases
# 2. 启动(无需手写配置,无需 API Key)
# Windows 开机自启动 可选
./websearch-mcpserver.exe install
#
#    首次 install 会在可执行文件目录自动生成一份可编辑的预设 config.yaml 和 autostart.vbs
./websearch-mcpserver start
# 或者点击
autostart.vbs
# 3. 注册到 MCP 客户端(见 docs/installation.md)

「零配置」= 首次启动自动生成与 config.example.yaml 相同的预设 config.yaml,改端口 / Key / 模式都改这一份文件。默认只监听 127.0.0.1;开放网卡(host: 0.0.0.0)时建议配置 auth_token 保护业务端点。

或通过 MCP Hooks 实现会话自动启停(Qwen Code 示例,完整说明见 docs/installation.md):

{
  "hooks": {
    "SessionStart": [{ "matcher": "*", "hooks": [{ "type": "command", "command": "/path/to/websearch-mcpserver start", "timeout": 10000 }] }],
    "SessionEnd":   [{ "matcher": "*", "hooks": [{ "type": "command", "command": "/path/to/websearch-mcpserver stop",  "timeout": 10000 }] }]
  }
}

搜索模式速览

mode 一个字段决定引擎组合:engine 零 Key 可用(百度网页 + Bing 并发,按配置与代理条件自动加入 360 / DuckDuckGo / Wikipedia / Google News);baidu / tavily / exa / anysearch / doubao 单供应商直连(有 Key 才参与,主引擎失败自动回退);apipool Key 池轮转(round-robin / priority / weighted,百度网页兜底);hybrid 全引擎并发。无 Key 时自动降级为 engine。

各模式的参与引擎、获取 Key 入口、sk_list 多 Key 轮询与逐引擎限流口径见 docs/search.md。


本机控制中心(可选,默认关闭)

dashboard.enabled: true 后,本机浏览器访问 http://127.0.0.1:8338/dashboard/。四个页面:总览 KPI 与客户端用量归组、搜索源健康与失败构成、请求级调用链(可筛选、可导出 CSV)、备份后写入白名单配置;全程被动观测,失败分类只报告,不干预调用。

控制中心总览

启用即把 dashboard.example.yaml 复制为 config.yaml 同目录的 dashboard.yaml(首次 start / install 自动生成并默认启用,含随机本机管理员口令);删除该文件并重启即完整回退,运行时零遥测开销。隐私默认:查询只存哈希 + 主题等脱敏元数据,密钥与查询原文永不落库、接口永不回显;默认仅本机 loopback 可读,写操作需 admin_password。

页面明细、全部配置键、快捷方式落位、安全模型与调用归属见 docs/dashboard.md。


文档导航

各文档均为中文默认,同名 .en.md 为英文版。

读者

文档

内容

👤 人类用户

docs/HUMAN_GUIDE.md

人类阅读版:文档导读、模式选择、调优路线、排障速查

🤖 AI Agent

docs/AGENT_GUIDE.md

省 token 版:部署速查、工具参数速查、机器契约、错误速诊

📚 参考

docs/installation.md

安装部署(二进制 4 平台 / GHCR linux amd64+arm64 / 源码 / 客户端注册)、运维与排障

📚 参考

docs/configuration.md

完整配置参考、环境变量覆盖、默认值速查

📚 参考

docs/search.md

搜索模式详解、引擎对照、相关性评分、MCP 工具参数

📚 参考

docs/architecture.md

架构设计、回退链、代理检测、缓存、Go 模块嵌入、web-researcher 扩展

📚 参考

docs/design.md

设计背景与目标:立项动机、与现成方案对比、设计原则

📚 参考

docs/api.md

Go Module API 与 HTTP API(MCP / SearXNG / Admin 端点)

📚 参考

docs/dashboard.md

本机控制中心:全部配置键、写操作安全模型、隐私边界

📚 参考

docs/developers.md

开发者指南:包结构、接口契约、工具调用链、改动落点

📚 参考

CHANGELOG.md

版本变更日志

相关项目

Related MCP Connectors

  • Free web search for AI agents. No API key required. Hosted MCP in active development.

  • Multi-engine search for AI agents. Trust scoring, local corpus, MCP-native. Self-hostable, BYOK.

  • Search GitHub, npm, PyPI, StackOverflow, ArXiv from one MCP — built for coding agents.

  • Your agent needs the open web — searched by more than one engine, and read as clean markdown rather than raw HTML. **What you can ask for** • "Search this question with two providers and tell me where they disagree." • "Scrape these 40 URLs into markdown, in one batch." • "Crawl this documentation site and give me every page." • "Do deep research on this topic and cite the sources." • "Find the academic papers behind this claim." **How to use it** Point any MCP client at https://mcp.aisa.one/search/mcp and sign in with OAuth — there is no key to create or paste. 30 tools across several independent providers: Tavily and Exa search, answers, contents and agent runs; Firecrawl scrape, batch scrape, crawl, map and search; Perplexity Sonar, Sonar Pro, reasoning and deep research; Oxylabs AI search and LLM jobs; OpenAI and Anthropic web search; and scholarly search. **Why this rather than the source** Several independent indexes behind one account, because one engine's blind spot is not visible from inside it. **It is also a door to the rest** The same login reaches 26 sources and 580+ operations. Find the page here, then ask the same agent who links to it or how much traffic it gets — without adding a second server. **What it costs** Finding and inspecting an operation is free. Running one is billed per call at API prices, with no seat and no monthly minimum, and every call takes max_price_usd so an agent cannot overspend by accident. **Where else it reaches** https://mcp.aisa.one/seo-serp/mcp for the Google results page itself, https://mcp.aisa.one/seo-serp-other-engines/mcp for Bing, Baidu and Naver.

Related MCP Servers

  • A
    license
    A
    quality
    A
    maintenance
    MCP server for AI-powered web research — search (Google, Brave, Serper, SearXNG), scrape any page, extract PDFs/DOCX/YouTube transcripts, academic & patent search. Single Go binary. Works with Claude, Cursor, Copilot, and any MCP client.
    25
    68
    MIT
  • A
    license
    A
    quality
    C
    maintenance
    Free, open-source web search gateway and MCP server for LLMs, AI agents, and RAG. It provides no-key web, code, academic, and community search with deduplication, ranking fusion, and citation-ready results.
    3
    2
    MIT