Crawl4AI MCP Server
A Model Context Protocol server for web crawling using the Crawl4ai library.
📋 Overview
Crawl4AI MCP Server provides a set of tools and prompts for web crawling through the Model Context Protocol (MCP). It allows AI assistants to autonomously crawl websites, extract content, and save information as Markdown files.
✨ Features
- 🕸️ Single Page Crawling: Extract content from a single webpage in Markdown format
- 🌐 Deep Website Crawling: Crawl multiple pages of a website with configurable depth and limits
- 🔍 Structured Data Extraction: Use CSS selectors to extract specific structured data from webpages
- 💾 Markdown Export: Save crawled content directly as Markdown files
🚀 Installation
pip install crawl4ai-mcp-server
🛠️ Usage
Command Line
Run the server directly from the command line:
crawl4ai-mcp
Python API
import asyncio
from crawl4ai_mcp import serve
# Run the server
asyncio.run(serve())
📝 Available Tools
crawl_webpage
Crawls a single webpage and returns its content as markdown.
Parameters:
url(string, required): URL to crawlinclude_images(boolean, optional): Whether to include images in the result (default: true)bypass_cache(boolean, optional): Whether to bypass cache (default: false)
crawl_website
Crawls a website starting from the given URL, with specified depth and page limit.
Parameters:
url(string, required): Starting URLmax_depth(integer, optional): Maximum crawl depth (default: 1)max_pages(integer, optional): Maximum number of pages to crawl (default: 5)include_images(boolean, optional): Whether to include images (default: true)
extract_structured_data
Extracts structured data from a webpage using CSS selectors.
Parameters:
url(string, required): URL to extract data fromschema(object, optional): Schema defining what to extractcss_selector(string, optional): CSS selector to locate specific parts of the page (default: "body")
save_as_markdown
Crawls a webpage and saves the content as a Markdown file.
Parameters:
url(string, required): URL to crawlfilename(string, required): Filename to save the Markdowninclude_images(boolean, optional): Whether to include images (default: true)
🔌 Available Prompts
crawl
Crawls a webpage and retrieves its content.
Arguments:
url(required): URL to crawl
save_page
Crawls a webpage and saves it as a Markdown file.
Arguments:
url(required): URL to crawlfilename(required): Filename to save the Markdown
🧩 Requirements
- Python 3.8+
- mcp>=1.0.0
- crawl4ai
- pydantic
📄 License
MIT License - see the LICENSE file for details.
🤝 Contributing
Contributions are welcome! Please feel free to submit a Pull Request.
- Fork the repository
- Create your feature branch (
git checkout -b feature/amazing-feature) - Commit your changes (
git commit -m 'Add some amazing feature') - Push to the branch (
git push origin feature/amazing-feature) - Open a Pull Request
Metadata
Release files for crawl4ai-mcp-server 0.1.5
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | |
|---|---|---|---|
| crawl4ai_mcp_server-0.1.5.tar.gz | 21.7 kB | Details |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Reset |
|---|---|---|---|---|
| crawl4ai_mcp_server-0.1.5-py3-none-any.whl | Python 3 | none | any | Details |
Total release size: 41.9 kB
Release files / crawl4ai_mcp_server-0.1.5.tar.gz
| Download URL | crawl4ai_mcp_server-0.1.5.tar.gz |
|---|---|
| Size | 21.7 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
915e1b547aa562a0101411ff29dce850d0563c8156164a88c34088b9cc36ef65
|
|
BLAKE2b-256 checksum How to use checksums |
e4229368da8451caf44255a1f1e14b79fffac68c715ed929cdf83b3c080262c6
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/6.1.0 CPython/3.13.2
|
Release files / crawl4ai_mcp_server-0.1.5-py3-none-any.whl
| Download URL | crawl4ai_mcp_server-0.1.5-py3-none-any.whl |
|---|---|
| Size | 20.2 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
0d56bdaa3fcf58b4457cbbd7f0e6eabfde7eeed2009c3f15e4b9ea5fc01afaab
|
|
BLAKE2b-256 checksum How to use checksums |
c8fd4842d07ef714dda9521b211b1c5473d47201bf927ccdbb6ba3cca3951435
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/6.1.0 CPython/3.13.2
|