DuckDuckGo MCP Server

Integrations

  • Provides search capabilities through tools for text, image, news, and video searches using DuckDuckGo's API, plus access to DuckDuckGo's AI chat with multiple model options.

  • Provides access to Meta's Llama 3.3 70B model through the DuckDuckGo AI chat tool.

  • Enables interaction with OpenAI's models (GPT-4o-mini and O3-mini) through the DuckDuckGo AI chat tool.

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")

インストール

前提条件

  • 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 がインスペクタに表示されます。

-
security - not tested
F
license - not found
-
quality - not tested

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.

モデルコンテキスト プロトコルを通じて DuckDuckGo 検索機能 (テキスト、画像、ニュース、ビデオ検索、AI チャット) を提供するサーバー。

  1. Components
    1. Prompts
    2. Tools
  2. Installation
    1. Prerequisites
    2. Install from PyPI
    3. Install from Source
  3. Configuration
    1. Required Dependencies
  4. DuckDuckGo Search Parameters
    1. Common Parameters
    2. Search Operators
    3. Image Search Specific Parameters
    4. Video Search Specific Parameters
    5. AI Chat Models
  5. Quickstart
    1. Install
  6. Usage Examples
    1. Text Search
    2. Image Search
    3. News Search
    4. Video Search
    5. AI Chat
    6. Search Results Summary
  7. Claude config
    1. Development
      1. Building and Publishing
      2. Automated Publishing with GitHub Actions
      3. Debugging
    ID: 6u224dm69g