Skip to main content
Glama

DuckDuckGo MCP Server

MIT License
320
  • Apple

DuckDuckGo 搜索 MCP 服务器

模型上下文协议 (MCP) 服务器通过 DuckDuckGo 提供网络搜索功能,并具有内容提取和解析的附加功能。

特征

  • 网络搜索:使用 DuckDuckGo 进行高级速率限制和结果格式化搜索
  • 内容获取:通过智能文本提取检索和解析网页内容
  • 速率限制:内置针对搜索和内容获取速率限制的保护
  • 错误处理:全面的错误处理和日志记录
  • LLM 友好输出:专为大型语言模型使用而格式化的结果

安装

通过 Smithery 安装

要通过Smithery自动为 Claude Desktop 安装 DuckDuckGo 搜索服务器:

npx -y @smithery/cli install @nickclyde/duckduckgo-mcp-server --client claude

通过uv安装

使用uv直接从 PyPI 安装:

uv pip install duckduckgo-mcp-server

用法

使用 Claude Desktop 运行

  1. 下载Claude桌面
  2. 创建或编辑您的 Claude Desktop 配置:
    • 在 macOS 上: ~/Library/Application Support/Claude/claude_desktop_config.json
    • 在 Windows 上: %APPDATA%\Claude\claude_desktop_config.json

添加以下配置:

{ "mcpServers": { "ddg-search": { "command": "uvx", "args": ["duckduckgo-mcp-server"] } } }
  1. 重启Claude桌面

发展

对于本地开发,您可以使用 MCP CLI:

# Run with the MCP Inspector mcp dev server.py # Install locally for testing with Claude Desktop mcp install server.py

可用工具

1. 搜索工具

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

在 DuckDuckGo 上执行网络搜索并返回格式化的结果。

参数:

  • query :搜索查询字符串
  • max_results :返回的最大结果数(默认值:10)

**返回:**包含带有标题、URL 和片段的搜索结果的格式化字符串。

2.内容获取工具

async def fetch_content(url: str) -> str

从网页获取并解析内容。

参数:

  • url :获取内容的网页 URL

**返回:**网页中清理并格式化的文本内容。

详细功能

速率限制

  • 搜索:每分钟限制 30 个请求
  • 内容获取:每分钟限制 20 个请求
  • 自动队列管理和等待时间

结果处理

  • 删除广告和不相关的内容
  • 清理 DuckDuckGo 重定向 URL
  • 格式化结果以实现最佳的 LLM 消耗
  • 适当截断长内容

错误处理

  • 全面的错误捕获和报告
  • 通过 MCP 上下文进行详细日志记录
  • 速率限制或超时的优雅降级

贡献

欢迎提交问题和拉取请求!以下是一些有待改进的地方:

  • 附加搜索参数(地区、语言等)
  • 增强的内容解析选项
  • 频繁访问内容的缓存层
  • 额外的速率限制策略

执照

该项目已获得 MIT 许可。

Install Server
A
security – no known vulnerabilities
A
license - permissive license
A
quality - confirmed to work

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.

模型上下文协议 (MCP) 服务器通过 DuckDuckGo 提供网络搜索功能,并具有内容提取和解析的附加功能。

  1. 特征
    1. 安装
      1. 通过 Smithery 安装
      2. 通过uv安装
    2. 用法
      1. 使用 Claude Desktop 运行
      2. 发展
    3. 可用工具
      1. 1. 搜索工具
      2. 2.内容获取工具
    4. 详细功能
      1. 速率限制
      2. 结果处理
      3. 错误处理
    5. 贡献
      1. 执照

        Related MCP Servers

        • A
          security
          A
          license
          A
          quality
          A Model Context Protocol (MCP) server that provides search and crawl functionality using Search1API.
          Last updated -
          5
          719
          143
          TypeScript
          MIT License
          • Apple
        • A
          security
          A
          license
          A
          quality
          This MCP server utilizes DuckDuckGo for web searches, providing structured search results with metadata and features like smart content classification and language detection, facilitating easy integration with AI clients supporting the MCP protocol.
          Last updated -
          1
          251
          2
          JavaScript
          MIT License
        • A
          security
          F
          license
          A
          quality
          An MCP (Model Context Protocol) server that provides Google search capabilities and webpage content analysis tools. This server enables AI models to perform Google searches and analyze webpage content programmatically.
          Last updated -
          3
          34
          80
          TypeScript
        • A
          security
          A
          license
          A
          quality
          A Model Context Protocol server that provides DuckDuckGo search functionality for Claude, enabling web search capabilities through a clean tool interface with rate limiting support.
          Last updated -
          1
          575
          49
          TypeScript
          MIT License
          • Apple

        View all related MCP servers

        MCP directory API

        We provide all the information about MCP servers via our MCP API.

        curl -X GET 'https://glama.ai/api/mcp/v1/servers/nickclyde/duckduckgo-mcp-server'

        If you have feedback or need assistance with the MCP directory API, please join our Discord server