DuckDuckGo MCP Server
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.
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 server
DuckDuckGo search API MCP - A server that provides DuckDuckGo search capabilities through the Model Context Protocol.
Components
Prompts
The server provides the following prompts:
- search-results-summary: Creates a summary of DuckDuckGo search results
- Required "query" argument for the search term
- Optional "style" argument to control detail level (brief/detailed)
Tools
The server implements the following DuckDuckGo search tools:
- ddg-text-search: Search the web for text results using DuckDuckGo
- Required: "keywords" - Search query keywords
- Optional: "region", "safesearch", "timelimit", "max_results"
- ddg-image-search: Search the web for images using DuckDuckGo
- Required: "keywords" - Search query keywords
- Optional: "region", "safesearch", "timelimit", "size", "color", "type_image", "layout", "license_image", "max_results"
- ddg-news-search: Search for news articles using DuckDuckGo
- Required: "keywords" - Search query keywords
- Optional: "region", "safesearch", "timelimit", "max_results"
- ddg-video-search: Search for videos using DuckDuckGo
- Required: "keywords" - Search query keywords
- Optional: "region", "safesearch", "timelimit", "resolution", "duration", "license_videos", "max_results"
- ddg-ai-chat: Chat with DuckDuckGo AI
- Required: "keywords" - Message or question to send to the AI
- Optional: "model" - AI model to use (options: "gpt-4o-mini", "llama-3.3-70b", "claude-3-haiku", "o3-mini", "mistral-small-3")
Installation
Prerequisites
- Python 3.9 or higher
- uv (recommended) or pip
Install from PyPI
Install from Source
- Clone the repository:
- Install the package:
Configuration
Required Dependencies
The server requires the duckduckgo-search
package, which will be installed automatically when you install ddg-mcp
.
If you need to install it manually:
DuckDuckGo Search Parameters
Common Parameters
These parameters are available for most search types:
- region: Region code for localized results (default: "wt-wt")
- Examples: "us-en" (US English), "uk-en" (UK English), "ru-ru" (Russian)
- See DuckDuckGo regions for more options
- safesearch: Content filtering level (default: "moderate")
- "on": Strict filtering
- "moderate": Moderate filtering
- "off": No filtering
- timelimit: Time range for results
- "d": Last day
- "w": Last week
- "m": Last month
- "y": Last year (not available for news/videos)
- max_results: Maximum number of results to return (default: 10)
Search Operators
You can use these operators in your search keywords:
cats dogs
: Results about cats or dogs"cats and dogs"
: Results for exact term "cats and dogs"cats -dogs
: Fewer dogs in resultscats +dogs
: More dogs in resultscats filetype:pdf
: PDFs about cats (supported: pdf, doc(x), xls(x), ppt(x), html)dogs site:example.com
: Pages about dogs from example.comcats -site:example.com
: Pages about cats, excluding example.comintitle:dogs
: Page title includes the word "dogs"inurl:cats
: Page URL includes the word "cats"
Image Search Specific Parameters
- size: "Small", "Medium", "Large", "Wallpaper"
- color: "color", "Monochrome", "Red", "Orange", "Yellow", "Green", "Blue", "Purple", "Pink", "Brown", "Black", "Gray", "Teal", "White"
- type_image: "photo", "clipart", "gif", "transparent", "line"
- layout: "Square", "Tall", "Wide"
- license_image: "any", "Public", "Share", "ShareCommercially", "Modify", "ModifyCommercially"
Video Search Specific Parameters
- resolution: "high", "standard"
- duration: "short", "medium", "long"
- license_videos: "creativeCommon", "youtube"
AI Chat Models
- gpt-4o-mini: OpenAI's GPT-4o mini model
- llama-3.3-70b: Meta's Llama 3.3 70B model
- claude-3-haiku: Anthropic's Claude 3 Haiku model
- o3-mini: OpenAI's O3 mini model
- mistral-small-3: Mistral AI's small model
Quickstart
Install
Claude Desktop
On MacOS: ~/Library/Application\ Support/Claude/claude_desktop_config.json
On Windows: %APPDATA%/Claude/claude_desktop_config.json
Usage Examples
Text Search
Advanced example:
Image Search
Advanced example:
News Search
Advanced example:
Video Search
Advanced example:
AI Chat
Search Results Summary
Claude config
"ddg-mcp": { "command": "uv", "args": [ "--directory", "/PATH/TO/YOUR/INSTALLATION/ddg-mcp", "run", "ddg-mcp" ] },
Development
Building and Publishing
To prepare the package for distribution:
- Sync dependencies and update lockfile:
- Build package distributions:
This will create source and wheel distributions in the dist/
directory.
- Publish to PyPI:
Note: You'll need to set PyPI credentials via environment variables or command flags:
- Token:
--token
orUV_PUBLISH_TOKEN
- Or username/password:
--username
/UV_PUBLISH_USERNAME
and--password
/UV_PUBLISH_PASSWORD
Automated Publishing with GitHub Actions
This repository includes a GitHub Actions workflow for automated publishing to PyPI. The workflow is triggered when:
- A new GitHub Release is created
- The workflow is manually triggered via the GitHub Actions interface
To set up automated publishing:
- Generate a PyPI API token:
- Go to https://pypi.org/manage/account/token/
- Create a new token with scope limited to the
ddg-mcp
project - Copy the token value (you'll only see it once)
- Add the token to your GitHub repository secrets:
- Go to your repository on GitHub
- Navigate to Settings > Secrets and variables > Actions
- Click "New repository secret"
- Name:
PYPI_API_TOKEN
- Value: Paste your PyPI token
- Click "Add secret"
- To publish a new version:
- Update the version number in
pyproject.toml
- Create a new release on GitHub or manually trigger the workflow
- Update the version number in
Debugging
Since MCP servers run over stdio, debugging can be challenging. For the best debugging experience, we strongly recommend using the MCP Inspector.
You can launch the MCP Inspector via npm
with this command:
Upon launching, the Inspector will display a URL that you can access in your browser to begin debugging.
This server cannot be installed
A server that provides DuckDuckGo search capabilities (text, image, news, video search and AI chat) through the Model Context Protocol.