duckduckgo-mcp-server-0.1.1
توضیحات
MCP Server for searching via DuckDuckGo
| ویژگی | مقدار |
|---|---|
| سیستم عامل | - |
| نام فایل | duckduckgo-mcp-server-0.1.1 |
| نام | duckduckgo-mcp-server |
| نسخه کتابخانه | 0.1.1 |
| نگهدارنده | [] |
| ایمیل نگهدارنده | [] |
| نویسنده | - |
| ایمیل نویسنده | Nick Clyde <nick@clyde.tech> |
| آدرس صفحه اصلی | - |
| آدرس اینترنتی | https://pypi.org/project/duckduckgo-mcp-server/ |
| مجوز | - |
# DuckDuckGo Search MCP Server
A Model Context Protocol (MCP) server that provides web search capabilities through DuckDuckGo, with additional features for content fetching and parsing.
## 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
## Installation
This server requires Python 3.10 or higher. Install dependencies using `uv` (recommended) or `pip`:
```bash
# Using uv (recommended)
uv add "mcp[cli]" httpx beautifulsoup4
# Using pip
pip install "mcp[cli]" httpx beautifulsoup4
```
## Usage
### Running with Claude Desktop
1. Download [Claude Desktop](https://claude.ai/download)
2. Create or edit `claude_desktop_config.json`:
```json
{
"mcpServers": {
"ddg-search": {
"command": "python",
"args": ["path/to/ddg_search_server.py"]
}
}
}
```
3. Restart Claude Desktop
### Direct Usage
Run the server directly:
```bash
python ddg_search_server.py
```
Or use the MCP CLI for development:
```bash
mcp dev ddg_search_server.py
```
## Available Tools
### 1. Search Tool
```python
async def search(query: str, max_results: int = 10) -> str
```
Performs a web search on DuckDuckGo and returns formatted results.
**Parameters:**
- `query`: Search query string
- `max_results`: Maximum number of results to return (default: 10)
**Returns:**
Formatted string containing search results with titles, URLs, and snippets.
### 2. Content Fetching Tool
```python
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
## 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.
نیازمندی
| مقدار | نام |
|---|---|
| - | beautifulsoup4>=4.13.3 |
| - | httpx>=0.28.1 |
| - | mcp[cli]>=1.3.0 |
زبان مورد نیاز
| مقدار | نام |
|---|---|
| >=3.10 | Python |
نحوه نصب
نصب پکیج whl duckduckgo-mcp-server-0.1.1:
pip install duckduckgo-mcp-server-0.1.1.whl
نصب پکیج tar.gz duckduckgo-mcp-server-0.1.1:
pip install duckduckgo-mcp-server-0.1.1.tar.gz