MCP Server for searching via DuckDuckGo with configurable SSL verification (corporate proxy friendly)
Project description
DuckDuckGo Search MCP Server (SSL-Fix Edition)
A Model Context Protocol (MCP) server that provides web search capabilities through DuckDuckGo, with additional features for content fetching and parsing. This fork includes configurable SSL verification for corporate proxy environments.
Features
- Web Search: Search DuckDuckGo with advanced rate limiting and result formatting
- Content Fetching: Retrieve and parse webpage content with intelligent text extraction
- Rate Limiting: Built-in protection against rate limits for both search and content fetching
- Error Handling: Comprehensive error handling and logging
- LLM-Friendly Output: Results formatted specifically for large language model consumption
- 🆕 Configurable SSL Verification: Works in corporate environments with SSL inspection/proxies
Installation
Installing via uv
Install directly from PyPI using uv:
uv pip install duckduckgo-mcp-server-ssl-fix
Installing via pip
pip install duckduckgo-mcp-server-ssl-fix
Configuration
SSL Verification Settings
This package supports configurable SSL verification through environment variables:
Option 1: Disable SSL Verification (for corporate proxies)
export DDG_DISABLE_SSL_VERIFY=true
⚠️ Security Note: Only disable SSL verification in trusted corporate environments with SSL inspection.
Option 2: Use Custom Certificate
export DDG_SSL_CERT_PATH=/path/to/your/corporate/cert.pem
Option 3: Default (Secure)
If neither environment variable is set, standard SSL verification is used.
Usage
Running with Claude Code
Add to your Claude Code MCP configuration:
macOS/Linux: ~/.config/claude/claude_desktop_config.json
Windows: %APPDATA%\Claude\claude_desktop_config.json
{
"mcpServers": {
"ddg-search": {
"command": "uvx",
"args": ["duckduckgo-mcp-server-ssl-fix"],
"env": {
"DDG_DISABLE_SSL_VERIFY": "true"
}
}
}
}
For Claude Code CLI configuration, create/edit ~/.config/claude-code/settings.json:
{
"mcpServers": {
"duckduckgo": {
"command": "uvx",
"args": ["duckduckgo-mcp-server-ssl-fix"],
"env": {
"DDG_DISABLE_SSL_VERIFY": "true"
}
}
}
}
Running with Claude Desktop
- Download Claude Desktop
- Create or edit your Claude Desktop configuration:
- On macOS:
~/Library/Application Support/Claude/claude_desktop_config.json - On Windows:
%APPDATA%\Claude\claude_desktop_config.json
- On macOS:
Add the following configuration:
{
"mcpServers": {
"ddg-search": {
"command": "uvx",
"args": ["duckduckgo-mcp-server-ssl-fix"],
"env": {
"DDG_DISABLE_SSL_VERIFY": "true"
}
}
}
}
- Restart Claude Desktop
Testing the Package
You can test the package directly:
# Test with SSL verification disabled
DDG_DISABLE_SSL_VERIFY=true uvx duckduckgo-mcp-server-ssl-fix
# Test with custom certificate
DDG_SSL_CERT_PATH=/path/to/cert.pem uvx duckduckgo-mcp-server-ssl-fix
# Test with default SSL verification
uvx duckduckgo-mcp-server-ssl-fix
Available Tools
1. Search Tool
async def search(query: str, max_results: int = 10) -> str
Performs a web search on DuckDuckGo and returns formatted results.
Parameters:
query: Search query stringmax_results: Maximum number of results to return (default: 10)
Returns: Formatted string containing search results with titles, URLs, and snippets.
2. Content Fetching Tool
async def fetch_content(url: str) -> str
Fetches and parses content from a webpage.
Parameters:
url: The webpage URL to fetch content from
Returns: Cleaned and formatted text content from the webpage.
Features in Detail
Rate Limiting
- Search: Limited to 30 requests per minute
- Content Fetching: Limited to 20 requests per minute
- Automatic queue management and wait times
Result Processing
- Removes ads and irrelevant content
- Cleans up DuckDuckGo redirect URLs
- Formats results for optimal LLM consumption
- Truncates long content appropriately
Error Handling
- Comprehensive error catching and reporting
- Detailed logging through MCP context
- Graceful degradation on rate limits or timeouts
SSL Configuration
Three modes of operation:
- Secure (Default): Full SSL verification using system certificates
- Custom Certificate: Specify your organization's root certificate
- Disabled Verification: For corporate proxies with SSL inspection (less secure)
Troubleshooting
SSL Certificate Errors
If you see errors like:
[SSL: CERTIFICATE_VERIFY_FAILED] certificate verify failed
This typically means you're behind a corporate proxy with SSL inspection. Solutions:
-
Disable SSL Verification (quick fix):
export DDG_DISABLE_SSL_VERIFY=true
-
Use Corporate Certificate (more secure):
export DDG_SSL_CERT_PATH=/path/to/corporate/cert.pem
-
Export Certificate from Browser:
- Open your browser's certificate manager
- Find your organization's root certificate
- Export as PEM format
- Use the path with
DDG_SSL_CERT_PATH
Differences from Original
This fork adds:
- Configurable SSL verification via environment variables
- Support for custom SSL certificates
- Corporate proxy-friendly defaults
- Enhanced documentation for SSL issues
Contributing
Issues and pull requests are welcome! Some areas for potential improvement:
- Additional search parameters (region, language, etc.)
- Enhanced content parsing options
- Caching layer for frequently accessed content
- Additional rate limiting strategies
License
This project is licensed under the MIT License.
Credits
Based on the original duckduckgo-mcp-server by Nick Clyde.
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file duckduckgo_mcp_server_ssl_fix-0.2.0.tar.gz.
File metadata
- Download URL: duckduckgo_mcp_server_ssl_fix-0.2.0.tar.gz
- Upload date:
- Size: 26.9 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.2.0 CPython/3.13.2
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
7ea7cee25bbf58d8f519bf45444aa097602fb15580a9abd15afd9c5c0c122e75
|
|
| MD5 |
43eef2b80e7def7732f114ead45419fd
|
|
| BLAKE2b-256 |
befeee036183886a22fdf658c7c28681009d161352d53ca61355fc71e6a62bca
|
File details
Details for the file duckduckgo_mcp_server_ssl_fix-0.2.0-py3-none-any.whl.
File metadata
- Download URL: duckduckgo_mcp_server_ssl_fix-0.2.0-py3-none-any.whl
- Upload date:
- Size: 7.9 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.2.0 CPython/3.13.2
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
613781992d5f1c18bceb0bfde4db1d19a5fc3b9675865deabcdd5d36785134cc
|
|
| MD5 |
dadd1dcfe41f0d2fe13a8fc7185878f9
|
|
| BLAKE2b-256 |
c71377616b1f61965b70c9875c1bad10b558d82dc4f8ac992ebf109ef589e819
|