The Crawl4AI RAG MCP Server provides web crawling and Retrieval-Augmented Generation (RAG) capabilities for AI agents and coding assistants. You can easily scrape web content and use it for knowledge-based searches, making your AI tools more informed and capable.
Clone the repository:
git clone https://github.com/coleam00/mcp-crawl4ai-rag.git
cd mcp-crawl4ai-rag
Build the Docker image:
docker build -t mcp/crawl4ai-rag --build-arg PORT=8051 .
Create a .env
file with your configuration settings (see Configuration section)
Clone the repository:
git clone https://github.com/coleam00/mcp-crawl4ai-rag.git
cd mcp-crawl4ai-rag
Install uv:
pip install uv
Create and activate a virtual environment:
uv venv
.venv\Scripts\activate
# on Mac/Linux: source .venv/bin/activate
Install dependencies:
uv pip install -e .
crawl4ai-setup
Create a .env
file with your configuration settings
crawled_pages.sql
from the repositoryCreate a .env
file in the project root with the following variables:
# MCP Server Configuration
HOST=0.0.0.0
PORT=8051
TRANSPORT=sse
# OpenAI API Configuration
OPENAI_API_KEY=your_openai_api_key
# Supabase Configuration
SUPABASE_URL=your_supabase_project_url
SUPABASE_SERVICE_KEY=your_supabase_service_key
docker run --env-file .env -p 8051:8051 mcp/crawl4ai-rag
uv run src/crawl4ai_mcp.py
For clients that support SSE transport, use this configuration:
{
"mcpServers": {
"crawl4ai-rag": {
"transport": "sse",
"url": "http://localhost:8051/sse"
}
}
}
For Windsurf users, use serverUrl
instead of url
:
{
"mcpServers": {
"crawl4ai-rag": {
"transport": "sse",
"serverUrl": "http://localhost:8051/sse"
}
}
}
For Claude Desktop, Windsurf, or other MCP clients supporting stdio:
{
"mcpServers": {
"crawl4ai-rag": {
"command": "python",
"args": ["path/to/crawl4ai-mcp/src/crawl4ai_mcp.py"],
"env": {
"TRANSPORT": "stdio",
"OPENAI_API_KEY": "your_openai_api_key",
"SUPABASE_URL": "your_supabase_url",
"SUPABASE_SERVICE_KEY": "your_supabase_service_key"
}
}
}
}
{
"mcpServers": {
"crawl4ai-rag": {
"command": "docker",
"args": ["run", "--rm", "-i",
"-e", "TRANSPORT",
"-e", "OPENAI_API_KEY",
"-e", "SUPABASE_URL",
"-e", "SUPABASE_SERVICE_KEY",
"mcp/crawl4ai"],
"env": {
"TRANSPORT": "stdio",
"OPENAI_API_KEY": "your_openai_api_key",
"SUPABASE_URL": "your_supabase_url",
"SUPABASE_SERVICE_KEY": "your_supabase_service_key"
}
}
}
}
The MCP server provides four primary tools:
Crawls a single web page and stores its content in the vector database.
Intelligently crawls a website based on the URL type:
Returns a list of all available sources (domains) in the database, useful for filtering RAG queries.
Performs semantic search on the crawled content with optional source filtering.
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 > MCP and click "Add new global MCP server".
When you click that button the ~/.cursor/mcp.json
file will be opened and you can add your server like this:
{
"mcpServers": {
"cursor-rules-mcp": {
"command": "npx",
"args": [
"-y",
"cursor-rules-mcp"
]
}
}
}
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 explictly ask the agent to use the tool by mentioning the tool name and describing what the function does.