This Docker-based MCP server provides web crawling, search capabilities, and RAG functionality for AI agents and coding assistants. It combines Model Context Protocol, Crawl4AI, SearXNG, and Supabase into a complete solution that can be deployed with a single command.
To get started with the MCP server:
Clone the repository:
git clone https://github.com/coleam00/mcp-crawl4ai-rag.git
cd mcp-crawl4ai-rag
Configure environment:
cp .env.example .env
# Edit .env with your API keys
Deploy the complete stack:
docker compose up -d
Your MCP server will be running at http://localhost:8051, with SearXNG search available internally.
Before using the server, you need to set up the Supabase database:
crawled_pages.sqlEdit your .env file to configure the server:
# Server configuration
TRANSPORT=sse
HOST=0.0.0.0
PORT=8051
# SearXNG configuration
SEARXNG_URL=http://searxng:8080
SEARXNG_USER_AGENT=MCP-Crawl4AI-RAG-Server/1.0
SEARXNG_DEFAULT_ENGINES=google,bing,duckduckgo
SEARXNG_TIMEOUT=30
SEARXNG_HOSTNAME=http://localhost
# API keys and services
OPENAI_API_KEY=your_openai_api_key
MODEL_CHOICE=gpt-4.1-nano-2025-04-14
SUPABASE_URL=your_supabase_project_url
SUPABASE_SERVICE_KEY=your_supabase_service_key
# RAG enhancement strategies
USE_CONTEXTUAL_EMBEDDINGS=false
USE_HYBRID_SEARCH=false
USE_AGENTIC_RAG=false
USE_RERANKING=false
USE_KNOWLEDGE_GRAPH=false
For knowledge graph functionality, you'll need additional Neo4j configuration:
NEO4J_URI=bolt://localhost:7687
NEO4J_USER=neo4j
NEO4J_PASSWORD=your_neo4j_password
The MCP server provides several tools for web search and content retrieval:
scrape_urls: Scrape one or more URLs and store content in the vector databasesmart_crawl_url: Intelligently crawl a website based on URL typeget_available_sources: Get a list of all available sources in the databaseperform_rag_query: Search for relevant content using semantic searchsearch: Comprehensive web search that integrates SearXNG, scraping, and RAG processingThese tools are available when certain features are enabled:
search_code_examples: Available when USE_AGENTIC_RAG=trueparse_github_repository, check_ai_script_hallucinations, and query_knowledge_graph: Available when USE_KNOWLEDGE_GRAPH=trueThe server supports several RAG enhancement strategies:
Enable these features by setting the corresponding variables to true in your .env file.
After starting the Docker stack, connect to your MCP server:
Claude Desktop/Windsurf:
{
"mcpServers": {
"crawl4ai-rag": {
"transport": "sse",
"url": "http://localhost:8051/sse"
}
}
}
Claude Code CLI:
claude mcp add-json crawl4ai-rag '{"type":"http","url":"http://localhost:8051/sse"}' --scope user
Control the Docker stack with these commands:
# Start all services
docker compose up -d
# View logs
docker compose logs -f
# Stop all services
docker compose down
# Restart specific service
docker compose restart mcp-crawl4ai
If you encounter issues:
docker compose logs mcp-crawl4aidocker compose confighost.docker.internal:7687 instead of localhost:7687docker compose down -v && docker compose up -dTo add this MCP server to Claude Code, run this command in your terminal:
claude mcp add-json "crawl4ai-rag" '{"transport":"sse","url":"http://localhost:8051/sse"}'
See the official Claude Code MCP documentation for more details.
There are two ways to add an MCP server to Cursor. The most common way is to add the server globally in the ~/.cursor/mcp.json file so that it is available in all of your projects.
If you only need the server in a single project, you can add it to the project instead by creating or adding it to the .cursor/mcp.json file.
To add a global MCP server go to Cursor Settings > Tools & Integrations and click "New MCP Server".
When you click that button the ~/.cursor/mcp.json file will be opened and you can add your server like this:
{
"mcpServers": {
"crawl4ai-rag": {
"transport": "sse",
"url": "http://localhost:8051/sse"
}
}
}
To add an MCP server to a project you can create a new .cursor/mcp.json file or add it to the existing one. This will look exactly the same as the global MCP server example above.
Once the server is installed, you might need to head back to Settings > MCP and click the refresh button.
The Cursor agent will then be able to see the available tools the added MCP server has available and will call them when it needs to.
You can also explicitly ask the agent to use the tool by mentioning the tool name and describing what the function does.
To add this MCP server to Claude Desktop:
1. Find your configuration file:
~/Library/Application Support/Claude/claude_desktop_config.json%APPDATA%\Claude\claude_desktop_config.json~/.config/Claude/claude_desktop_config.json2. Add this to your configuration file:
{
"mcpServers": {
"crawl4ai-rag": {
"transport": "sse",
"url": "http://localhost:8051/sse"
}
}
}
3. Restart Claude Desktop for the changes to take effect