This MCP server provides DuckDuckGo search integration for Large Language Models through the Model Context Protocol. It allows your LLM to search the web, returning comprehensive results including organic search results, news, videos, images, and more.
To use mcp-duckduckgo-search, you'll need to set up the server with your MCP client. This requires a SerpAPI key to function.
Add the following to your Cline MCP settings:
{
"mcpServers": {
"mcp-duckduckgo-search": {
"command": "npx",
"args": ["-y", "mcp-duckduckgo-search"],
"env": {
"SERPAPI_KEY": "your-serpapi-api-key"
}
}
}
}
For Windows users with WSL, add this to your Claude Desktop configuration:
{
"mcpServers": {
"mcp-duckduckgo-search": {
"command": "wsl.exe",
"args": [
"bash",
"-c",
"source ~/.nvm/nvm.sh && SERPAPI_KEY=your-serpapi-api-key /home/username/.nvm/versions/node/v20.12.1/bin/npx mcp-duckduckgo-search"
]
}
}
}
Make sure to replace your-serpapi-api-key
with your actual SerpAPI key and adjust the path to your Node.js installation if needed.
The server provides a single tool called ddg_search
that you can use in your MCP-compatible client.
query
(string, required): The search term you want to look upregion
(string, optional): Region code for localized results (e.g., us-en
, uk-en
)
us-en
safe_search
(string, optional): Safe search filtering level
off
, moderate
, strict
moderate
date_filter
(string, optional): Filter results by date
d
: past dayw
: past weekm
: past monthy
: past year2023-01-01..2023-12-31
start
(number, optional): Result offset for paginationno_cache
(boolean, optional): Force fresh results by bypassing cache
false
When using an MCP-compatible client, you can call the search function with parameters like:
ddg_search(query: "climate change solutions", region: "us-en", safe_search: "moderate", date_filter: "y")
This will search for "climate change solutions" in the US region with moderate safe search filtering, limited to results from the past year.
The DuckDuckGo search tool provides:
If you encounter issues:
no_cache: true
if results seem outdatedTo add this MCP server to Claude Code, run this command in your terminal:
claude mcp add-json "mcp-duckduckgo-search" '{"command":"npx","args":["-y","mcp-duckduckgo-search"],"env":{"SERPAPI_KEY":"your-serpapi-api-key"}}'
See the official Claude Code MCP documentation for more details.
There are two ways to add an MCP server to Cursor. The most common way is to add the server globally in the ~/.cursor/mcp.json
file so that it is available in all of your projects.
If you only need the server in a single project, you can add it to the project instead by creating or adding it to the .cursor/mcp.json
file.
To add a global MCP server go to Cursor Settings > Tools & Integrations and click "New MCP Server".
When you click that button the ~/.cursor/mcp.json
file will be opened and you can add your server like this:
{
"mcpServers": {
"mcp-duckduckgo-search": {
"command": "npx",
"args": [
"-y",
"mcp-duckduckgo-search"
],
"env": {
"SERPAPI_KEY": "your-serpapi-api-key"
}
}
}
}
To add an MCP server to a project you can create a new .cursor/mcp.json
file or add it to the existing one. This will look exactly the same as the global MCP server example above.
Once the server is installed, you might need to head back to Settings > MCP and click the refresh button.
The Cursor agent will then be able to see the available tools the added MCP server has available and will call them when it needs to.
You can also explicitly ask the agent to use the tool by mentioning the tool name and describing what the function does.
To add this MCP server to Claude Desktop:
1. Find your configuration file:
~/Library/Application Support/Claude/claude_desktop_config.json
%APPDATA%\Claude\claude_desktop_config.json
~/.config/Claude/claude_desktop_config.json
2. Add this to your configuration file:
{
"mcpServers": {
"mcp-duckduckgo-search": {
"command": "npx",
"args": [
"-y",
"mcp-duckduckgo-search"
],
"env": {
"SERPAPI_KEY": "your-serpapi-api-key"
}
}
}
}
3. Restart Claude Desktop for the changes to take effect