DuckDuckGo MCP Server
Provides web search and news search capabilities using the DuckDuckGo search engine.
Click on "Deploy Server".
Wait a few minutes for the server to deploy. Once ready, it will show a "Started" state.
In the chat, type
@followed by the MCP server name and your instructions, e.g., "@DuckDuckGo MCP Serverfind recent news about climate change"
That's it! The server will respond to your query, and you can continue using it as needed.
Here is a step-by-step guide with screenshots.
DuckDuckGo MCP Server
A Model Context Protocol (MCP) server that provides DuckDuckGo search functionality for AI assistants.
Attribution: This project is a fork of zhsama/duckduckgo-mcp-server, originally created by zhsama. This fork adds English localization, news search, region support, time filtering, and modern tooling.
Features
Web Search - Search the web with region-specific and time-filtered results
News Search - Search recent news articles with source and date information
Token Optimization - Configurable result limits, snippet truncation, and formatting for low-VRAM LLMs
SafeSearch - Content filtering (strict, moderate, off)
Region Support - Localized results for different countries
Time Filtering - Filter results by day, week, month, year
Rate Limiting - Configurable rate limits to prevent abuse
Configurable Logging - Debug, info, warn, error, or none
Related MCP server: DuckDuckGo MCP Server
Installation
Prerequisites
Node.js >= 18.0.0 (tested with Node 24)
npm
Install & Build
npm install
npm run buildAvailable Tools
duckduckgo_web_search
Performs a web search using DuckDuckGo.
Parameter | Type | Required | Default | Description |
| string | Yes | - | Search query (max 400 characters) |
| number | No | DDG_MAX_RESULTS | Override default result limit (1-20) |
| number | No | DDG_MAX_RESULTS | [Deprecated: use |
| string | No | "moderate" | Filter: "strict", "moderate", or "off" |
| string | No | "wt-wt" | Region code (e.g., "us-en", "uk-en", "de-de") |
| string | No | "all" | Time range: "day", "week", "month", "year", "all" |
Example:
{
"query": "TypeScript best practices",
"count": 5,
"region": "us-en",
"time": "month"
}duckduckgo_news_search
Search for recent news articles.
Parameter | Type | Required | Default | Description |
| string | Yes | - | News search query (max 400 characters) |
| number | No | DDG_MAX_RESULTS | Override default result limit (1-20) |
| number | No | DDG_MAX_RESULTS | [Deprecated: use |
| string | No | "moderate" | Filter: "strict", "moderate", or "off" |
| string | No | "all" | Time range: "day", "week", "month", "year", "all" |
Example:
{
"query": "artificial intelligence",
"count": 10,
"time": "week"
}Supported Regions
Code | Region |
| Worldwide |
| United States |
| United Kingdom |
| Canada (English) |
| Australia |
| Germany |
| France |
| Spain |
| Italy |
| Japan |
| Brazil |
| Mexico |
| India |
Other region codes following the xx-xx format may also work.
Configuration
Environment Variables
Token Optimization (for low-VRAM LLMs)
Variable | Default | Description |
| 3 | Default number of results returned |
| 150 | Max characters per snippet (truncated with ...) |
| false | Set to "true" to disable truncation |
| false | Set to "true" to remove emojis from titles/text |
| "dense" | options: "dense", "json", "minimal" |
Rate Limiting
Variable | Default | Description |
| 1 | Maximum requests per second |
| 15000 | Maximum requests per month |
Logging
Variable | Default | Description |
| "info" | Logging level: debug, info, warn, error, none |
Examples
# Token-optimized for low VRAM (12GB RTX 5070)
DDG_MAX_RESULTS=3 DDG_MAX_SNIPPET_LENGTH=150 npm run start
# Full content for high-VRAM systems
DDG_MAX_RESULTS=10 DDG_MAX_SNIPPET_LENGTH=500 DDG_ENABLE_FULL_CONTENT=true npm run start
# Debug logging
LOG_LEVEL=debug npm run startIntegration
Claude Desktop
Add to your Claude Desktop config:
macOS: ~/Library/Application Support/Claude/claude_desktop_config.json
Windows: %APPDATA%/Claude/claude_desktop_config.json
{
"mcpServers": {
"duckduckgo": {
"command": "npx",
"args": ["-y", "@ericthered926/duckduckgo-mcp-server"]
}
}
}MCPO (Open WebUI)
For MCPO integration:
{
"mcpServers": {
"duckduckgo": {
"command": "npx",
"args": ["-y", "@ericthered926/duckduckgo-mcp-server"],
"env": {
"DDG_MAX_RESULTS": "3",
"DDG_MAX_SNIPPET_LENGTH": "150",
"DDG_ENABLE_FULL_CONTENT": "false"
}
}
}
}Local Development
{
"mcpServers": {
"duckduckgo": {
"command": "node",
"args": ["/path/to/duckduckgo-mcp-server/build/index.js"],
"env": {
"LOG_LEVEL": "debug"
}
}
}
}Development
Scripts
Command | Description |
| Compile TypeScript |
| Run the server |
| Watch mode for development |
| Run ESLint + Prettier check |
| Auto-fix lint issues |
| Format code with Prettier |
| Run tests |
| TypeScript type checking only |
Debugging
Use the MCP Inspector:
npx @modelcontextprotocol/inspector node build/index.jsProject Structure
duckduckgo-mcp-server/
├── src/
│ └── index.ts # Main server (web + news search)
├── test/
│ └── server.test.js # Smoke tests
├── build/ # Compiled output
├── .husky/ # Pre-commit hooks
├── eslint.config.js # ESLint 9.x flat config
├── tsconfig.json # Strict TypeScript config
├── .prettierrc # Prettier formatting
├── .editorconfig # Editor settings
└── .nvmrc # Node version (24)Rate Limits
Default rate limits are conservative to avoid being blocked by DuckDuckGo:
1 request per second - Prevents rate limiting
15,000 requests per month - Reasonable monthly cap
Adjust via environment variables if needed for your use case.
Troubleshooting
Server won't start
Check Node.js version:
node --version(should be >= 18)Rebuild:
npm run buildCheck for TypeScript errors in build output
Rate limit errors
Wait for the limit window to reset (1 second for per-second, or adjust limits)
Check if multiple instances are sharing the same counter
No results returned
Try a different query or remove time filters
Check if SafeSearch is blocking results
DuckDuckGo may return no results for very specific queries
Debug logging
Enable debug logs to see detailed request information:
LOG_LEVEL=debug npm run startCredits
This project is a fork of zhsama/duckduckgo-mcp-server, originally created by zhsama.
What's New in This Fork
Token optimization - Configurable result limits & snippet truncation for low-VRAM LLMs
Dense output format - Single-line results to minimize token usage
URL cleaning - Strips tracking params (utm_*, fbclid, gclid, etc.)
limitparameter - LLM can override defaults when more context neededEnglish localization (all comments and output)
News search tool (
duckduckgo_news_search)Region/locale support for localized results
Time range filtering
Configurable logging via
LOG_LEVELModern ESLint 9.x flat config
Prettier formatting
Husky pre-commit hooks
Comprehensive test suite
Strict TypeScript configuration
License
MIT - See LICENSE for details.
Available Tools
2 toolsduckduckgo_news_searchA
News search via DuckDuckGo. Returns max 3 articles with 150-char excerpts. Use 'limit' param to override (1-20).
| Name | Required | Description | Default |
|---|---|---|---|
| time | No | Time range for news articles | all |
| count | No | [DEPRECATED: use 'limit'] Number of results | |
| limit | No | Override default result limit (1-20, default: 3) | |
| query | Yes | News search query (max 400 chars) | |
| safeSearch | No | Content filtering level | moderate |
TDQS
Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?
Description discloses key behaviors: default max 3 articles, excerpt length 150 chars, ability to override limit. No annotations exist, so description carries full burden. Missing details on error behavior, rate limits, or side effects.
Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.
Is the description appropriately sized, front-loaded, and free of redundancy?
Two concise sentences with no redundant information. Front-loaded with purpose and key details. Every word serves a purpose.
Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.
Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?
Covers core functionality but omits explanation of time filter, safeSearch, and deprecated 'count'. No output schema provided, so return format beyond excerpts is unclear. Not fully complete for 5-parameter tool.
Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.
Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?
Schema coverage is 100% and already describes all parameters. Description adds value only for 'limit' (override). Other params like time, count, safeSearch are not explained beyond schema, so baseline of 3 is appropriate.
Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.
Does the description clearly state what the tool does and how it differs from similar tools?
Description clearly states it is a news search via DuckDuckGo and specifies return format (max 3 articles, 150-char excerpts). Sibling tool 'duckduckgo_web_search' is distinguishable by name, but no explicit differentiation is given.
Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.
Does the description explain when to use this tool, when not to, or what alternatives exist?
Provides guidance on default behavior and how to adjust result count using 'limit' param. However, lacks explicit when-to-use vs. web search and no exclusions or alternatives mentioned.
Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.
duckduckgo_web_searchA
Web search via DuckDuckGo. Returns max 3 results with 150-char snippets. Use 'limit' param to override (1-20). Supports region/time filters.
| Name | Required | Description | Default |
|---|---|---|---|
| time | No | Time range filter for results | all |
| count | No | [DEPRECATED: use 'limit'] Number of results | |
| limit | No | Override default result limit (1-20, default: 3) | |
| query | Yes | Search query (max 400 chars) | |
| region | No | Region for localized results. Examples: 'us-en' (US), 'uk-en' (UK), 'de-de' (Germany), 'wt-wt' (worldwide, default) | wt-wt |
| safeSearch | No | Content filtering level | moderate |
TDQS
Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?
Discloses output behavior (max 3 results, snippet length) and filter support; with no annotations, it's acceptable but not comprehensive (no error handling or rate limits mentioned).
Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.
Is the description appropriately sized, front-loaded, and free of redundancy?
Two sentences, dense and front-loaded with key info (purpose, default, override, filters). No fluff.
Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.
Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?
Covers main features but lacks details on output structure (beyond snippets) and error/edge cases. Adequate for a simple search tool.
Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.
Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?
Schema already provides 100% parameter descriptions, so description adds minimal extra value (only references limit override and filters already covered).
Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.
Does the description clearly state what the tool does and how it differs from similar tools?
Explicitly states it is a web search tool via DuckDuckGo, distinguishes from news search sibling, and describes output (max 3 results with 150-char snippets).
Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.
Does the description explain when to use this tool, when not to, or what alternatives exist?
Gives basic usage guidance (default results, limit override, region/time filters) but lacks explicit when-to-use vs news search or when not to use.
Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.
Tool Schema Changelog
Recent tool additions, removals, and schema changes observed during successful MCP inspections.
2 tool updates
v0.6.0- First observed
duckduckgo_news_search - First observed
duckduckgo_web_search
TDQS
Scored across 2 tools
News and web searches are distinct, but the descriptions are nearly identical (both return 3 results with 150-char excerpts), which could cause an agent to confuse them when selecting a tool.
Both tools follow a consistent duckduckgo_<type>_search pattern, making the naming predictable and clear.
With only 2 tools, the server is minimal but still reasonably scoped for a search-only service. However, it feels thin compared to typical MCP servers.
Covers both web and news search, but lacks image, video, or other common search types, and provides no way to fetch full content from results, leaving some gaps.
Maintenance
Related MCP Connectors
Search Google straight from your AI agent. Web results, images, videos, news, products, scholarly ar
Provides AI assistants with access to Seltz's powerful Web Search capabilities.
LLM-ready web search + instant answers + URL-to-clean-text fetch for agents and RAG.
The best web search for your AI Agent
Related MCP Servers
- FlicenseBqualityDmaintenanceAllows you to search the web using DuckDuckGo and optionally fetch and summarize content from search results.25-
- FlicenseNot gradedqualityDmaintenanceEnables AI assistants to perform real-time web searches, fetch webpage content, and get search suggestions using DuckDuckGo's privacy-focused search engine.-
- AlicenseNot gradedqualityFmaintenanceEnables AI agents to search the web, find news, and read page content via DuckDuckGo without an API key.2MIT
- AlicenseNot gradedqualityDmaintenanceEnables AI assistants to search the internet using DuckDuckGo and extract clean, formatted content from web pages.194 npmGPL 3.0