Token导航 LogoToken导航TokenDH.com
DuckDuckGo MCP Server logo
搜索检索stdio官方级别未说明来源级核验

DuckDuckGo MCP Server

MCP Server

DuckDuckGo search API MCP server

工具数

5

提示词数

0

GitHub Stars

8

资源数

0
PythonClaude搜索Claude

安装说明

本站只整理中文说明和来源信息,不托管安装包,也不代用户安装。

作者 / 组织

misanthropic-ai

提供方

misanthropic-ai

最后核验

2026/5/18 02:15

运行时

Python

快速接入

先看主来源和安装命令,再打开仓库或文档;下面只保留这个条目的关键接入事实。

命令预览

pip install ddg-mcp

详细介绍

ddg-mcp-mcp服务器

DuckDuckGo搜索API MCP-通过模型上下文协议提供DuckDuck Go搜索功能的服务器。

组件

鼓励

服务器提供以下提示:

  • 搜索结果摘要:创建DuckDuckGo搜索结果摘要

- 搜索词的必填“query”参数 - 可选的“style”参数,用于控制详细程度(简短/详细)

工具

服务器实现了以下DuckDuckGo搜索工具:

  • ddg文本搜索:使用DuckDuckGo在网上搜索文本结果

- 必填项:“关键字”-搜索查询关键字 - 可选:“区域”、“安全搜索”、“时间限制”、“max_results”

  • ddg图像搜索:使用DuckDuckGo在网上搜索图像

- 必填项:“关键字”-搜索查询关键字 - 可选:“区域”、“安全搜索”、“时间限制”、“大小”、“颜色”、“类型_图像”、“布局”、“许可证_图像”和“max_results”

  • ddg新闻搜索:使用DuckDuckGo搜索新闻文章

- 必填项:“关键字”-搜索查询关键字 - 可选:“区域”、“安全搜索”、“时间限制”、“max_results”

  • ddg视频搜索:使用DuckDuckGo搜索视频

- 必填项:“关键字”-搜索查询关键字 - 可选:“区域”、“安全搜索”、“时间限制”、“分辨率”、“持续时间”、“license_videos”、“max_results”

  • ddg-ai聊天:与DuckDuckGo AI聊天

- 必填:“关键字”-要发送给AI的消息或问题 - 可选:“模型”-要使用的AI模型(选项:“gpt-4o-mini”、“llama-3.3-70b”、“claude-3-haiku”、“o3-mini”、“mistral-small-3”)

安装

先决条件

  • Python 3.9或更高版本
  • 紫外线 (推荐)或pip

从PyPI安装

# Using uv
uv install ddg-mcp

# Using pip
pip install ddg-mcp

从源代码安装

  1. 克隆存储库:
git clone https://github.com/misanthropic-ai/ddg-mcp.git
cd ddg-mcp
  1. 安装软件包:
# Using uv
uv install -e .

# Using pip
pip install -e .

配置

所需依赖关系

服务器需要 duckduckgo-search 软件包,安装时会自动安装 ddg-mcp.

如果需要手动安装:

uv install duckduckgo-search
# or
pip install duckduckgo-search

DuckDuckGo搜索参数

公共参数

这些参数适用于大多数搜索类型:

  • 区域:本地化结果的区域代码(默认值:“wt wt”)

- Examples: "us-en" (US English), "uk-en" (UK English), "ru-ru" (Russian) - 看 DuckDuckGo地区 更多选项

  • 安全搜索:内容过滤级别(默认:“中等”)

- “on”:严格筛选 - “中等”:中等过滤 - “关闭”:无过滤

  • 时间限制:结果的时间范围

- “d”:最后一天 - “w”:上周 - “m”:上个月 - “y”:去年(不适用于新闻/视频)

  • max_results:要返回的最大结果数(默认值:10)

搜索运算符

您可以在搜索关键字中使用这些运算符:

  • cats dogs:关于猫或狗的结果
  • "cats and dogs":准确术语“猫和狗”的结果
  • cats -dogs:结果显示狗的数量减少
  • cats +dogs:结果中有更多的狗
  • cats filetype:pdf:关于猫的pdf文件(支持:pdf、doc(x)、xls(x),ppt(x)和html)
  • dogs site:example.com:example.com上关于狗的页面
  • cats -site:example.com:关于猫的页面,不包括example.com
  • intitle:dogs:页面标题包含单词“狗”
  • inurl:cats:页面URL包含单词“cats”

图像搜索特定参数

  • 尺寸:“小”、“中”、“大”、“壁纸”
  • 颜色:“彩色”、“单色”、“红色”、“橙色”、“黄色”、“绿色”、“蓝色”、“紫色”、“粉色”、“棕色”、“黑色”、“灰色”、“青色”、“白色”
  • 类型_图像:“照片”、“剪贴画”、“gif”、“透明”、“线条”
  • 布局:“方形”、“高”、“宽”
  • license_image:“任何”、“公开”、“股份”、“商业性共享”、“修改”、“以商业方式修改”

视频搜索特定参数

  • 决心:“高”、“标准”
  • 持续时间:“短”、“中”、“长”
  • 许可证_视频:“creativeCommon”、“youtube”

AI聊天模型

  • gpt-4o-mini:OpenAI的GPT-4o迷你模型
  • 火焰-3.3-70b:Meta's Calma 3.3 70b型号
  • claude-3-俳句:Anthropic的Claude 3 Haiku模型
  • o3迷你:OpenAI的O3迷你模型
  • mistral-small-3:Mistral AI的小型模型

快速启动

安装

克劳德桌面

在MacOS上: ~/Library/Application\ Support/Claude/claude_desktop_config.json 在Windows上: %APPDATA%/Claude/claude_desktop_config.json

Development/Unpublished Servers Configuration

  "mcpServers": {
    "ddg-mcp": {
      "command": "uv",
      "args": [
        "--directory",
        "/Users/shannon/Workspace/artivus/ddg-mcp",
        "run",
        "ddg-mcp"
      ]
    }
  }

Published Servers Configuration

  "mcpServers": {
    "ddg-mcp": {
      "command": "uvx",
      "args": [
        "ddg-mcp"
      ]
    }
  }

使用示例

文本搜索

Use the ddg-text-search tool to search for "climate change solutions"

高级示例:

Use the ddg-text-search tool to search for "renewable energy filetype:pdf site:edu" with region "us-en", safesearch "off", timelimit "y", and max_results 20

图像搜索

Use the ddg-image-search tool to find images of "renewable energy" with color set to "Green"

高级示例:

Use the ddg-image-search tool to find images of "mountain landscape" with size "Large", color "Blue", type_image "photo", layout "Wide", and license_image "Public"

新闻搜索

Use the ddg-news-search tool to find recent news about "artificial intelligence" from the last day

高级示例:

Use the ddg-news-search tool to search for "space exploration" with region "uk-en", timelimit "w", and max_results 15

视频搜索

Use the ddg-video-search tool to find videos about "machine learning tutorials" with duration set to "medium"

高级示例:

Use the ddg-video-search tool to search for "cooking recipes" with resolution "high", duration "short", license_videos "creativeCommon", and max_results 10

AI聊天

Use the ddg-ai-chat tool to ask "What are the latest developments in quantum computing?" using the claude-3-haiku model

搜索结果摘要

Use the search-results-summary prompt with query "space exploration" and style "detailed"

克劳德配置

“ddg-mcp”:{ “command”:“uv”, “args”:\[ “--目录”, “/PATH/TO/YOUR/INSTALLATION/ddg-mcp”, “运行”, “ddg-mcp” \] },

发展

建筑与出版

准备分发包裹:

  1. 同步依赖关系并更新锁文件:
uv sync
  1. 构建包分发:
uv build

这将在 dist/ 目录。

  1. 发布到PyPI:
uv publish

注意:您需要通过环境变量或命令标志设置PyPI凭据:

  • 令牌: --tokenUV_PUBLISH_TOKEN
  • 或用户名/密码: --username/UV_PUBLISH_USERNAME--password/UV_PUBLISH_PASSWORD

使用GitHub操作自动发布

此存储库包含一个GitHub Actions工作流,用于自动发布到PyPI。工作流在以下情况下触发:

  1. 创建了一个新的GitHub版本
  2. 工作流通过GitHub Actions界面手动触发

要设置自动发布,请执行以下操作:

  1. 生成PyPI API令牌:

- 首选https://pypi.org/manage/account/token/ - 创建一个范围仅限于的新令牌 ddg-mcp 项目 - 复制令牌值(您只会看到一次)

  1. 将令牌添加到您的GitHub存储库机密中:

- 转到GitHub上的存储库 - 导航到“设置”>“秘密和变量”>“操作” - 点击“新建存储库密钥” - 姓名: PYPI_API_TOKEN - 值:粘贴您的PyPI令牌 - 点击“添加秘密”

  1. 要发布新版本,请执行以下操作:

- 更新中的版本号 pyproject.toml - 在GitHub上创建新版本或手动触发工作流

调试

由于MCP服务器在stdio上运行,调试可能具有挑战性。为了达到最佳调试效果 经验,我们强烈建议使用 MCP检查员.

您可以通过以下方式启动MCP检查器 使用此命令:

npx @modelcontextprotocol/inspector uv --directory /path/to/your/ddg-mcp run ddg-mcp

启动后,检查器将显示一个URL,您可以在浏览器中访问该URL以开始调试。

目录标签

目录标签

PythonClaude搜索research-and-data搜索API本地部署DuckDuckGo文本搜索图片搜索新闻搜索视频搜索

支持客户端

Claude

接入字段

传输方式(transport,传输协议)

stdio

鉴权方式(authType,认证方式)

none

运行时(runtime,运行环境)

Python

部署方式(deploymentType,部署类型)

remote-capable

工具数量(toolCount,工具数)

5

资源数量(resourceCount,资源数)

0

提示词数量(promptCount,提示词数)

0

权限和风险

stdiononeremote-capable

接入前请确认传输方式、认证方式和部署位置,并根据实际工具能力限制访问范围。

安装前确认

不要直接授予不必要的文件、网络或账号权限;先核对安装命令和配置内容。

来源信息

继续浏览同类 MCP