barysiuk/ddgs-search-mcp
If you are the rightful owner of ddgs-search-mcp and would like to certify it and/or have it hosted online, please leave a comment on the right or send an email to dayong@mcphub.com.
DDGS Search MCP Server is a local server that provides text search capabilities using the Dux Distributed Global Search library, allowing AI agents to perform web searches by aggregating results from various services.
DDGS Search MCP Server
A local Model Context Protocol (MCP) server that provides text search capabilities using the Dux Distributed Global Search (ddgs) library. This server allows AI agents (like Claude) to perform web searches by aggregating results from diverse web search services.
Features
- Text Search: Perform web searches via DDGS metasearch.
- Configurable: Settings like region, safe search, max results, proxy, and retries are configurable via
settings.yaml. - Local Execution: Runs locally on your machine using a Python virtual environment.
- Stdio Transport: Communicates via standard input/output (STDIN/STDOUT) using the official
mcpSDK. - Resilient: Built-in retry mechanism with configurable delays to handle network issues and rate limits.
Prerequisites
- Python 3.10 or higher (Tested with 3.13).
Installation
-
Clone or Navigate to the directory: Ensure you are in the project directory.
-
Create a Virtual Environment (if you want to isolate it):
python3 -m venv .venv -
Install Dependencies:
source .venv/bin/activate pip install -r requirements.txt
Configuration
You can configure the default search behavior by editing the settings.yaml file in the main directory.
max_results: 10 # Default number of results to return
region: "us-en" # Search region (e.g., us-en, uk-en, ru-ru)
safesearch: "moderate" # Safe search level: on, moderate, off
backend: "auto" # Backend to use: auto, html, lite, api
# Anti-bot / Network settings
proxy: null # e.g., "http://user:pass@example.com:3128"
timeout: 10 # Request timeout in seconds
retries: 3 # Number of retries on failure
delay: 2.0 # Delay between retries in seconds
Usage with Claude for Desktop
To use this MCP server with Claude for Desktop, you need to add it to your configuration file.
-
Locate the Config File:
- macOS:
~/Library/Application Support/Claude/claude_desktop_config.json - Windows:
%APPDATA%\Claude\claude_desktop_config.json
- macOS:
-
Edit the Config File: Add the
ddgs-searchserver to themcpServersobject. Important: You must use absolute paths for both the python executable and theserver.pyscript.Run
pwdin your terminal to find the absolute path to the current directory.{ "mcpServers": { "ddgs-search": { "command": "/ABSOLUTE/PATH/TO/YOUR/PROJECT/.venv/bin/python", "args": [ "/ABSOLUTE/PATH/TO/YOUR/PROJECT/server.py" ] } } }Replace
/ABSOLUTE/PATH/TO/YOUR/PROJECTwith the actual path to this directory. -
Restart Claude: Restart the Claude Desktop application. The "search" tool should now be available to Claude.
Troubleshooting
403 Forbidden Errors / Rate Limits
If you are seeing "403 Forbidden" errors, it likely means the search provider has blocked your request (often due to IP reputation or rate limiting).
Solutions:
- Use a Proxy: Edit
settings.yamland set theproxyvalue.proxy: "socks5://127.0.0.1:9050" # Example for Tor or local proxy - Increase Delays: Increase the
delaysetting insettings.yamlto wait longer between retries. - Increase Retries: Increase
retriesto try more times before giving up.
Development
To test the server manually, you can use the mcp CLI inspector (if installed) or run it directly and interact via stdin/stdout if you know the protocol.