MCP DuckDuckGo Search Server

by spences10
Verified

remote-capable server

The server can be hosted and run remotely because it primarily relies on remote services or has no dependency on the local environment.

Integrations

  • Allows web search functionality using the DuckDuckGo search engine, providing knowledge graph information, organic search results, news articles, video content, image results, and related searches with support for region-specific search, safe search levels, and date-based filtering

mcp-duckduckgo-搜索


⚠️ 通知

此存储库不再维护。

该工具的功能现已在mcp-omnisearch中提供,它将多个 MCP 工具组合在一个统一的包中。

请改用mcp-omnisearch


一个模型上下文协议 (MCP) 服务器,用于将 DuckDuckGo 搜索功能与 LLM 集成。该服务器提供全面的 Web 搜索功能,支持各种结果类型和过滤选项。

特征

  • 🔍 使用 DuckDuckGo 的搜索引擎进行全面的网络搜索
  • 📊 丰富的结果类型包括:
    • 知识图谱信息
    • 自然搜索结果
    • 新闻文章
    • 视频内容
    • 图像结果
    • 相关搜索
  • 🌍 特定区域搜索支持
  • 🛡️可配置的安全搜索级别
  • 📅 基于日期的过滤选项
  • 📄 分页支持
  • 💾 内置结果缓存
  • 🔒 安全搜索选项(关闭、中等、严格)

配置

此服务器需要通过您的 MCP 客户端进行配置。以下是不同环境的示例:

克莱恩配置

将其添加到您的 Cline MCP 设置中:

{ "mcpServers": { "mcp-duckduckgo-search": { "command": "npx", "args": ["-y", "mcp-duckduckgo-search"], "env": { "SERPAPI_KEY": "your-serpapi-api-key" } } } }

带有 WSL 配置的 Claude 桌面

对于 WSL 环境,将其添加到您的 Claude Desktop 配置中:

{ "mcpServers": { "mcp-duckduckgo-search": { "command": "wsl.exe", "args": [ "bash", "-c", "source ~/.nvm/nvm.sh && SERPAPI_KEY=your-serpapi-api-key /home/username/.nvm/versions/node/v20.12.1/bin/npx mcp-duckduckgo-search" ] } } }

环境变量

服务器需要以下环境变量:

  • SERPAPI_KEY :您的 SerpAPI 密钥(必需)

API

服务器实现了具有可配置参数的单个 MCP 工具:

ddg_搜索

使用 DuckDuckGo 搜索引擎执行网络搜索。

参数:

  • query (字符串,必需):搜索查询
  • region (字符串,可选):区域代码(例如,us-en,uk-en)(默认值:us-en)
  • safe_search (字符串,可选):安全搜索级别(关闭,中等,严格)(默认值:中等)
  • date_filter (字符串,可选):按日期过滤结果:
    • ‘d’:过去一天
    • 'w':过去一周
    • ‘m’:上个月
    • ‘y’:去年
    • 自定义范围:'2023-01-01..2023-12-31'
  • start (数字,可选):分页的结果偏移量
  • no_cache (布尔值,可选):绕过缓存获取新结果(默认值:false)

响应包括:

  • 知识图谱数据(可用时)
  • 自然搜索结果
  • 新闻文章
  • 视频内容
  • 图像结果
  • 相关搜索
  • 搜索元数据

发展

设置

  1. 克隆存储库
  2. 安装依赖项:
pnpm install
  1. 构建项目:
pnpm build
  1. 以开发模式运行:
pnpm dev

出版

该项目使用变更集进行版本管理。要发布:

  1. 创建变更集:
pnpm changeset
  1. 对包进行版本控制:
pnpm changeset version
  1. 发布到 npm:
pnpm release

贡献

欢迎贡献代码!欢迎提交 Pull 请求。

执照

MIT 许可证 - 有关详细信息,请参阅LICENSE文件。

致谢

-
security - not tested
A
license - permissive license
-
quality - not tested

支持与 LLM 的 DuckDuckGo 搜索功能集成,支持全面的网络搜索、区域过滤、结果类型以及具有缓存和可自定义搜索参数的安全浏览。

  1. ⚠️ Notice
    1. Features
      1. Configuration
        1. Cline Configuration
        2. Claude Desktop with WSL Configuration
        3. Environment Variables
      2. API
        1. ddg_search
      3. Development
        1. Setup
        2. Publishing
      4. Contributing
        1. License
          1. Acknowledgments
            ID: v99lwtriyk