关于 SearXNG HTTP MCP
SearXNG HTTP MCP 将 SearXNG 元搜索能力封装为 MCP 服务,可通过 Docker、stdio 或 uvx 运行。它面向需要隐私友好网页搜索的 MCP 客户端,提供搜索、补全和引擎发现工具。
主要功能
- 01聚合 200 多个搜索引擎
- 02支持 30 多种搜索类别
- 03多页并行搜索与自动补全
- 04发现引擎及类别信息
- 05HTTP 与 stdio 等运行模式
- 06API 密钥和 HTTP Basic Auth
适用场景
- 01让 Agent 查询多引擎网页结果
- 02按新闻或科学等类别筛选搜索
- 03获取搜索词建议
- 04查看可用搜索引擎与类别
MCP 相关
向 MCP 客户端提供 search、autocomplete 和 engine_info 工具,可通过 HTTP 或 stdio 连接。
配置
本地服务的配置在各客户端中通用,复制后粘贴到客户端的 MCP 配置文件即可。
docker run -i --rm -e API_KEY ghcr.io/whw23/searxng-http-mcpAPI_KEY密钥API key for authentication. Leave empty for no auth.本地服务需要在你的电脑上安装运行环境(如 Node.js 18+)。各客户端的配置文件位置不同,请参考客户端文档。
ghcr.io/whw23/searxng-http-mcpstdioStreamable HTTP工具
本地服务需要在你的电脑上运行后才能读取工具,维护者暂未提供工具列表。
详细介绍
一个独立的 MCP 服务,封装了 SearXNG——一款免费的、注重隐私的元搜索引擎,可汇总来自 200 多个搜索引擎的结果。
🚀 快速开始
服务端模式 — 部署一次,即可从任意客户端连接:
docker run -d --name searxng-mcp --restart unless-stopped \
-p YOUR_PORT:8888 --memory=512m --cpus=1 \
ghcr.io/whw23/searxng-http-mcp:latest
然后连接客户端到 http://YOUR_HOST:YOUR_PORT/mcp/。如需启用 API 密钥身份验证,请参阅身份验证。
本地模式 — 无需服务端,直接在客户端中运行:
docker run --rm -i --memory=512m --cpus=1 ghcr.io/whw23/searxng-http-mcp:latest --stdio
在客户端中将其添加为 stdio MCP 服务端;详情请参阅客户端配置。
uvx 模式 — 如果你已经运行 SearXNG(安装指南):
uvx searxng-http-mcp
将 SEARXNG_URL 设置为指向你的 SearXNG 实例(默认值:http://127.0.0.1:8080)。
✨ 功能
搜索
- 🔍 200 多个搜索引擎——通过 SearXNG 使用 Google、Bing、DuckDuckGo、Brave 等
- 📂 30 多个类别——新闻、图片、视频、科学、IT 等
- 📄 多页并行搜索——每次调用最多搜索 5 页
- 💡 自动补全建议——发现相关搜索词
- 🗂 引擎发现——按类别查询可用引擎
- 🎯 节省令牌——将结果精简至要点
基础设施
- 📦 独立运行——SearXNG 已内置于 Docker 镜像
- 🔄 三种传输方式——HTTP 服务、Docker stdio 和独立 uvx
- 🔐 身份验证——
x-api-key+ HTTP Basic Auth - 🌐 反向代理——SearXNG Web 界面使用相同端口
- ⚡ 动态工具描述——启动时注入实时类别列表
- 📐 丰富的 JSON Schema——每个参数都包含枚举约束、范围限制和说明
🏛 架构
graph LR
Client(["client:YOUR_PORT"]) --> Expose(":8888")
subgraph Container["🐳 Docker Container"]
direction LR
Expose --> Auth{Auth}
Auth -->|/mcp| MCP[FastMCP Server]
Auth -->|/*| Proxy[Reverse Proxy]
MCP --> SearXNG[SearXNG :8080]
Proxy --> SearXNG
end
style Expose fill:none,stroke:#2496ed,stroke-dasharray:5 5,color:#2496ed
style Client fill:#4a90d9,color:#fff,stroke:#3a7bc8
style Container fill:#f0f4f8,stroke:#2496ed,stroke-width:2px,color:#2496ed
style Auth fill:#f5a623,color:#fff,stroke:#d4900e
style MCP fill:#50c878,color:#fff,stroke:#3da85e
style Proxy fill:#9b59b6,color:#fff,stroke:#8344a5
style SearXNG fill:#e74c3c,color:#fff,stroke:#c0392b
📊 与其他方案的比较
为什么选择这五个?
目前有 20 多个 SearXNG MCP 服务,还有更多通用搜索 MCP 服务。大多数 SearXNG 封装只提供基础搜索工具,未能利用 SearXNG 的类别、自动补全和引擎元数据。我们选择了五个各自代表不同类别的替代方案:
- 88plug/searxng-mcp — 在 SearXNG MCP 服务中提供最丰富的工具集(7 个工具:渲染后获取、研究模式、并行查询)
- ihor/mcp-searxng — 在 SearXNG MCP 服务中 GitHub 星标数最多
- open-webSearch — SearXNG 生态之外表现出色的免费多引擎替代方案(Bing、Baidu、DuckDuckGo、Brave 等)
- exa-mcp-server — 最受欢迎的商业搜索 API MCP
- Perplexity MCP — 商业 AI 搜索,在搜索 MCP 领域星标数最高
| 功能 | ✨ 本项目 | 88plug/searxng-mcp | ihor/mcp-searxng | open-webSearch | exa-mcp-server | Perplexity MCP |
|---|---|---|---|---|---|---|
| 搜索 | ||||||
| 通过 SearXNG 使用 200 多个引擎 | ✅ | ✅ | ✅ | ❌ | ❌ | ❌ |
| 30 多个搜索类别 | ✅ | ❌ | ❌ | ❌ | ❌ | ❌ |
| 多页并行搜索 | ✅ | ❌ | ❌ | ❌ | ❌ | ❌ |
| 自动补全建议 | ✅ | ❌ | ❌ | ❌ | ❌ | ❌ |
| 引擎发现工具 | ✅ | ❌ | ❌ | ❌ | ❌ | ❌ |
| 动态工具描述 | ✅ | ❌ | ❌ | ❌ | ❌ | ❌ |
| 基础设施 | ||||||
| 独立运行(内置搜索) | ✅ | ❌ | ❌ | ✅ | 不适用 | 不适用 |
| Docker 零安装部署 | ✅ | ❌ | ❌ | ✅ | ❌ | ❌ |
| HTTP + stdio 传输 | ✅ | ✅ | ✅ | ✅ | ✅ | ✅ |
| 身份验证 | ✅ | ❌ | ❌ | ❌ | ✅ | ✅ |
| Web UI 反向代理 | ✅ | ❌ | ❌ | ❌ | ❌ | ❌ |
| AI 编码 Agent 插件 | ✅ | ❌ | ❌ | ❌ | ❌ | ✅ |
| 常规 | ||||||
| 免费且开源 | ✅ | ✅ | ✅ | ✅ | ❌(付费 API) | ❌(付费 API) |
| 隐私保护(可自托管) | ✅ | ✅ | ✅ | ✅ | ❌ | ❌ |
| 语言 | Python | Python | Node.js | TypeScript | TypeScript | TypeScript |
| GitHub 星标 | ||||||
为什么工具更少?
MCP 专为组合而设计——客户端连接多个各有所长的专用服务,每个服务做好一件事。一些替代方案会在搜索服务中捆绑 URL 抓取、渲染页面提取、多查询扇出或研究模式。我们有意将工具范围限定为三个(搜索、自动补全、引擎发现):
- 抓取 URL 是独立的职责。 MCP 客户端已经自带专用工具(WebFetch、Playwright MCP、Jina Reader)。将抓取功能捆绑到搜索服务中会混淆职责,并与客户端生态重复。
- 多查询并行搜索属于客户端编排。 大模型客户端可以并行发起多个
search调用——search_many工具只会增加工具选择的令牌开销,并无实际好处。 - 研究/综合应由大模型层负责。 模型是最合适的综合者。将多步骤研究逻辑推入 MCP 服务,会让应用层关注点与基础设施耦合。
相反,我们致力于补足上述替代方案所欠缺的能力:完整覆盖 SearXNG API(类别、自动补全、引擎元数据——这些功能大多数封装都未能充分利用)、独立部署、身份验证、Web UI 反向代理,以及 AI 编码 Agent 插件集成(Claude Code / Copilot CLI / Codex CLI)。
📖 使用方法
🌐 HTTP 模式(默认)
# Without authentication
docker run -d --name searxng-mcp --restart unless-stopped \
-p YOUR_PORT:8888 --memory=512m --cpus=1 \
ghcr.io/whw23/searxng-http-mcp:latest
# With authentication
docker run -d --name searxng-mcp --restart unless-stopped \
-p YOUR_PORT:8888 --memory=512m --cpus=1 \
-e API_KEY=your-secret-key \
ghcr.io/whw23/searxng-http-mcp:latest
| 🔗 MCP 端点 | http://YOUR_HOST:YOUR_PORT/mcp/ |
| 🖥 SearXNG Web UI | http://YOUR_HOST:YOUR_PORT/ |
📡 stdio 模式
docker run --rm -i --memory=512m --cpus=1 \
ghcr.io/whw23/searxng-http-mcp:latest --stdio
不公开端口。通过 stdin/stdout 通信。MCP 工具所需的 SearXNG 在内部运行。
🐍 uvx 模式
# Connect to a local SearXNG instance (default: http://127.0.0.1:8080)
uvx searxng-http-mcp
# Connect to a remote SearXNG instance
SEARXNG_URL=http://YOUR_SEARXNG_HOST:YOUR_SEARXNG_PORT uvx searxng-http-mcp
需要 Python 3.14+ 和现有的 SearXNG 实例。无需 Docker。
⚙️ 环境变量
| 变量 | 默认值 | 说明 |
|---|---|---|
API_KEY | (空,无身份验证) | 用于身份验证的 API 密钥 |
SEARXNG_URL | http://127.0.0.1:8080 | SearXNG 实例 URL(用于 uvx/独立模式) |
🔐 身份验证
设置 API_KEY 后,所有请求都必须使用以下方式之一:
x-api-key请求头——用于 MCP 客户端:x-api-key: your-key- HTTP Basic Auth——用于浏览器
提示
浏览器登录: 使用已启用
API_KEY的 Web UI 时,浏览器会显示登录对话框。用户名留空,并将 API 密钥输入为密码。![]()
未设置 API_KEY 时,所有请求均可公开访问。
🔧 MCP 工具参考
🔍 search — 使用 SearXNG 搜索网络
以保护隐私的方式聚合 200 多个搜索引擎的结果。
| 参数 | 类型 | 必填 | 默认值 | 说明 |
|---|---|---|---|---|
query | string | 是 | — | 要使用的搜索查询 |
categories | string | 否 | "" | 以逗号分隔的类别名称(例如:general,news,science) |
engines | string | 否 | "" | 以逗号分隔的引擎名称(例如:google,arxiv,wikipedia) |
language | string | 否 | "" | 搜索语言代码(例如:en、zh、ja) |
time_range | enum | 否 | null | day、week、month、year |
safesearch | enum | 否 | 0 | 0=关闭,1=适中,2=严格 |
pageno | int ≥1 | 否 | 1 | 起始页码 |
pages | int 1–5 | 否 | 1 | 要并行获取的页数 |
max_results | int 1–100 | 否 | 10 | 要返回的结果数上限 |
format | enum | 否 | compact | compact(标题/URL/内容)或 full(+ 引擎/评分/类别/日期) |
**返回内容:**结果、答案、建议、更正内容和信息框。
💡 autocomplete — 获取搜索查询建议
| 参数 | 类型 | 必填 | 说明 |
|---|---|---|---|
query | string | 是 | 要获取建议的部分查询字符串 |
🗂 engine_info — 查看可用的引擎和类别
无参数。返回按类别分组的已启用引擎列表。
返回内容:
{
"categories": ["general", "images", "videos", "news", ...],
"engines": ["google", "bing", "duckduckgo", ...],
"category_engines": {
"general": ["google", "bing", "duckduckgo", "brave", ...],
"science": ["arxiv", "google scholar", "pubmed", ...],
...
}
}
调用 search 并指定 engines 或 categories 筛选条件之前,可用此工具查看有哪些引擎可用。
🔌 客户端配置
以下是采用标准 mcpServers JSON 结构的服务器模式(远程 HTTP)基础示例。许多客户端接受此结构,但字段名称和必需的 type 值各不相同——请参阅下方的说明,并根据你的客户端进行调整:
{
"mcpServers": {
"searxng": {
"type": "http",
"url": "http://YOUR_HOST:YOUR_PORT/mcp/",
"headers": {
"x-api-key": "your-secret-key"
}
}
}
}
说明
字段名称差异:ZCode 使用
mcp.servers;Kilo Code 使用顶层mcp键并设置"type": "remote";Windsurf 使用serverUrl而不是url;VS Code Copilot 使用顶层servers键;OpenCode 将配置嵌套在mcp下并设置"type": "remote";Codex 和 Hermes 使用mcp_servers(TOML/YAML)。对于 Claude Code,必须设置"type": "http",否则该条目会被视为 stdio 服务并跳过。对于 Cline,远程 HTTP 服务需设置"type": "streamableHttp"。
Claude Desktop
服务器模式 — 编辑 ~/Library/Application Support/Claude/claude_desktop_config.json:
{
"mcpServers": {
"searxng": {
"url": "http://YOUR_HOST:YOUR_PORT/mcp/",
"headers": {
"x-api-key": "your-secret-key"
}
}
}
}
本地模式:
{
"mcpServers": {
"searxng": {
"command": "docker",
"args": ["run", "--rm", "-i", "--memory=512m", "--cpus=1", "ghcr.io/whw23/searxng-http-mcp:latest", "--stdio"]
}
}
}
uvx 模式:
{
"mcpServers": {
"searxng": {
"command": "uvx",
"args": ["searxng-http-mcp"],
"env": { "SEARXNG_URL": "http://YOUR_SEARXNG_HOST:YOUR_SEARXNG_PORT" }
}
}
}
Claude Code
服务器模式(命令行):
claude mcp add --transport http searxng http://YOUR_HOST:YOUR_PORT/mcp/ \
--header "x-api-key: your-secret-key"
服务器模式(JSON) — 同一 mcpServers 结构适用于团队共享项目 .mcp.json 或用户全局配置文件 ~/.claude.json:
{
"mcpServers": {
"searxng": {
"type": "http",
"url": "http://YOUR_HOST:YOUR_PORT/mcp/",
"headers": {
"x-api-key": "your-secret-key"
}
}
}
}
本地模式:
claude mcp add --transport stdio searxng -- docker run --rm -i --memory=512m --cpus=1 ghcr.io/whw23/searxng-http-mcp:latest --stdio
claude mcp add --transport stdio searxng -- uvx searxng-http-mcp
Codex
服务模式 — 添加到 ~/.codex/config.toml:
[mcp_servers.searxng]
url = "http://YOUR_HOST:YOUR_PORT/mcp/"
http_headers = { "x-api-key" = "your-secret-key" }
本地模式:
[mcp_servers.searxng]
command = "docker"
args = ["run", "--rm", "-i", "--memory=512m", "--cpus=1", "ghcr.io/whw23/searxng-http-mcp:latest", "--stdio"]
uvx 模式:
[mcp_servers.searxng]
command = "uvx"
args = ["searxng-http-mcp"]
Cursor
服务模式 — 编辑 .cursor/mcp.json:
{
"mcpServers": {
"searxng": {
"url": "http://YOUR_HOST:YOUR_PORT/mcp/",
"headers": {
"x-api-key": "your-secret-key"
}
}
}
}
本地模式:
{
"mcpServers": {
"searxng": {
"command": "docker",
"args": ["run", "--rm", "-i", "--memory=512m", "--cpus=1", "ghcr.io/whw23/searxng-http-mcp:latest", "--stdio"]
}
}
}
uvx 模式:
{
"mcpServers": {
"searxng": {
"command": "uvx",
"args": ["searxng-http-mcp"],
"env": { "SEARXNG_URL": "http://YOUR_SEARXNG_HOST:YOUR_SEARXNG_PORT" }
}
}
}
VS Code Copilot
服务模式 — 添加到 .vscode/mcp.json:
{
"servers": {
"searxng": {
"type": "http",
"url": "http://YOUR_HOST:YOUR_PORT/mcp/",
"headers": {
"x-api-key": "your-secret-key"
}
}
}
}
本地模式:
{
"servers": {
"searxng": {
"type": "stdio",
"command": "docker",
"args": ["run", "--rm", "-i", "--memory=512m", "--cpus=1", "ghcr.io/whw23/searxng-http-mcp:latest", "--stdio"]
}
}
}
uvx 模式:
{
"servers": {
"searxng": {
"type": "stdio",
"command": "uvx",
"args": ["searxng-http-mcp"],
"env": { "SEARXNG_URL": "http://YOUR_SEARXNG_HOST:YOUR_SEARXNG_PORT" }
}
}
}
Windsurf
服务模式 — 添加到 ~/.codeium/windsurf/mcp_config.json:
{
"mcpServers": {
"searxng": {
"serverUrl": "http://YOUR_HOST:YOUR_PORT/mcp/",
"headers": {
"x-api-key": "your-secret-key"
}
}
}
}
本地模式:
{
"mcpServers": {
"searxng": {
"command": "docker",
"args": ["run", "--rm", "-i", "--memory=512m", "--cpus=1", "ghcr.io/whw23/searxng-http-mcp:latest", "--stdio"]
}
}
}
uvx 模式:
{
"mcpServers": {
"searxng": {
"command": "uvx",
"args": ["searxng-http-mcp"],
"env": { "SEARXNG_URL": "http://YOUR_SEARXNG_HOST:YOUR_SEARXNG_PORT" }
}
}
}
Cline
通过 VS Code 中的 Cline MCP 设置面板配置(Cline > MCP Servers > Add)。
服务模式:
{
"mcpServers": {
"searxng": {
"type": "streamableHttp",
"url": "http://YOUR_HOST:YOUR_PORT/mcp/",
"headers": {
"x-api-key": "your-secret-key"
}
}
}
}
本地模式:
{
"mcpServers": {
"searxng": {
"command": "docker",
"args": ["run", "--rm", "-i", "--memory=512m", "--cpus=1", "ghcr.io/whw23/searxng-http-mcp:latest", "--stdio"]
}
}
}
uvx 模式:
{
"mcpServers": {
"searxng": {
"command": "uvx",
"args": ["searxng-http-mcp"],
"env": { "SEARXNG_URL": "http://YOUR_SEARXNG_HOST:YOUR_SEARXNG_PORT" }
}
}
}
OpenCode
服务模式 — 编辑 opencode.json:
{
"mcp": {
"searxng": {
"type": "remote",
"url": "http://YOUR_HOST:YOUR_PORT/mcp/",
"headers": {
"x-api-key": "your-secret-key"
}
}
}
}
本地模式:
{
"mcp": {
"searxng": {
"type": "local",
"command": ["docker", "run", "--rm", "-i", "--memory=512m", "--cpus=1", "ghcr.io/whw23/searxng-http-mcp:latest", "--stdio"]
}
}
}
uvx 模式:
{
"mcp": {
"searxng": {
"type": "local",
"command": ["uvx", "searxng-http-mcp"]
}
}
}
Hermes Agent
服务模式 — 编辑 ~/.hermes/config.yaml:
mcp_servers:
searxng:
url: "http://YOUR_HOST:YOUR_PORT/mcp/"
headers:
x-api-key: "your-secret-key"
本地模式:
mcp_servers:
searxng:
command: "docker"
args: ["run", "--rm", "-i", "--memory=512m", "--cpus=1", "ghcr.io/whw23/searxng-http-mcp:latest", "--stdio"]
uvx 模式:
mcp_servers:
searxng:
command: "uvx"
args: ["searxng-http-mcp"]
🟦 ZCode(Zhipu AI · GLM)
服务模式 — 编辑 ~/.zcode/cli/config.json(用户范围)或 .zcode/config.json(项目):
{
"mcp": {
"servers": {
"searxng": {
"type": "http",
"url": "http://YOUR_HOST:YOUR_PORT/mcp/",
"headers": {
"x-api-key": "your-secret-key"
}
}
}
}
}
本地模式:
{
"mcp": {
"servers": {
"searxng": {
"command": "docker",
"args": ["run", "--rm", "-i", "--memory=512m", "--cpus=1", "ghcr.io/whw23/searxng-http-mcp:latest", "--stdio"]
}
}
}
}
uvx 模式:
{
"mcp": {
"servers": {
"searxng": {
"command": "uvx",
"args": ["searxng-http-mcp"],
"env": { "SEARXNG_URL": "http://YOUR_SEARXNG_HOST:YOUR_SEARXNG_PORT" }
}
}
}
}
ZCode 也支持标准的 mcpServers 结构(例如在 .agents/mcp.json 中)。或者,也可以通过 Settings → MCP Servers → New MCP Server 添加服务。
⚡ Kilo Code
服务模式 — 编辑 ~/.config/kilo/kilo.jsonc(全局)或 .kilo/kilo.jsonc(项目):
{
"mcp": {
"searxng": {
"type": "remote",
"url": "http://YOUR_HOST:YOUR_PORT/mcp/",
"headers": {
"x-api-key": "your-secret-key"
},
"enabled": true
}
}
}
本地模式:
{
"mcp": {
"searxng": {
"type": "local",
"command": ["docker", "run", "--rm", "-i", "--memory=512m", "--cpus=1", "ghcr.io/whw23/searxng-http-mcp:latest", "--stdio"],
"enabled": true
}
}
}
uvx 模式:
{
"mcp": {
"searxng": {
"type": "local",
"command": ["uvx", "searxng-http-mcp"],
"environment": { "SEARXNG_URL": "http://YOUR_SEARXNG_HOST:YOUR_SEARXNG_PORT" },
"enabled": true
}
}
}
🥧 Pi
安装一次 MCP 适配器,然后添加标准的 mcpServers 块 — 例如在 ~/.pi/agent/mcp.json(所有项目)或 .pi/mcp.json(项目)中:
pi install npm:pi-mcp-adapter
安装后重启 Pi。
服务模式:
{
"mcpServers": {
"searxng": {
"url": "http://YOUR_HOST:YOUR_PORT/mcp/",
"headers": {
"x-api-key": "your-secret-key"
}
}
}
}
本地模式:
{
"mcpServers": {
"searxng": {
"command": "docker",
"args": ["run", "--rm", "-i", "--memory=512m", "--cpus=1", "ghcr.io/whw23/searxng-http-mcp:latest", "--stdio"]
}
}
}
uvx 模式:
{
"mcpServers": {
"searxng": {
"command": "uvx",
"args": ["searxng-http-mcp"],
"env": { "SEARXNG_URL": "http://YOUR_SEARXNG_HOST:YOUR_SEARXNG_PORT" }
}
}
}
🧩 AI 编码 Agent 插件
兼容 Claude Code、GitHub Copilot CLI 和 OpenAI Codex CLI。添加市场,然后安装适合你配置的插件:
/plugin marketplace add whw23/searxng_http_mcp
所有插件均包含:
- 🔍
/web-search-via-searxng技能 — 搜索网络,并提供类别选择指南和使用规则 - 🤖
web-searcherAgent — 用于研究的子 Agent,包含:- 🌐 多语言并行搜索 — 自动检测查询语言,并使用多种语言搜索以扩大覆盖范围
- 🛡 来源可信度分级 — 采用 1/2/3 级分类,并具备 AI 投毒防护
- ✅ 交叉验证 — 关键事实需经 2 个或更多独立来源确认
- 🔍 WebFetch 深度阅读 — 阅读可信来源的完整页面,而不只是摘要
- 🔄 多轮迭代搜索 — 最多进行 3 轮搜索,并在发现缺漏时自动深入
- ⏱ 时效性评估 — 标记过时内容,并注明来源的日期范围
- 📝 脚注式引用 — 结构化输出,并附带行内来源引文
🐍 独立模式 — uvx,无需 Docker,自备 SearXNG
/plugin install searxng-http-mcp-standalone@searxng-http-mcp
通过 uvx 运行。需要 Python 3.14+ 和现有的 SearXNG 实例。在 ~/.claude/settings.json 中设置 SEARXNG_URL:
{
"env": {
"SEARXNG_URL": "http://YOUR_SEARXNG_HOST:YOUR_SEARXNG_PORT"
}
}
🐳 本地模式 — Docker stdio,零配置
/plugin install searxng-http-mcp@searxng-http-mcp
通过 stdio 在本地 Docker 容器中运行 SearXNG。需要安装 Docker。
🌐 远程模式 — 通过 HTTP 连接到已部署的服务
/plugin install searxng-http-mcp-remote@searxng-http-mcp
连接到已部署的 SearXNG MCP 服务。需要环境变量 SEARXNG_MCP_URL 和 SEARXNG_API_KEY。
在 ~/.claude/settings.json 的 env 字段下添加:
{
"env": {
"SEARXNG_MCP_URL": "http://YOUR_HOST:YOUR_PORT/mcp/",
"SEARXNG_API_KEY": "your-api-key"
}
}
然后重启 Claude Code。
🛠 SearXNG 配置
🖥 通过 Web UI
访问 SearXNG Web UI(地址为 http://YOUR_HOST:YOUR_PORT/),配置搜索引擎、语言和其他设置。在容器运行期间,所做更改都会保留。
💾 通过卷挂载 — 持久化配置
挂载 SearXNG 配置目录以持久化配置:
docker run -d --name searxng-mcp --restart unless-stopped \
-p YOUR_PORT:8888 --memory=512m --cpus=1 \
-v /path/to/searxng-config:/etc/searxng \
ghcr.io/whw23/searxng-http-mcp:latest
SearXNG 会在首次启动时生成 settings.yml。容器会自动启用 MCP 工具所需的 JSON 格式输出。
🏗 从源代码构建
git clone https://github.com/whw23/searxng_http_mcp.git
cd searxng_http_mcp
docker build -t searxng-http-mcp:local .
docker run -d --name searxng-mcp --restart unless-stopped \
-p YOUR_PORT:8888 --memory=512m --cpus=1 \
searxng-http-mcp:local
🤝 贡献
完整工作流、CI 要求和开发环境设置,请参阅 CONTRIBUTING.md。
- 🍴 Fork 仓库,并在你的 Fork 中启用 GitHub Actions
- 🌿 从
dev创建功能分支 - ✍️ 进行更改
- ✅ 运行测试:
pytest tests/ -v— 提交 PR 前,CI 必须在你的 Fork 中通过 - 📬 向
dev提交 PR
开发工作在 dev 分支上进行。合并到 main 会触发镜像构建。
📄 许可证
MIT — MCP 服务代码。
SearXNG 本身采用 AGPL-3.0-or-later 许可证。
评论
一个开放协议,规定了 AI 应用如何以统一方式连接外部工具与数据源。客户端负责与模型对话,MCP 服务负责提供工具、资源和提示模板,两者通过标准消息通信,同一个服务可以被不同客户端复用。