home / mcp / duckduckgo mcp server
Provides web search and content extraction via DuckDuckGo, with rate limiting, error handling, and LLM‑friendly output.
Configuration
View docs{
"mcpServers": {
"nickclyde-duckduckgo-mcp-server": {
"command": "uvx",
"args": [
"duckduckgo-mcp-server"
],
"env": {
"DDG_REGION": "cn-zh",
"DDG_SAFE_SEARCH": "STRICT"
}
}
}
}You set up this MCP server to enable web search and content fetching powered by DuckDuckGo, with results formatted for easy use by large language models and built‑in rate limiting to keep queries smooth and reliable.
You can use this MCP server with any MCP client by starting the server locally and then connecting your client to it. Run it with the standard MCP transport, or opt into alternative transports like SSE or streamable HTTP when your client supports them. The server provides two main capabilities: web search against DuckDuckGo and content fetching with clean, readable extraction suitable for downstream AI processing. You can configure SafeSearch level and the default region to tailor results, and you can use client-side overrides for per-request localization.
Prerequisites: you need Python installed on your system and the MCP runner available (the uvx tool). You also need a working internet connection to fetch dependencies and interact with DuckDuckGo.
Step by step install and start commands:
# Install the MCP runner and the DuckDuckGo MCP server package
uv pip install duckduckgo-mcp-server
# Start the server with the default transport (stdio) via the MCP runner
uvx duckduckgo-mcp-serverConfigure SafeSearch and region to control content and localization. You can set these options in your client configuration or environment when starting the server. The two shown options are:
DDG_SAFE_SEARCH controls content filtering with values like STRICT, MODERATE, and OFF. DDG_REGION sets the default region and language code. You can override the region per request if your MCP client supports it.
Basic runtime example (standard MCP setup): the server runs with the default stdio transport using the following command configuration.
{
"mcpServers": {
"ddg-search": {
"command": "uvx",
"args": ["duckduckgo-mcp-server"]
}
}
}The MCP server supports multiple transports. Use the default stdio transport for Claude Desktop and Claude Code. If you want to connect with other MCP clients, you can use SSE or streamable HTTP by passing the appropriate transport flag when starting the server.
# SSE transport
uvx duckduckgo-mcp-server --transport sse
# Streamable HTTP transport
uvx duckduckgo-mcp-server --transport streamable-httpSearch example with default settings: you can query DuckDuckGo and receive a formatted list of results with titles, URLs, and snippets suitable for feeding into an LLM.
Search example with a specific region override: you can request results localized for a particular locale by providing a region code in your client request, for example using a Japanese region to fetch results relevant to jp-ja.
SafeSearch is configured via an environment variable at startup and is intended to be managed by administrators. It cannot be modified by an AI assistant on the fly. The region setting helps improve result relevance for targeted audiences without compromising general safety controls.
For local development you can install dependencies and run tests as described in the development workflow, or run the MCP Inspector for debugging. Use the provided commands to install, test, and run locally.
Performs a web search on DuckDuckGo and returns a formatted string of results including titles, URLs, and snippets.
Fetches and parses content from a given webpage URL, returning cleaned and formatted text suitable for consumption by large language models.