Open-WebSearch MCP Server 是一个基于多引擎搜索结果的 Model Context Protocol (MCP) 服务器,支持无需 API 密钥的免费网络搜索,为用户提供便捷的网络信息获取途径。
中文
linux.do 暂时不支持。npm install
npm run build
Cherry Studio:
{
"mcpServers": {
"web-search": {
"name": "Web Search MCP",
"type": "streamableHttp",
"description": "Multi-engine web search with article fetching",
"isActive": true,
"baseUrl": "http://localhost:3000/mcp"
}
}
}
VSCode (Claude Dev Extension):
{
"mcpServers": {
"web-search": {
"transport": {
"type": "streamableHttp",
"url": "http://localhost:3000/mcp"
}
},
"web-search-sse": {
"transport": {
"type": "sse",
"url": "http://localhost:3000/sse"
}
}
}
}
Claude Desktop:
{
"mcpServers": {
"web-search": {
"transport": {
"type": "streamableHttp",
"url": "http://localhost:3000/mcp"
}
},
"web-search-sse": {
"transport": {
"type": "sse",
"url": "http://localhost:3000/sse"
}
}
}
}
使用 Docker Compose 快速部署:
docker-compose up -d
或者直接使用 Docker:
docker run -d --name web-search -p 3000:3000 -e ENABLE_CORS=true -e CORS_ORIGIN=* ghcr.io/aas-ee/open-web-search:latest
环境变量配置:
# 启用 CORS(默认:false)
ENABLE_CORS=true
# CORS 源配置(默认:*)
CORS_ORIGIN=*
# 默认搜索引擎(可选值:bing, duckduckgo, exa, brave,默认:bing)
DEFAULT_SEARCH_ENGINE=duckduckgo
# 启用 HTTP 代理(默认:false)
USE_PROXY=true
# 代理服务器 URL(默认:http://127.0.0.1:10809)
PROXY_URL=http://your-proxy-server:port
# 服务器端口(默认:3000)
PORT=8080
然后在 MCP 客户端中进行配置:
{
"mcpServers": {
"web-search": {
"name": "Web Search MCP",
"type": "streamableHttp",
"description": "Multi-engine web search with article fetching",
"isActive": true,
"baseUrl": "http://localhost:3000/mcp"
},
"web-search-sse": {
"transport": {
"name": "Web Search MCP",
"type": "sse",
"description": "Multi-engine web search with article fetching",
"isActive": true,
"url": "http://localhost:3000/sse"
}
}
}
}
search 工具使用{
"query": string, // 搜索查询
"limit": number, // 可选:返回结果数量(默认:10)
"engines": string[] // 可选:使用的搜索引擎(bing,baidu,linuxdo,csdn,duckduckgo,exa,brave),默认 bing
}
使用示例:
use_mcp_tool({
server_name: "web-search",
tool_name: "search",
arguments: {
query: "search content",
limit: 3, // 可选参数
engines: ["bing", "csdn", "duckduckgo", "exa", "brave"] // 可选参数,支持多引擎组合搜索
}
})
响应示例:
[
{
"title": "Example Search Result",
"url": "https://example.com",
"description": "Description text of the search result...",
"source": "Source",
"engine": "Engine used"
}
]
fetchCsdnArticle 工具使用用于获取 CSDN 博客文章的完整内容。
{
"url": string // 使用 search 工具从 CSDN 搜索结果中获取的 URL
}
使用示例:
use_mcp_tool({
server_name: "web-search",
tool_name: "fetchCsdnArticle",
arguments: {
url: "https://blog.csdn.net/xxx/article/details/xxx"
}
})
响应示例:
[
{
"content": "Example search result"
}
]
fetchLinuxDoArticle 工具使用用于获取 Linux.do 论坛文章的完整内容。
{
"url": string // 使用 search 工具从 linuxdo 搜索结果中获取的 URL
}
使用示例:
use_mcp_tool({
server_name: "web-search",
tool_name: "fetchLinuxDoArticle",
arguments: {
url: "https://xxxx.json"
}
})
响应示例:
[
{
"content": "Example search result"
}
]
由于该工具通过抓取多引擎搜索结果来工作,请注意以下重要限制:
limit 参数。DEFAULT_SEARCH_ENGINE 环境变量设置默认搜索引擎。USE_PROXY=true 启用代理。PROXY_URL 配置代理服务器地址。欢迎提交问题报告和功能改进建议!
如果您想分叉此仓库并发布自己的 Docker 镜像,需要进行以下配置:
为了启用自动 Docker 镜像构建和发布,请在您的 GitHub 仓库设置(Settings → Secrets and variables → Actions)中添加以下密钥:
必需密钥:
GITHUB_TOKEN:由 GitHub 自动提供(无需设置)可选密钥(适用于阿里云 ACR):
ACR_REGISTRY:您的阿里云容器镜像服务 URL(例如,registry.cn-hangzhou.aliyuncs.com)ACR_USERNAME:您的阿里云 ACR 用户名ACR_PASSWORD:您的阿里云 ACR 密码ACR_IMAGE_NAME:您在 ACR 中的镜像名称(例如,your-namespace/open-web-search)该仓库包含一个 GitHub Actions 工作流(.github/workflows/docker.yml),它会自动执行以下操作:
main 分支。v*)。ghcr.io/your-username/open-web-search:latestyour-acr-address/your-image-name:latest(如果配置了 ACR)main 分支或创建版本标签。docker run -d --name web-search -p 3000:3000 -e ENABLE_CORS=true -e CORS_ORIGIN=* ghcr.io/your-username/open-web-search:latest
如果您觉得这个项目有帮助,请考虑给它一个 ⭐ 星标!