OpenWebSearch网络搜索MCP添加福利群:解决AI开发者的「MCP实战痛点」一个基于多引擎搜索结果的模型上下文协议(MCP)服务器,支持无需API密钥的免费网络搜索。
最快的方式开始使用:
# 基本用法
npx open-websearch@latest
# 带环境变量(Linux/macOS)
DEFAULT_SEARCH_ENGINE=duckduckgo ENABLE_CORS=true npx open-websearch@latest
# Windows PowerShell
$env:DEFAULT_SEARCH_ENGINE="duckduckgo"; $env:ENABLE_CORS="true"; npx open-websearch@latest
# 跨平台(需要 cross-env,用于本地开发)
npm install -g open-websearch
npx cross-env DEFAULT_SEARCH_ENGINE=duckduckgo ENABLE_CORS=true open-websearch

环境变量:
| 变量 | 默认值 | 选项 | 描述 |
|---|---|---|---|
ENABLE_CORS |
false |
true, false |
启用CORS |
CORS_ORIGIN |
* |
任何有效的来源 | CORS来源配置 |
DEFAULT_SEARCH_ENGINE |
bing |
bing, duckduckgo, exa, brave |
默认搜索引擎 |
USE_PROXY |
false |
true, false |
启用HTTP代理 |
PROXY_URL |
http://127.0.0.1:7890 |
任何有效的URL | 代理服务器URL |
PORT |
3000 |
1-65535 | 服务器端口 |
常见配置:
# 为受限区域启用代理
USE_PROXY=true PROXY_URL=http://127.0.0.1:7890 npx open-websearch@latest
# 完整配置
DEFAULT_SEARCH_ENGINE=duckduckgo ENABLE_CORS=true USE_PROXY=true PROXY_URL=http://127.0.0.1:7890 PORT=8080 npx open-websearch@latest

npm install
npm run build
Cherry Studio:
{
"mcpServers": {
"web-search": {
"name": "Web Search MCP",
"type": "streamableHttp",
"description": "多引擎网络搜索与文章获取",
"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

环境变量配置:
| 变量 | 默认值 | 选项 | 描述 |
|---|---|---|---|
ENABLE_CORS |
false |
true, false |
启用CORS |
CORS_ORIGIN |
* |
任何有效的来源 | CORS来源配置 |
DEFAULT_SEARCH_ENGINE |
bing |
bing, duckduckgo, exa, brave |
默认搜索引擎 |
USE_PROXY |
false |
true, false |
启用HTTP代理 |
PROXY_URL |
http://127.0.0.1:7890 |
任何有效的URL | 代理服务器URL |
PORT |
3000 |
1-65535 | 服务器端口 |
然后在您的MCP客户端中配置:
{
"mcpServers": {
"web-search": {
"name": "Web Search MCP",
"type": "streamableHttp",
"description": "多引擎网络搜索与文章获取",
"isActive": true,
"baseUrl": "http://localhost:3000/mcp"
},
"web-search-sse": {
"transport": {
"name": "Web Search MCP",
"type": "sse",
"description": "多引擎网络搜索与文章获取",
"isActive": true,
"url": "http://localhost:3000/sse"
}
}
}
}

服务器提供四种工具:search、fetchLinuxDoArticle、fetchCsdnArticle 和 fetchGithubReadme。
{
"query": string, // 搜索查询
"limit": number, // 可选:返回结果数量(默认:10)
"engines": string[] // 可选:使用的引擎(bing,baidu,linuxdo,csdn,duckduckgo,exa,brave,juejin)默认 bing
}

使用示例:
use_mcp_tool({
server_name: "web-search",
tool_name: "search",
arguments: {
query: "搜索内容",
limit: 3, // 可选参数
engines: ["bing", "csdn", "duckduckgo", "exa", "brave", "juejin"] // 可选参数,支持多引擎组合搜索
}
})

响应示例:
[
{
"title": "示例搜索结果",
"url": "https://example.com",
"description": "搜索结果描述文本...",
"source": "来源",
"engine": "使用的引擎"
}
]

用于获取CSDN博客文章的完整内容。
{
"url": string // 使用搜索工具从CSDN搜索结果中获取的URL
}

使用示例:
use_mcp_tool({
server_name: "web-search",
tool_name: "fetchCsdnArticle",
arguments: {
url: "https://blog.csdn.net/xxx/article/details/xxx"
}
})

响应示例:
[
{
"content": "示例搜索结果"
}
]

用于获取Linux.do论坛文章的完整内容。
{
"url": string // 使用搜索工具从linuxdo搜索结果中获取的URL
}

使用示例:
use_mcp_tool({
server_name: "web-search",
tool_name: "fetchLinuxDoArticle",
arguments: {
url: "https://xxxx.json"
}
})

响应示例:
[
{
"content": "示例搜索结果"
}
]

用于获取GitHub仓库的README内容。
{
"url": string // GitHub仓库URL(支持HTTPS、SSH格式)
}

使用示例:
use_mcp_tool({
server_name: "web-search",
tool_name: "fetchGithubReadme",
arguments: {
url: "https://github.com/Aas-ee/open-webSearch"
}
})

支持的URL格式:
https://github.com/owner/repohttps://github.com/owner/repo.gitgit@github.com:owner/repo.githttps://github.com/owner/repo?tab=readme响应示例:
[
{
"content": "<div align=\"center\">\n\n# Open-WebSearch MCP 服务器..."
}
]

用于获取掘金文章的完整内容。
{
"url": string // 从搜索结果中获取的掘金文章URL
}

使用示例:
use_mcp_tool({
server_name: "web-search",
tool_name: "fetchJuejinArticle",
arguments: {
url: "https://juejin.cn/post/7520959840199360563"
}
})

支持的URL格式:
https://juejin.cn/post/{文章ID}响应示例:
[
{
"content": "🚀 开源 AI 联网搜索工具:Open-WebSearch MCP 全新升级,支持多引擎 + 流式响应..."
}
]

由于此工具通过抓取多引擎搜索结果工作,请注意以下重要限制:
速率限制:
结果准确性:
法律条款:
搜索引擎配置:
DEFAULT_SEARCH_ENGINE 环境变量设置代理配置:
USE_PROXY=true 启用代理PROXY_URL 配置代理服务器地址欢迎提交问题报告和功能改进建议!
如果你想分叉此仓库并发布自己的Docker镜像,需要进行以下配置:
为了启用自动Docker镜像构建和发布,请在您的GitHub仓库设置中添加以下secrets(设置 → Secrets and variables → Actions):
必需的Secrets:
GITHUB_TOKEN: 由GitHub自动提供(无需设置)可选的Secrets(用于阿里云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
