SearXNG MCP Server
SearXNG - A2A | AG-UI | MCP
版本: 0.1.56
概述
SearXNG MCP 服务器 + A2A 服务器
它包含一个模型上下文协议 (MCP) 服务器和一个开箱即用的 Agent2Agent (A2A) 代理。
通过 MCP 服务器使用 SearXNG 执行注重隐私的网络搜索!
此存储库处于活跃维护状态 - 欢迎贡献!
支持:
注重隐私的元搜索
可自定义的搜索参数(语言、时间范围、类别、引擎)
安全搜索级别
分页控制
基本身份验证支持
随机实例选择
MCP
MCP 工具
函数名称 | 描述 | 标签 |
| 使用 SearXNG(一个注重隐私的元搜索引擎)执行网络搜索。返回带有可自定义参数的相关网络内容。 |
|
作为 MCP 服务器使用
MCP 服务器可以在两种模式下运行:stdio(用于本地测试)或 http(用于网络访问)。要启动服务器,请使用以下命令:
以 stdio 模式运行(默认):
searxng-mcp --transport "stdio"以 HTTP 模式运行:
searxng-mcp --transport "http" --host "0.0.0.0" --port "8000"AI 提示:
Search for information about artificial intelligenceAI 响应:
Search completed successfully. Found 10 results for "artificial intelligence":
1. **What is Artificial Intelligence?**
URL: https://example.com/ai
Content: Artificial intelligence (AI) refers to the simulation of human intelligence in machines...
2. **AI Overview**
URL: https://example.org/ai-overview
Content: AI encompasses machine learning, deep learning, and more...A2A 代理
此包还包含一个 A2A 代理服务器,可用于与 SearXNG MCP 服务器进行交互。
架构:
---
config:
layout: dagre
---
flowchart TB
subgraph subGraph0["Agent Capabilities"]
C["Agent"]
B["A2A Server - Uvicorn/FastAPI"]
D["MCP Tools"]
F["Agent Skills"]
end
C --> D & F
A["User Query"] --> B
B --> C
D --> E["Platform API"]
C:::agent
B:::server
A:::server
classDef server fill:#f9f,stroke:#333
classDef agent fill:#bbf,stroke:#333,stroke-width:2px
style B stroke:#000000,fill:#FFD600
style D stroke:#000000,fill:#BBDEFB
style F fill:#BBDEFB
style A fill:#C8E6C9
style subGraph0 fill:#FFF9C4组件交互图
sequenceDiagram
participant User
participant Server as A2A Server
participant Agent as Agent
participant Skill as Agent Skills
participant MCP as MCP Tools
User->>Server: Send Query
Server->>Agent: Invoke Agent
Agent->>Skill: Analyze Skills Available
Skill->>Agent: Provide Guidance on Next Steps
Agent->>MCP: Invoke Tool
MCP-->>Agent: Tool Response Returned
Agent-->>Agent: Return Results Summarized
Agent-->>Server: Final Response
Server-->>User: Output使用方法
MCP CLI
短标志 | 长标志 | 描述 |
-h | --help | 显示帮助信息 |
-t | --transport | 传输方式:'stdio', 'http', 或 'sse' [旧版] (默认: stdio) |
-s | --host | HTTP 传输的主机地址 (默认: 0.0.0.0) |
-p | --port | HTTP 传输的端口号 (默认: 8000) |
--auth-type | 身份验证类型:'none', 'static', 'jwt', 'oauth-proxy', 'oidc-proxy', 'remote-oauth' (默认: none) | |
--token-jwks-uri | 用于 JWT 验证的 JWKS URI | |
--token-issuer | 用于 JWT 验证的颁发者 | |
--token-audience | 用于 JWT 验证的受众 | |
--oauth-upstream-auth-endpoint | OAuth 代理的上游授权端点 | |
--oauth-upstream-token-endpoint | OAuth 代理的上游令牌端点 | |
--oauth-upstream-client-id | OAuth 代理的上游客户端 ID | |
--oauth-upstream-client-secret | OAuth 代理的上游客户端密钥 | |
--oauth-base-url | OAuth 代理的基础 URL | |
--oidc-config-url | OIDC 配置 URL | |
--oidc-client-id | OIDC 客户端 ID | |
--oidc-client-secret | OIDC 客户端密钥 | |
--oidc-base-url | OIDC 代理的基础 URL | |
--remote-auth-servers | 远程 OAuth 的授权服务器列表(逗号分隔) | |
--remote-base-url | 远程 OAuth 的基础 URL | |
--allowed-client-redirect-uris | 允许的客户端重定向 URI 列表(逗号分隔) | |
--eunomia-type | Eunomia 授权类型:'none', 'embedded', 'remote' (默认: none) | |
--eunomia-policy-file | 嵌入式 Eunomia 的策略文件 (默认: mcp_policies.json) | |
--eunomia-remote-url | 远程 Eunomia 服务器的 URL |
A2A CLI
端点
Web UI:
http://localhost:8000/(如果已启用)A2A:
http://localhost:8000/a2a(发现:/a2a/.well-known/agent.json)AG-UI:
http://localhost:8000/ag-ui(POST)
短标志 | 长标志 | 描述 | |
-h | --help | 显示帮助信息 | |
--host | 绑定服务器的主机 (默认: 0.0.0.0) | ||
--port | 绑定服务器的端口 (默认: 9000) | ||
--reload | 启用自动重载 | ||
--provider | LLM 提供商:'openai', 'anthropic', 'google', 'huggingface' | ||
--model-id | LLM 模型 ID (默认: nvidia/nemotron-3-super) | ||
--base-url | LLM 基础 URL (适用于 OpenAI 兼容的提供商) | ||
--api-key | LLM API 密钥 | ||
--mcp-url | MCP 服务器 URL (默认: http://localhost:8000/mcp) | ||
--web | 启用 Pydantic AI Web UI | False (环境变量: ENABLE_WEB_UI) |
作为 MCP 服务器使用
MCP 服务器可以在两种模式下运行:stdio(用于本地测试)或 http(用于网络访问)。要启动服务器,请使用以下命令:
以 stdio 模式运行(默认):
searxng-mcp --transport "stdio"以 HTTP 模式运行:
searxng-mcp --transport "http" --host "0.0.0.0" --port "8000"AI 提示:
Search for information about artificial intelligenceAI 响应:
Search completed successfully. Found 10 results for "artificial intelligence":
1. **What is Artificial Intelligence?**
URL: https://example.com/ai
Content: Artificial intelligence (AI) refers to the simulation of human intelligence in machines...
2. **AI Overview**
URL: https://example.org/ai-overview
Content: AI encompasses machine learning, deep learning, and more...代理 AI
searxng-mcp 旨在供代理 AI 系统使用。它提供了一组工具,允许代理使用 SearXNG 进行网络搜索。
代理间通信 (A2A)
此包还包含一个 A2A 代理服务器,可用于与 SearXNG MCP 服务器进行交互。
CLI
参数 | 描述 | 默认 |
| 绑定服务器的主机 |
|
| 绑定服务器的端口 |
|
| 启用自动重载 |
|
| LLM 提供商 (openai, anthropic, google, huggingface) |
|
| LLM 模型 ID |
|
| LLM 基础 URL (适用于 OpenAI 兼容的提供商) |
|
| LLM API 密钥 |
|
| MCP 服务器 URL |
|
| 允许的 MCP 工具列表 |
|
示例
运行 A2A 服务器
searxng-agent --provider openai --model-id gpt-4 --api-key sk-... --mcp-url http://localhost:8000/mcp使用 Docker 运行
docker run -e CMD=searxng-agent -p 8000:8000 searxng-mcpDocker
构建
docker build -t searxng-mcp .运行 MCP 服务器
docker run -p 8000:8000 searxng-mcp运行 A2A 服务器
docker run -e CMD=searxng-agent -p 8001:8001 searxng-mcp将 MCP 服务器部署为服务
ServiceNow MCP 服务器可以使用 Docker 进行部署,并支持可配置的身份验证、中间件和 Eunomia 授权。
使用 Docker Run
docker pull knucklessg1/searxng-mcp:latest
docker run -d \
--name searxng-mcp \
-p 8004:8004 \
-e HOST=0.0.0.0 \
-e PORT=8004 \
-e TRANSPORT=http \
-e AUTH_TYPE=none \
-e EUNOMIA_TYPE=none \
-e SEARXNG_URL=https://searxng.example.com \
-e SEARXNG_USERNAME=user \
-e SEARXNG_PASSWORD=pass \
-e USE_RANDOM_INSTANCE=false \
knucklessg1/searxng-mcp:latest对于高级身份验证(例如 JWT、OAuth 代理、OIDC 代理、远程 OAuth)或 Eunomia,请添加相关的环境变量:
docker run -d \
--name searxng-mcp \
-p 8004:8004 \
-e HOST=0.0.0.0 \
-e PORT=8004 \
-e TRANSPORT=http \
-e AUTH_TYPE=oidc-proxy \
-e OIDC_CONFIG_URL=https://provider.com/.well-known/openid-configuration \
-e OIDC_CLIENT_ID=your-client-id \
-e OIDC_CLIENT_SECRET=your-client-secret \
-e OIDC_BASE_URL=https://your-server.com \
-e ALLOWED_CLIENT_REDIRECT_URIS=http://localhost:*,https://*.example.com/* \
-e EUNOMIA_TYPE=embedded \
-e EUNOMIA_POLICY_FILE=/app/mcp_policies.json \
-e SEARXNG_URL=https://searxng.example.com \
-e SEARXNG_USERNAME=user \
-e SEARXNG_PASSWORD=pass \
-e USE_RANDOM_INSTANCE=false \
knucklessg1/searxng-mcp:latest使用 Docker Compose
创建一个 docker-compose.yml 文件:
services:
searxng-mcp:
image: knucklessg1/searxng-mcp:latest
environment:
- HOST=0.0.0.0
- PORT=8004
- TRANSPORT=http
- AUTH_TYPE=none
- EUNOMIA_TYPE=none
- SEARXNG_URL=https://searxng.example.com
- SEARXNG_USERNAME=user
- SEARXNG_PASSWORD=pass
- USE_RANDOM_INSTANCE=false
ports:
- 8004:8004对于带有身份验证和 Eunomia 的高级设置:
services:
searxng-mcp:
image: knucklessg1/searxng-mcp:latest
environment:
- HOST=0.0.0.0
- PORT=8004
- TRANSPORT=http
- AUTH_TYPE=oidc-proxy
- OIDC_CONFIG_URL=https://provider.com/.well-known/openid-configuration
- OIDC_CLIENT_ID=your-client-id
- OIDC_CLIENT_SECRET=your-client-secret
- OIDC_BASE_URL=https://your-server.com
- ALLOWED_CLIENT_REDIRECT_URIS=http://localhost:*,https://*.example.com/*
- EUNOMIA_TYPE=embedded
- EUNOMIA_POLICY_FILE=/app/mcp_policies.json
- SEARXNG_URL=https://searxng.example.com
- SEARXNG_USERNAME=user
- SEARXNG_PASSWORD=pass
- USE_RANDOM_INSTANCE=false
ports:
- 8004:8004
volumes:
- ./mcp_policies.json:/app/mcp_policies.json运行服务:
docker-compose up -d为 AI 集成配置 mcp.json
{
"mcpServers": {
"searxng": {
"command": "uv",
"args": [
"run",
"--with",
"searxng-mcp",
"searxng-mcp"
],
"env": {
"SEARXNG_URL": "https://searxng.example.com",
"SEARXNG_USERNAME": "user",
"SEARXNG_PASSWORD": "pass",
"USE_RANDOM_INSTANCE": "false"
},
"timeout": 300000
}
}
}安装 Python 包
python -m pip install searxng-mcpuv pip install searxng-mcp存储库所有者
Resources
Unclaimed servers have limited discoverability.
Looking for Admin?
If you are the server author, to access and configure the admin panel.
Tools
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/Knuckles-Team/searxng-mcp'
If you have feedback or need assistance with the MCP directory API, please join our Discord server