SearXNG + Crawl4AI MCP Server
A self-hosted MCP (Model Context Protocol) server providing fast search and reliable web scraping using SearXNG + Crawl4AI stack.
๐ Why This Solution?
This project evolved from limitations found in self-hosted Firecrawl:
- โ Firecrawl's search API doesn't work in self-hosted mode
- โ Missing Fire-engine features in self-hosted version
- โ Authentication issues and poor documentation
Our solution provides:
- โ Truly self-hosted search via SearXNG (aggregates 70+ search engines)
- โ Superior scraping via Crawl4AI (50k+ GitHub stars)
- โ 3x faster than Claude Code native search tools
- โ 100% reliable vs failing native WebFetch
- โ Complete privacy - no external API dependencies
๐๏ธ Architecture
โโโโโโโโโโโโโโโ โโโโโโโโโโโโโโโโ โโโโโโโโโโโโโโโ
โ โ โ โ โ โ
โ SearXNG โ โ Crawl4AI โ โ Redis โ
โ (Search) โ โ (Scraping) โ โ (Cache) โ
โ โ โ โ โ โ
โ Port 8081 โ โ Port 8001 โ โ Port 6380 โ
โโโโโโโโโโโโโโโ โโโโโโโโโโโโโโโโ โโโโโโโโโโโโโโโ
โ โ โ
โโโโโโโโโโโโโโโโโโโโโผโโโโโโโโโโโโโโโโโโโโ
โ
โโโโโโโโโโโโโโโโ
โ โ
โ MCP Server โ
โ (TypeScript) โ
โ โ
โโโโโโโโโโโโโโโโ
โ
โโโโโโโโโโโโโโโ
โ โ
โ Claude Code โ
โ โ
โโโโโโโโโโโโโโโ
๐ฆ Features
- ๐ Fast Search: SearXNG aggregates 70+ search engines (Google, Bing, DuckDuckGo, etc.)
- ๐ท๏ธ Advanced Scraping: Crawl4AI with Playwright for JavaScript-heavy sites
- โก High Performance: Sub-second search, reliable scraping
- ๐ณ Docker Ready: Complete Docker Compose orchestration
- ๐ Proxy Support: Built-in rotating IP proxy integration
- ๐ MCP Integration: 3 powerful tools for Claude Code
- ๐ก๏ธ Privacy First: All processing happens locally
๐ Quick Start
1. Clone and Setup
git clone https://github.com/yourusername/searxng-crawl4ai-mcp
cd searxng-crawl4ai-mcp
npm install
npm run build
2. Start Docker Services
# Start all services (SearXNG, Crawl4AI, Redis)
docker compose up -d
# Verify services are running
curl http://localhost:8081/search?q=test&format=json # SearXNG
curl http://localhost:8001/health # Crawl4AI
3. Configure Claude Code MCP
Simple Configuration (No Proxy):
{
"mcpServers": {
"searxng-crawl4ai": {
"command": "node",
"args": ["fixed-mcp-server.js"],
"cwd": "/absolute/path/to/your/project"
}
}
}
With Proxy Configuration:
{
"mcpServers": {
"searxng-crawl4ai": {
"command": "node",
"args": ["fixed-mcp-server.js"],
"cwd": "/absolute/path/to/your/project",
"env": {
"PROXY_URL": "http://username:[email protected]:10000"
}
}
}
}
4. Increase Token Limits (Recommended)
Create .claude/settings.json:
{
"environmentVariables": {
"MAX_MCP_OUTPUT_TOKENS": "100000"
}
}
๐ ๏ธ Available MCP Tools
1. search_web - Lightning Fast Search
{
"query": "latest AI developments 2025",
"maxResults": 10
}
Returns: 30+ search results in <1 second from multiple engines
2. crawl4ai_scrape - Advanced Web Scraping
{
"url": "https://finance.yahoo.com/quote/BTC-USD/",
"formats": ["markdown"]
}
Returns: Full page content with metadata (title, word count, clean markdown)
3. search_and_scrape - Combined Power Workflow
{
"query": "Bitcoin technical analysis September 2025",
"maxResults": 2
}
Returns: Search results + scraped content from top URLs (complete market intelligence)
๐ Performance Benchmarks
๐ฏ Trading & Finance Use Cases
Perfect for traders and financial analysts:
- Real-time Price Data: Extract current Bitcoin, stock, forex prices with exact timestamps
- Technical Analysis: Get complete RSI, MACD, support/resistance data from TradingView
- Market Sentiment: Scrape Fear & Greed Index, VIX, sentiment indicators
- News Analysis: Get latest Fed decisions, earnings, economic data
- API Discovery: Extract trading APIs from financial websites
Example trading query:
Use search_and_scrape to find "Bitcoin RSI technical analysis September 2025"
Result: Complete professional trading analysis with specific price levels, technical indicators, and market predictions.
๐ง Configuration
Environment Variables
Docker Services
- SearXNG: Port 8081 - Metasearch engine
- Crawl4AI: Port 8001 - Web scraping service
- Redis: Port 6380 - Caching layer
๐ก๏ธ Security & Privacy
- โ No external API calls - everything runs locally
- โ Proxy support - hide your IP address
- โ Credential masking - sensitive data automatically masked in logs
- โ Self-hosted - complete control over your data
๐ vs Alternatives
๐ Advanced Usage
Proxy Configuration
# Set in .env file
PROXY_URL=http://username:[email protected]:10000
Multiple Search Engines
SearXNG automatically queries:
- Google, Bing, DuckDuckGo
- Startpage, Qwant, Yandex
- Wikipedia, GitHub, StackOverflow
- Academic sources (ArXiv, Google Scholar)
Custom Scraping Options
{
"url": "https://example.com",
"formats": ["markdown", "html", "links"],
"wait_for": 2000,
"timeout": 30000
}
๐ Troubleshooting
Services Not Starting
docker compose logs searxng
docker compose logs crawl4ai
Port Conflicts
Edit docker-compose.yml to change ports:
- SearXNG: 8081 โ your-port
- Crawl4AI: 8001 โ your-port
- Redis: 6380 โ your-port
MCP Connection Issues
- Ensure all Docker services are running
- Check absolute path in MCP configuration
- Verify
npm run buildcompleted successfully
๐ License
MIT License - Feel free to use in your projects!
๐ค Contributing
Contributions welcome! Please read our contributing guidelines and submit pull requests.
โญ Star This Repo
If this MCP server helps your workflow, please star the repository!
Built with โค๏ธ for the Claude Code community