Integrates with DuckDuckGo's public interface to provide web search functionality, offering advanced features like detai...
Created byApr 23, 2025
MCP DuckDuckGo Search Plugin
A DuckDuckGo search plugin for Model Context Protocol (MCP), compatible with Claude Code. Provides web search functionality with advanced navigation and content exploration features.
This project implements a Model Context Protocol (MCP) server that provides web search functionality using DuckDuckGo. The plugin is designed to work seamlessly with Claude Code or any other client that supports MCP, offering not just basic search capabilities but also advanced navigation and result exploration features.
Features
**Web Search Tool**: Perform web searches using DuckDuckGo
**Detailed Results**: Get detailed information about specific search results
**Related Searches**: Discover related search queries based on your original search
**Pagination Support**: Navigate through multiple pages of search results
**Domain Extraction**: View domain information for each search result
**Advanced Filtering**: Filter results by site and time period
**Enhanced Content Extraction**: Extract rich content from webpages including metadata, structure, and snippets
**Basic Web Spidering**: Follow links from search results to explore related content (configurable depth)
**Metadata Extraction**: Extract titles, authors, keywords, publication dates, and more
**Social Media Detection**: Identify and extract social media links from webpages
**Content Structure Analysis**: Extract headings and sections to understand webpage structure
**Search Documentation**: Access comprehensive documentation about the search functionality
**Search Assistant**: Get help formulating effective search queries
**Parameterized Resource**: Retrieve formatted search results for specific queries
Requirements
Python 3.9 or higher
pip (Python package manager)
Python packages listed in `pyproject.toml`
Installation
From PyPI
*Note: This package is not yet published to PyPI. Please install from source below.*
In the future, once published, you'll be able to install with:
From Source
Clone this repository:
```bash
git clone https://github.com/gianlucamazza/mcp-duckduckgo.git
cd mcp-duckduckgo
```
Install the package in development mode:
```bash
pip install -e .
```
Or use the provided script:
```bash
./scripts/install_dev.sh
```
Or use Make:
```bash
make install
```
Usage
Starting the Server Manually
To start the MCP server:
Or with custom parameters:
Or use the provided script for development:
Or use Make:
Using with Claude Code
Install the package from source as described above.
Configure Claude Code to use the plugin:
```bash
claude mcp add duckduckgo-search -- mcp-duckduckgo
```
For global configuration (available in all projects):
```bash
claude mcp add duckduckgo-search --scope global -- mcp-duckduckgo
```
Start Claude Code:
```bash
claude
```
Now you can use the DuckDuckGo search functionality within Claude Code.
Available Endpoints
The plugin provides the following endpoints:
Tool: `duckduckgo_web_search`
Performs a web search using DuckDuckGo with the following parameters:
`query` (required): The search query (max 400 characters, 50 words)
`count` (optional, default: 10): Number of results per page (1-20)
`page` (optional, default: 1): Page number for pagination
`site` (optional): Limit results to a specific site (e.g., 'example.com')
`time_period` (optional): Filter results by time period ('day', 'week', 'month', 'year')
Example usage in Claude Code:
Tool: `duckduckgo_get_details`
Retrieves detailed information about a specific search result:
`url` (required): URL of the result to get details for
Example usage in Claude Code:
Tool: `duckduckgo_related_searches`
Suggests related search queries based on the original query:
`query` (required): Original search query (max 400 characters)
`count` (optional, default: 5): Number of related searches to return (1-10)
Example usage in Claude Code:
Resource: `docs://search`
Provides comprehensive documentation about the search functionality.
Example usage in Claude Code:
Prompt: `search_assistant`
Helps formulate effective search queries.
Example usage in Claude Code:
Resource: `search://{query}`
Retrieves formatted search results for a specific query.
Example usage in Claude Code:
Using the Navigation Features
The plugin provides several features to help navigate and explore search results:
Pagination
To navigate through multiple pages of search results:
Filtering Results
To filter results by specific site:
To filter results by time period:
Exploring Result Details
To get more information about a specific search result:
Finding Related Searches
To discover related search queries:
These navigation features can be combined with Claude's natural language capabilities to create a powerful search and exploration experience. For example:
Implementation Notes
This implementation uses DuckDuckGo's public web interface and parses the HTML response to extract results. This approach is used for demonstration purposes, as DuckDuckGo does not offer an official search API. In a production environment, it's recommended to use a search service with an official API.
Enhanced Content Extraction
The DuckDuckGo plugin includes advanced content extraction capabilities that go beyond simple search results:
Content Extraction Features
**Full Webpage Analysis**: Extract and parse HTML content from search result URLs
**Intelligent Content Targeting**: Identify and extract main content areas from different types of websites