这是一个通过DuckDuckGo提供网络搜索功能的模型上下文协议(MCP)服务器,并具备内容获取与解析的附加特性。
要自动通过Smithery为Claude Desktop安装DuckDuckGo搜索服务器:
npx -y @smithery/cli install @nickclyde/duckduckgo-mcp-server --client claude
uv
安装直接从PyPI使用uv
安装:
uv pip install duckduckgo-mcp-server
~/Library/Application Support/Claude/claude_desktop_config.json
%APPDATA%\Claude\claude_desktop_config.json
添加以下配置:
{
"mcpServers": {
"ddg-search": {
"command": "uvx",
"args": ["duckduckgo-mcp-server"]
}
}
}

对于本地开发,可以使用MCP CLI:
# 使用MCP检查器运行
mcp dev server.py
# 为Claude Desktop测试安装本地版本
mcp install server.py

async def search(query: str, max_results: int = 10) -> str

在DuckDuckGo上执行网络搜索并返回格式化结果。
参数:
query
:搜索查询字符串max_results
:要返回的最大结果数量(默认值:10)返回值:
包含标题、URL和摘要的格式化搜索结果字符串。
async def fetch_content(url: str) -> str

从网页获取并解析内容。
参数:
url
:要获取内容的网页URL返回值:
清理并格式化的网页文本内容。
欢迎提交问题和拉取请求!一些潜在的改进方向:
本项目采用MIT许可证。