DuckDuckGo Search MCP server

Integrates with DuckDuckGo to provide web search capabilities, content fetching, and parsing, with results formatted for large language model consumption.
Back to servers
Provider
Nick Clyde
Release date
Feb 23, 2025
Language
Python
Package
Stats
30.1K downloads
178 stars

This MCP server provides web search capabilities through DuckDuckGo, along with content fetching and parsing features. It's designed to be used with Large Language Models, offering structured search results and webpage content in a format that's optimal for AI consumption.

Installation Options

Via Smithery

For an automated installation with Claude Desktop:

npx -y @smithery/cli install @nickclyde/duckduckgo-mcp-server --client claude

Via UV Package Manager

Install directly from PyPI:

uv pip install duckduckgo-mcp-server

Setting Up with Claude Desktop

  1. Download and install Claude Desktop

  2. Create or modify your Claude Desktop configuration file:

    • macOS: ~/Library/Application Support/Claude/claude_desktop_config.json
    • Windows: %APPDATA%\Claude\claude_desktop_config.json
  3. Add the following configuration to the file:

{
    "mcpServers": {
        "ddg-search": {
            "command": "uvx",
            "args": ["duckduckgo-mcp-server"]
        }
    }
}
  1. Restart Claude Desktop to apply the changes

Available Tools

Search Tool

The search tool allows you to query DuckDuckGo and receive formatted results:

async def search(query: str, max_results: int = 10) -> str

Parameters:

  • query: Your search query string
  • max_results: Maximum number of results to return (default: 10)

The tool returns a formatted string containing search results with titles, URLs, and descriptive snippets.

Content Fetching Tool

The content fetching tool retrieves and parses webpage content:

async def fetch_content(url: str) -> str

Parameters:

  • url: The webpage URL to fetch content from

This tool returns cleaned and formatted text content from the specified webpage.

Advanced Features

Intelligent Rate Limiting

The server includes built-in rate limiting to prevent overuse of DuckDuckGo services:

  • Search requests are limited to 30 per minute
  • Content fetching is limited to 20 requests per minute

Result Processing

The server optimizes search results and content for LLM consumption by:

  • Removing advertisements and irrelevant content
  • Cleaning up redirect URLs
  • Formatting results consistently
  • Truncating excessively long content appropriately

Error Handling

The server includes comprehensive error handling with:

  • Detailed error reporting
  • Logging through the MCP context
  • Graceful responses when rate limits are reached or timeouts occur

How to add this MCP server to Cursor

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.

Adding an MCP server to Cursor globally

To add a global MCP server go to Cursor Settings > MCP and click "Add new global MCP server".

When you click that button the ~/.cursor/mcp.json file will be opened and you can add your server like this:

{
    "mcpServers": {
        "cursor-rules-mcp": {
            "command": "npx",
            "args": [
                "-y",
                "cursor-rules-mcp"
            ]
        }
    }
}

Adding an MCP server to a project

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.

How to use the MCP server

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 explictly ask the agent to use the tool by mentioning the tool name and describing what the function does.

Want to 10x your AI skills?

Get a free account and learn to code + market your apps using AI (with or without vibes!).

Nah, maybe later