ND

nickclyde/duckduckgo-mcp-server

开发工具

本页由 AI 翻译,技术细节请以原文为准。 查看原文

1566 stars 196 forks 质量 84 趋势 35MIT

一台模型上下文协议(MCP)服务器,通过 DuckDuckGo 提供网页搜索功能,并具备内容获取和解析的额外功能。

概览

一台模型上下文协议(MCP)服务器,通过 DuckDuckGo 提供网页搜索功能,并具备内容获取和解析的额外功能。 - : 搜索 DuckDuckGo,具备高级速率限制和结果格式 - : 通过智能文本提取检索和解析网页内容 - : 内置对速率限制的搜索和内容获取保护 - : 全面的错误处理和日志记录 - : 结果专门为大型语言模型存储格式化 1. 下载 Claude 桌面 2.创建或编辑您的 Claude 桌面配置:- 在 macOS 上:~/Library/Application Support/Claude/claude_desktop_config.json - 在 Windows 上:%APPDATA%\Claude\claude_desktop_config。

概述(AI 翻译)

一台模型上下文协议(MCP)服务器,通过 DuckDuckGo 提供网页搜索功能,并具备内容获取和解析的额外功能。

快速启动

特色

  • 网页搜索:搜索DuckDuckGo,支持高级速率限制和结果格式
  • 内容获取:利用智能文本提取技术检索和解析网页内容
  • 长URL缩短:过长的结果URL会变成短的ref://令牌,fetch_content直接接受,从而节省上下文
  • 速率限制:内置对搜索和内容获取速率限制的保护
  • 错误处理:全面的错误处理与日志记录
  • LLM 友好输出:专门为大型语言模型使用格式化的结果

安装

使用 uv 从 PyPI 安装:

用途

用Claude桌面运行

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

添加以下配置:

基础配置(无安全搜索,无默认区域):

本页由 AI 翻译,技术细节请以原文为准。

README

以下为原文 README 节选,完整内容请查看原文。

DuckDuckGo Search MCP Server

A Model Context Protocol (MCP) server that provides web search capabilities through DuckDuckGo, with additional features for content fetching and parsing.

Quick Start

uvx duckduckgo-mcp-server

Features

  • Web Search: Search DuckDuckGo with advanced rate limiting and result formatting
  • Content Fetching: Retrieve and parse webpage content with intelligent text extraction
  • Long URL Shortening: Over-long result URLs become short ref:// tokens that fetch_content accepts directly, saving context
  • Rate Limiting: Built-in protection against rate limits for both search and content fetching
  • Error Handling: Comprehensive error handling and logging
  • LLM-Friendly Output: Results formatted specifically for large language model consumption

Installation

Install from PyPI using uv:

uv pip install duckduckgo-mcp-server

Usage

Running with Claude Desktop

  1. Download Claude Desktop
  2. Create or edit your Claude Desktop configuration:
    • On macOS: ~/Library/Application Support/Claude/claude_desktop_config.json
    • On Windows: %APPDATA%\Claude\claude_desktop_config.json

Add the following configuration:

Basic Configuration (No SafeSearch, No Default Region):

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

With SafeSearch and Region Configuration:

{
    "mcpServers": {
        "ddg-search": {
            "command": "uvx",
            "args": ["duckduckgo-mcp-server"],
            "env": {
                "DDG_SAFE_SEARCH": "STRICT",
                "DDG_REGION": "cn-zh"
            }
        }
    }
}

Configuration Options:

  • DDG_SAFE_SEARCH: SafeSearch filtering level (optional)
    • STRICT: Maximum content filtering (kp=1)
    • MODERATE: Balanced filtering (kp=-1, default if not specified)
    • OFF: No content filtering (kp=-2)
  • DDG_REGION: Default region/language code (optional, examples below)
    • us-en: United States (English)
    • cn-zh: China (Chinese)
    • jp-ja: Japan (Japanese)
    • wt-wt: No specific region
    • Leave empty for DuckDuckGo’s default behavior
  • DDG_CA_CERTS: Path to a PEM CA bundle used to verify TLS certificates on outbound requests (optional). Needed behind TLS-intercepting proxies — see Running behind a TLS-intercepting proxy.
在 GitHub 查看完整 README

安装

uvx duckduckgo-mcp-server
新手?先看 mcpskill.org 教程 →

配置

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