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ソースからインストール
リポジトリをクローンします。
git clone https://github.com/misanthropic-ai/ddg-mcp.git
cd ddg-mcpパッケージをインストールします。
# Using uv
uv install -e .
# Using pip
pip install -e .構成
必要な依存関係
サーバーにはduckduckgo-searchパッケージが必要です。これはddg-mcpをインストールすると自動的にインストールされます。
手動でインストールする必要がある場合:
uv install duckduckgo-search
# or
pip install duckduckgo-searchDuckDuckGo 検索パラメータ
共通パラメータ
これらのパラメータはほとんどの検索タイプで使用できます。
地域: ローカライズされた結果の地域コード(デフォルト: "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 10AIチャット
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" ] },
発達
建築と出版
配布用のパッケージを準備するには:
依存関係を同期し、ロックファイルを更新します。
uv syncパッケージディストリビューションをビルドします。
uv buildこれにより、 dist/ディレクトリにソースとホイールのディストリビューションが作成されます。
PyPI に公開:
uv publish注: 環境変数またはコマンド フラグを使用して PyPI 資格情報を設定する必要があります。
トークン:
--tokenまたはUV_PUBLISH_TOKENまたはユーザー名/パスワード:
--username/UV_PUBLISH_USERNAMEおよび--password/UV_PUBLISH_PASSWORD
GitHub Actionsによる自動公開
このリポジトリには、PyPIへの自動公開のためのGitHub Actionsワークフローが含まれています。このワークフローは以下の場合にトリガーされます。
新しいGitHubリリースが作成される
ワークフローはGitHub Actionsインターフェースを介して手動でトリガーされます
自動公開を設定するには:
PyPI API トークンを生成します:
https://pypi.org/manage/account/token/にアクセスしてください。
ddg-mcpプロジェクトにスコープを限定した新しいトークンを作成するトークンの値をコピーします(一度だけ表示されます)
トークンを GitHub リポジトリのシークレットに追加します。
GitHubのリポジトリにアクセスします
設定 > シークレットと変数 > アクションに移動します
「新しいリポジトリシークレット」をクリックします
名前:
PYPI_API_TOKEN値: PyPIトークンを貼り付けます
「シークレットを追加」をクリック
新しいバージョンを公開するには:
pyproject.tomlのバージョン番号を更新するGitHubで新しいリリースを作成するか、ワークフローを手動でトリガーします
デバッグ
MCPサーバーはstdio経由で実行されるため、デバッグが困難になる場合があります。最適なデバッグ環境を実現するには、 MCP Inspectorの使用を強くお勧めします。
次のコマンドを使用して、 npm経由で MCP Inspector を起動できます。
npx @modelcontextprotocol/inspector uv --directory /path/to/your/ddg-mcp run ddg-mcp起動すると、ブラウザでアクセスしてデバッグを開始できる URL がインスペクタに表示されます。
Resources
Looking for Admin?
Admins can modify the Dockerfile, update the server description, and track usage metrics. If you are the server author, to access the admin panel.