ZD

zhsama/duckduckgo-mcp-server

API 开发

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

87 stars 11 forks 质量 61 趋势 0MIT

zhsama/duckduckgo-mcp-server 是从 https://github.com/zhsama/duckduckgo-mcp-server. 导入的 MCP 服务器候选

概览

zhsama/duckduckgo-mcp-server 是从 https://github.com/zhsama/duckduckgo-mcp-server. 导入的 MCP 服务器候选

概述(AI 翻译)

英文 |中文

DuckDuckGo 搜索的模型上下文协议服务器

这是一个基于 TypeScript 的 MCP 服务器,提供 DuckDuckGo 搜索功能。它通过以下方式演示了核心 MCP 概念:

  • 与 DuckDuckGo 搜索的集成
  • 易用的搜索工具界面
  • 速率限制和错误处理支持

特色

搜索工具

  • duckduckgo_search - 使用 DuckDuckGo API 进行网页搜索
  • 所需参数:query(搜索查询,最大400字符)
  • 可选参数:count(结果数,1-20,默认10)
  • 可选参数:safeSearch(安全级别:严格/中等/关闭,默认中等)
  • 返回格式化的Markdown搜索结果

速率限制

  • 每秒最多1个请求
  • 每月最多15000次请求

发展

先决条件

  • Node.js >= 18
  • PNPM >= 8.0.0

安装

建造并奔跑

搭建服务器:

关于自动重建的开发:

在 Claude Desktop 中的设置

要配合Claude Desktop使用,添加服务器配置:

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

调试

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

README

duckduckgo-search MCP Server

English | 中文

A Model Context Protocol server for DuckDuckGo Search

This is a TypeScript-based MCP server that provides DuckDuckGo search functionality. It demonstrates core MCP concepts through:

  • Integration with DuckDuckGo Search
  • Easy-to-use search tool interface
  • Rate limiting and error handling support

Features

Search Tool

  • duckduckgo_search - Perform web searches using DuckDuckGo API
    • Required parameter: query (search query, max 400 characters)
    • Optional parameter: count (number of results, 1-20, default 10)
    • Optional parameter: safeSearch (safety level: strict/moderate/off, default moderate)
    • Returns formatted Markdown search results

Rate Limits

  • Maximum 1 request per second
  • Maximum 15000 requests per month

Development

Prerequisites

  • Node.js >= 18
  • pnpm >= 8.0.0

Installation

# Install pnpm if not already installed
npm install -g pnpm

# Install project dependencies
pnpm install

Build and Run

Build the server:

pnpm run build

For development with auto-rebuild:

pnpm run watch

Setup in Claude Desktop

To use with Claude Desktop, add the server config:

On MacOS: ~/Library/Application Support/Claude/claude_desktop_config.json On Windows: %APPDATA%/Claude/claude_desktop_config.json

# online
{
  "mcpServers": {
    "duckduckgo-search": {
        "command": "npx",
        "args": [
          "-y",
          "duckduckgo-mcp-server"
        ]
    }
  }
}

# local
{
  "mcpServers": {
    "duckduckgo-search": {
      "command": "node",
      "args": [
        "/path/to/duckduckgo-search/build/index.js"
      ]
    }
  }
}

Debugging

Since MCP servers communicate over stdio, debugging can be challenging. We recommend using the MCP Inspector, which is available as a package script:

pnpm run inspector

The Inspector will provide a URL to access debugging tools in your browser.

在 GitHub 查看完整 README

安装

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

配置

# online { "mcpServers": { "duckduckgo-search": { "command": "npx", "args": [ "-y", "duckduckgo-mcp-server" ] } } } # local { "mcpServers": { "duckduckgo-search": { "command": "node", "args": [ "/path/to/duckduckgo-search/build/index.js" ] } } }