Skip to main content
Glama
DuckDuckGo MCP Server

DuckDuckGo MCP Server

by artivus-labs

ddg-mcp MCP サーバー

DuckDuckGo 検索 API MCP - モデル コンテキスト プロトコルを通じて DuckDuckGo 検索機能を提供するサーバー。

コンポーネント

プロンプト

サーバーは次のプロンプトを提供します。

  • search-results-summary : DuckDuckGoの検索結果の要約を作成します

    • 検索語句に必要な「クエリ」引数

    • 詳細レベル(簡潔/詳細)を制御するためのオプションの「スタイル」引数

ツール

サーバーは次の DuckDuckGo 検索ツールを実装しています。

  • ddg-text-search : DuckDuckGo を使用してウェブ上のテキスト結果を検索する

    • 必須: 「キーワード」 - 検索クエリのキーワード

    • オプション: 「region」、「safesearch」、「timelimit」、「max_results」

  • ddg-image-search : DuckDuckGo を使用してウェブ上の画像を検索する

    • 必須: 「キーワード」 - 検索クエリのキーワード

    • オプション: "region"、"safesearch"、"timelimit"、"size"、"color"、"type_image"、"layout"、"license_image"、"max_results"

  • ddg-news-search : DuckDuckGoを使ってニュース記事を検索する

    • 必須: 「キーワード」 - 検索クエリのキーワード

    • オプション: 「region」、「safesearch」、「timelimit」、「max_results」

  • ddg-video-search : DuckDuckGoを使って動画を検索する

    • 必須: 「キーワード」 - 検索クエリのキーワード

    • オプション: 「region」、「safesearch」、「timelimit」、「resolution」、「duration」、「license_videos」、「max_results」

  • ddg-ai-chat : DuckDuckGo AIとチャット

    • 必須: 「キーワード」 - AIに送信するメッセージまたは質問

    • オプション: "model" - 使用する AI モデル (オプション: "gpt-4o-mini"、"llama-3.3-70b"、"claude-3-haiku"、"o3-mini"、"mistral-small-3")

Related MCP server: DuckDuckGo MCP Server

インストール

前提条件

  • Python 3.9以上

  • uv (推奨)または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")

    • 例: 「us-en」(アメリカ英語)、「uk-en」(イギリス英語)、「ru-ru」(ロシア語)

    • その他のオプションについては、 DuckDuckGoの地域を参照してください。

  • セーフサーチ: コンテンツフィルタリングレベル(デフォルト:「中程度」)

    • 「オン」: 厳密なフィルタリング

    • 「中程度」:中程度のフィルタリング

    • 「オフ」: フィルタリングなし

  • timelimit : 結果の期間

    • 「d」:最終日

    • 「w」: 先週

    • 「m」:先月

    • 「y」:昨年(ニュース/ビデオでは利用できません)

  • max_results : 返される結果の最大数(デフォルト: 10)

検索演算子

検索キーワードでは次の演算子を使用できます。

  • cats dogs : 猫または犬に関する検索結果

  • "cats and 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 : ページタイトルに「dogs」という単語が含まれている

  • inurl:cats : ページのURLに「cats」という単語が含まれています

画像検索固有のパラメータ

  • サイズ:「小」、「中」、「大」、「壁紙」

  • 色: 「カラー」、「モノクロ」、「赤」、「オレンジ」、「黄」、「緑」、「青」、「紫」、「ピンク」、「茶」、「黒」、「灰色」、「青緑」、「白」

  • type_image : 「写真」、「クリップアート」、「gif」、「透明」、「線」

  • レイアウト:「スクエア」、「トール」、「ワイド」

  • license_image : 「任意」、「公開」、「共有」、「商業的に共有」、「変更」、「商業的に変更」

ビデオ検索固有のパラメータ

  • 解像度:「高」、「標準」

  • 期間:「短い」、「中程度」、「長い」

  • ライセンスビデオ: 「creativeCommon」、「youtube」

AIチャットモデル

  • gpt-4o-mini : OpenAI の GPT-4o mini モデル

  • llama-3.3-70b : Meta の Llama 3.3 70B モデル

  • claude-3-haiku : Anthropic の Claude 3 Haiku モデル

  • o3-mini : OpenAI の O3 mini モデル

  • mistral-small-3 : Mistral AIの小型モデル

クイックスタート

インストール

クロードデスクトップ

MacOS の場合: ~/Library/Application\ Support/Claude/claude_desktop_config.json Windows の場合: %APPDATA%/Claude/claude_desktop_config.json

使用例

テキスト検索

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": { "コマンド": "uv", "引数": [ "--directory", "/PATH/TO/YOUR/INSTALLATION/ddg-mcp", "run", "ddg-mcp" ] },

発達

建築と出版

配布用のパッケージを準備するには:

  1. 依存関係を同期し、ロックファイルを更新します。

uv sync
  1. パッケージディストリビューションをビルドします。

uv build

これにより、 dist/ディレクトリにソースとホイールのディストリビューションが作成されます。

  1. PyPI に公開:

uv publish

注: 環境変数またはコマンド フラグを使用して PyPI 資格情報を設定する必要があります。

  • トークン: --tokenまたはUV_PUBLISH_TOKEN

  • またはユーザー名/パスワード: --username / UV_PUBLISH_USERNAMEおよび--password / UV_PUBLISH_PASSWORD

GitHub Actionsによる自動公開

このリポジトリには、PyPIへの自動公開のためのGitHub Actionsワークフローが含まれています。このワークフローは以下の場合にトリガーされます。

  1. 新しいGitHubリリースが作成される

  2. ワークフローはGitHub Actionsインターフェースを介して手動でトリガーされます

自動公開を設定するには:

  1. PyPI API トークンを生成します:

    • https://pypi.org/manage/account/token/にアクセスしてください。

    • ddg-mcpプロジェクトにスコープを限定した新しいトークンを作成する

    • トークンの値をコピーします(一度だけ表示されます)

  2. トークンを GitHub リポジトリのシークレットに追加します。

    • GitHubのリポジトリにアクセスします

    • 設定 > シークレットと変数 > アクションに移動します

    • 「新しいリポジトリシークレット」をクリックします

    • 名前: PYPI_API_TOKEN

    • 値: PyPIトークンを貼り付けます

    • 「シークレットを追加」をクリック

  3. 新しいバージョンを公開するには:

    • pyproject.tomlのバージョン番号を更新する

    • GitHubで新しいリリースを作成するか、ワークフローを手動でトリガーします

デバッグ

MCPサーバーはstdio経由で実行されるため、デバッグが困難になる場合があります。最適なデバッグ環境を実現するには、 MCP Inspectorの使用を強くお勧めします。

次のコマンドを使用して、 npm経由で MCP Inspector を起動できます。

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

起動すると、ブラウザでアクセスしてデバッグを開始できる URL がインスペクタに表示されます。

Available Tools

5 tools
ddg-ai-chatC

Chat with DuckDuckGo AI

Inputs: keywords (required), model.

Tool Schema Changelog

Recent tool additions, removals, and schema changes observed during successful MCP inspections.

Loading tool schema changelog…

    TDQS

    B3.4/5.0

    Scored across 5 tools

    Disambiguation5/5

    Every tool has a clearly distinct purpose based on media type: chat, images, news, text, and videos. There is no overlap in functionality, making it easy for an agent to select the appropriate tool for each search need.

    Naming Consistency5/5

    All tools follow a consistent 'ddg-[media_type]-search' pattern, with the exception of 'ddg-ai-chat' which still fits the 'ddg-[function]' convention. This uniformity makes the tool set predictable and easy to understand.

    Tool Count5/5

    Five tools is well-scoped for a DuckDuckGo search server, covering key search types (text, image, video, news) plus an AI chat feature. Each tool earns its place without being overwhelming or insufficient.

    Completeness4/5

    The tool set covers major search categories effectively, but there is a minor gap in specialized searches like maps or shopping, which are common in search engines. However, core workflows are well-supported, and agents can work around this limitation.

    Maintenance

    ActivityNo data
    ResponsivenessSyncing

    Related MCP Connectors

    Related MCP Servers

    • A
      license
      A
      quality
      B
      maintenance
      A Model Context Protocol (MCP) server that provides web search capabilities through DuckDuckGo, with additional features for content fetching and parsing.
      3
      20,901 PyPI
      1,584
      MIT
    • A
      license
      B
      quality
      D
      maintenance
      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.
      1
      1,889 npm
      87
      MIT