SearXNG-Crawl4AI MCP Server

SearXNG-Crawl4AI MCP Server

Provides fast, self-hosted web search and reliable web scraping using SearXNG and Crawl4AI, integrated as MCP tools for Claude Code.

Category
访问服务器

README

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:password@your-proxy-server.com: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

Metric SearXNG MCP Claude Code Native
Search Speed 935ms avg 2,500-3,000ms
Result Count 30+ results 10 curated
Scraping Success 100% success 0% (WebFetch fails)
Content Extracted 29,807 words tested 0 words
Privacy ✅ Self-hosted ❌ External APIs

🎯 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

Variable Description Default
PROXY_URL Your rotating IP proxy URL None
SEARXNG_URL SearXNG service URL http://localhost:8081
CRAWL4AI_URL Crawl4AI service URL http://localhost:8001
MCP_MODE Disable console logging for MCP false

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

Feature This Solution Firecrawl Self-Hosted Claude Native
Search API ✅ Working ❌ Broken ✅ Working
Speed ⚡ Sub-second N/A 🐌 2-3 seconds
Scraping ✅ 100% reliable ❌ Limited ❌ Unreliable
Privacy ✅ Self-hosted ✅ Self-hosted ❌ External APIs
Cost ✅ Free ✅ Free ❌ Rate limited

🚀 Advanced Usage

Proxy Configuration

# Set in .env file
PROXY_URL=http://username:password@proxy-server.com: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

  1. Ensure all Docker services are running
  2. Check absolute path in MCP configuration
  3. Verify npm run build completed 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

推荐服务器

Baidu Map

Baidu Map

百度地图核心API现已全面兼容MCP协议,是国内首家兼容MCP协议的地图服务商。

官方
精选
JavaScript
Playwright MCP Server

Playwright MCP Server

一个模型上下文协议服务器,它使大型语言模型能够通过结构化的可访问性快照与网页进行交互,而无需视觉模型或屏幕截图。

官方
精选
TypeScript
Magic Component Platform (MCP)

Magic Component Platform (MCP)

一个由人工智能驱动的工具,可以从自然语言描述生成现代化的用户界面组件,并与流行的集成开发环境(IDE)集成,从而简化用户界面开发流程。

官方
精选
本地
TypeScript
Audiense Insights MCP Server

Audiense Insights MCP Server

通过模型上下文协议启用与 Audiense Insights 账户的交互,从而促进营销洞察和受众数据的提取和分析,包括人口统计信息、行为和影响者互动。

官方
精选
本地
TypeScript
VeyraX

VeyraX

一个单一的 MCP 工具,连接你所有喜爱的工具:Gmail、日历以及其他 40 多个工具。

官方
精选
本地
graphlit-mcp-server

graphlit-mcp-server

模型上下文协议 (MCP) 服务器实现了 MCP 客户端与 Graphlit 服务之间的集成。 除了网络爬取之外,还可以将任何内容(从 Slack 到 Gmail 再到播客订阅源)导入到 Graphlit 项目中,然后从 MCP 客户端检索相关内容。

官方
精选
TypeScript
Kagi MCP Server

Kagi MCP Server

一个 MCP 服务器,集成了 Kagi 搜索功能和 Claude AI,使 Claude 能够在回答需要最新信息的问题时执行实时网络搜索。

官方
精选
Python
e2b-mcp-server

e2b-mcp-server

使用 MCP 通过 e2b 运行代码。

官方
精选
Neon MCP Server

Neon MCP Server

用于与 Neon 管理 API 和数据库交互的 MCP 服务器

官方
精选
Exa MCP Server

Exa MCP Server

模型上下文协议(MCP)服务器允许像 Claude 这样的 AI 助手使用 Exa AI 搜索 API 进行网络搜索。这种设置允许 AI 模型以安全和受控的方式获取实时的网络信息。

官方
精选