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
# Windows CMD
set MODE=stdio && set DEFAULT_SEARCH_ENGINE=duckduckgo && 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, baidu, csdn, juejin |
默认搜索引擎 |
USE_PROXY |
false |
true, false |
启用HTTP代理 |
PROXY_URL |
http://127.0.0.1:7890 |
任意有效URL | 代理服务器URL |
MODE |
both |
both, http, stdio |
服务器模式:HTTP+STDIO、仅HTTP或仅STDIO |
PORT |
3000 |
1-65535 | 服务器端口 |
ALLOWED_SEARCH_ENGINES |
空(全部可用) | 逗号分隔的引擎名称 | 限制可使用的搜索引擎;如果默认引擎不在此列表中,则第一个允许的引擎将成为默认引擎 |
MCP_TOOL_SEARCH_NAME |
search |
有效的MCP工具名称 | 搜索工具的自定义名称 |
MCP_TOOL_FETCH_LINUXDO_NAME |
fetchLinuxDoArticle |
有效的MCP工具名称 | Linux.do文章获取工具的自定义名称 |
MCP_TOOL_FETCH_CSDN_NAME |
fetchCsdnArticle |
有效的MCP工具名称 | CSDN文章获取工具的自定义名称 |
MCP_TOOL_FETCH_GITHUB_NAME |
fetchGithubReadme |
有效的MCP工具名称 | GitHub README获取工具的自定义名称 |
MCP_TOOL_FETCH_JUEJIN_NAME |
fetchJuejinArticle |
有效的MCP工具名称 | 掘金文章获取工具的自定义名称 |
常见配置:
# 为受限地区启用代理
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扩展):
{
"mcpServers": {
"web-search": {
"transport": {
"type": "streamableHttp",
"url": "http://localhost:3000/mcp"
}
},
"web-search-sse": {
"transport": {
"type": "sse",
"url": "http://localhost:3000/sse"
}
}
}
}

Claude桌面版:
{
"mcpServers": {
"web-search": {
"transport": {
"type": "streamableHttp",
"url": "http://localhost:3000/mcp"
}
},
"web-search-sse": {
"transport": {
"type": "sse",
"url": "http://localhost:3000/sse"
}
}
}
}

NPX命令行配置:
{
"mcpServers": {
"web-search": {
"args": [
"open-websearch@latest"
],
"command": "npx",
"env": {
"MODE": "stdio",
"DEFAULT_SEARCH_ENGINE": "duckduckgo",
"ALLOWED_SEARCH_ENGINES": "duckduckgo,bing,exa"
}
}
}
}

Cherry Studio本地STDIO配置(Windows):
{
"mcpServers": {
"open-websearch-local": {
"command": "node",
"args": ["C:/path/to/your/project/build/index.js"],
"env": {
"MODE": "stdio",
"DEFAULT_SEARCH_ENGINE": "duckduckgo",
"ALLOWED_SEARCH_ENGINES": "duckduckgo,bing,exa"
}
}
}
}

使用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 // 使用search工具从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 // 使用search工具从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"
}
})

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

支持的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配置代理服务器地址欢迎提交问题报告和功能改进建议!
如需fork本仓库并发布自己的Docker镜像,需进行以下配置:
为实现自动Docker镜像构建和发布,请在GitHub仓库设置中添加以下secrets(Settings → 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/你的用户名/open-web-search:latest你的ACR地址/你的镜像名称:latest(如配置ACR)main分支或创建版本标签docker run -d --name web-search -p 3000:3000 -e ENABLE_CORS=true -e CORS_ORIGIN=* ghcr.io/你的用户名/open-web-search:latest
