MCP Web Search Plugin
Provides web search through DuckDuckGo HTML scraping as an alternative backend, returning structured search results without requiring API keys.
Provides privacy-respecting web search through SearXNG metasearch instances, with fallback across multiple instances and configurable categories, language, safe search, time range, and result limits.
This server does not currently have a deployable release on Glama. Follow the repository's setup instructions to install and configure it for your MCP client, including any required credentials and local dependencies.
MCP Web Search Plugin
Privacy-respecting web search plugin for DeepSeek Harness using SearXNG and DuckDuckGo.
Features
Multiple Backends: SearXNG (metasearch) and DuckDuckGo HTML scraping
Privacy-First: No tracking, no API keys required for public instances
MCP Compatible: Runs as an MCP server for DeepSeek Harness integration
Async/Await: Full async support with proper timeout handling
Structured Output: JSON, Markdown, and dict formats
Fallback Support: Automatically tries multiple SearXNG instances
Configurable: Safe search, categories, language, time range, result limits
Related MCP server: DuckDuckGo Search MCP Server
Installation
pip install -e .Or install dependencies directly:
pip install mcp httpx beautifulsoup4 lxml pydantic python-dotenvQuick Start
As a Python Module
import asyncio
from search_plugin import WebSearchPlugin, SearchConfig, SearchBackend
async def main():
config = SearchConfig(
backend=SearchBackend.SEARXNG,
max_results=10,
)
async with WebSearchPlugin(config) as plugin:
# Get Markdown output (default)
results = await plugin.search("Python async programming")
print(results)
# Get JSON output
results_json = await plugin.search("Python async programming", output_format="json")
print(results_json)
# Get dict object
results_dict = await plugin.search("Python async programming", output_format="dict")
print(results_dict["results"])
asyncio.run(main())As CLI Tool
# Basic search
python -m search_plugin "Python async programming"
# With options
python -m search_plugin "machine learning" --max-results 5 --backend duckduckgo --format json
# Run as MCP server
python -m search_plugin --mcpAs MCP Server for DeepSeek Harness
Add to your DeepSeek Harness configuration (cordis.yml or settings.yaml):
- id: mcp-web-search
name: '@deepseek-ai/dsh-mcp-client'
config:
transport: stdio
serverName: web_search
command: python
args: ["-m", "search_plugin"]
cwd: /path/to/mcp-web-search
env:
PATH: /usr/local/bin:/usr/bin:/bin
toolCallTimeoutMs: 60000
startupTimeoutMs: 15000
maxInstructionBytes: 32768
failOnStartupError: false
reconnect:
enabled: true
initialDelayMs: 500
maxDelayMs: 30000
maxAttempts: 10Then use the mcp__web_search__web_search tool in your agent.
Configuration
SearchConfig Options
Option | Type | Default | Description |
|
|
| Search backend: |
|
| 5 public instances | SearXNG instance URLs |
|
|
| Max results per search (1-50) |
|
|
| Request timeout (1-120s) |
|
|
| 0=none, 1=moderate, 2=strict |
|
|
| Search categories (comma-separated) |
|
|
| Language code or |
|
|
|
|
|
|
| Custom User-Agent |
|
|
| Max retry attempts |
|
|
| Delay between retries |
Environment Variables
# Override SearXNG instances (comma-separated)
export SEARXNG_INSTANCES="https://my-searxng.example.com,https://backup.example.com"
# Custom timeout
export SEARCH_TIMEOUT=60
# Default max results
export SEARCH_MAX_RESULTS=20SearXNG Instances
The plugin uses these public SearXNG instances by default:
You can host your own SearXNG instance for better reliability:
docker run -d -p 8080:8080 searxng/searxngThen configure:
config = SearchConfig(searxng_instances=["http://localhost:8080"])Output Formats
Markdown (Default)
Human-readable format with clickable links:
# Search Results for: `Python async`
**Backend:** searxng | **Results:** 3 | **Time:** 245ms
1. **[asyncio — Python 3.12 documentation](https://docs.python.org/3/library/asyncio.html)**
The asyncio module provides infrastructure for writing single-threaded concurrent code...
*Source: google*JSON
Structured data for programmatic use:
{
"query": "Python async",
"results": [
{
"url": "https://docs.python.org/3/library/asyncio.html",
"title": "asyncio — Python 3.12 documentation",
"snippet": "The asyncio module provides...",
"source_engine": "google",
"position": 1,
"score": 0.95
}
],
"truncated": false,
"total_results": 42,
"search_time_ms": 245.3,
"backend_used": "searxng"
}Error Handling
The plugin handles various error conditions gracefully:
Network timeouts and connection errors
HTTP errors (rate limiting, server errors)
Invalid responses
All instances failing (returns error in response)
Errors are included in the response object:
response = await plugin.search("query")
if response.error:
print(f"Search warning: {response.error}")Testing
# Run all tests
pytest tests/ -v
# Run with coverage
pytest tests/ --cov=search_plugin --cov-report=htmlLicense
MIT License - see LICENSE file for details.
Contributing
Fork the repository
Create a feature branch
Make your changes
Add tests
Submit a pull request
Related Projects
Tool Schema Changelog
Recent tool additions, removals, and schema changes observed during successful MCP inspections.
Loading tool schema changelog…
Related MCP Connectors
Search the agentic web. 4,100+ sites, 11 tools incl. check_url + verify_mcp for probe-before-use.
Web search, Google SERP, page extraction to markdown and cited answers for AI agents.
Private web metasearch for agents: many engines, one result list. 50 sats per call in Bitcoin.
Bing and DuckDuckGo results with snippets and readable page text for AI agents and RAG.
Related MCP Servers
- AlicenseNot gradedqualityFmaintenanceEnables integration with DuckDuckGo search capabilities for LLMs, supporting comprehensive web search, regional filtering, result types, and safe browsing with caching and customizable search parameters.26 npm3MIT
- FlicenseNot gradedqualityDmaintenanceEnables comprehensive internet search capabilities through DuckDuckGo, supporting text, images, videos, news, and books search with advanced filtering options and search operators.1-
- AlicenseAqualityCmaintenanceEnables web search without API keys using DuckDuckGo and Bing search engines, and retrieves webpage content. Supports multiple search engines simultaneously with privacy protection and asynchronous processing.210MIT
- AlicenseNot gradedqualityBmaintenanceEnables DuckDuckGo search capabilities with full content extraction for AI agents, supporting text and news searches across multiple engines.1MIT