- Crawl4ai Middleware
Crawl4ai Middleware
Content
Crawl4AI MCP 服务器
这是一个MCP(模型上下文协议)服务器,用于将crawl4ai的网页抓取功能集成到支持MCP的应用程序中,如Cursor IDE。
功能
该服务器提供以下工具:
create_crawl_task- 创建网页抓取任务并获取任务IDget_crawl_result- 根据任务ID获取抓取结果并保存到本地文件list_saved_results- 列出已保存的抓取结果文件read_saved_result- 读取已保存的抓取结果文件内容。
文件存储
所有抓取的网页内容会保存在服务器脚本同级目录下的 url 文件夹中,文件命名格式为:
extracted_域名_任务ID_时间戳.txt
这样可以避免因内容过大导致的显示问题,并可随时查看完整抓取结果。
安装依赖
pip install mcp[cli] httpx python-dotenv
配置
默认配置
服务器默认配置为:
- API地址:http://192.168.31.12:11235/
- API密钥:sk-3180623
环境变量配置
你可以通过以下两种方式配置环境变量:
-
创建.env文件
在与
crawl4ai_server.py同一目录下创建一个名为.env的文件,内容如下:CRAWL4AI_API_BASE=http://192.168.31.12:11235 CRAWL4AI_API_KEY=sk-3180623 OUTPUT_DIR= LOG_LEVEL=INFO注意:确保.env文件使用UTF-8编码保存,不要包含BOM头。
-
设置系统环境变量
你也可以直接在操作系统中设置以下环境变量:
CRAWL4AI_API_BASE- API服务器地址CRAWL4AI_API_KEY- API密钥OUTPUT_DIR- 自定义输出目录(可选)LOG_LEVEL- 日志级别(可选,默认INFO)
在Cursor中使用
-
确保已安装所需依赖项
-
修改Cursor的配置文件,路径通常为:
- Windows:
%APPDATA%\Cursor\User\settings.json
- Windows:
-
在配置文件中添加以下内容:
{
"mcpServers": {
"crawl4ai": {
"command": "python",
"args": [
"E:/APP/craw14ai-middleware/crawl4ai_server.py"
]
}
}
}
- 重启Cursor以加载MCP服务器
使用示例
在Cursor中,你可以让AI助手使用这些工具:
- "请帮我抓取网页 https://example.com"
- "请获取任务ID为 abc123 的抓取结果"
- "请列出已保存的抓取结果文件"
- "请读取文件 extracted_example_com_abc123.txt 的内容"
Server Config
{
"mcpServers": {
"crawl4ai": {
"command": "python",
"args": [
"E:/APP/craw14ai-middleware/crawl4ai_server.py"
]
}
}
}Recommend Servers
TraeBuild with Free GPT-4.1 & Claude 3.7. Fully MCP-Ready.
ChatWiseThe second fastest AI chatbot™
EdgeOne Pages MCPAn MCP service designed for deploying HTML content to EdgeOne Pages and obtaining an accessible public URL.
Context7Context7 MCP Server -- Up-to-date code documentation for LLMs and AI code editors
WindsurfThe new purpose-built IDE to harness magic
DeepChatYour AI Partner on Desktop
BlenderBlenderMCP connects Blender to Claude AI through the Model Context Protocol (MCP), allowing Claude to directly interact with and control Blender. This integration enables prompt assisted 3D modeling, scene creation, and manipulation.
Zhipu Web SearchZhipu Web Search MCP Server is a search engine specifically designed for large models. It integrates four search engines, allowing users to flexibly compare and switch between them. Building upon the web crawling and ranking capabilities of traditional search engines, it enhances intent recognition capabilities, returning results more suitable for large model processing (such as webpage titles, URLs, summaries, site names, site icons, etc.). This helps AI applications achieve "dynamic knowledge acquisition" and "precise scenario adaptation" capabilities.
MCP AdvisorMCP Advisor & Installation - Use the right MCP server for your needs
Jina AI MCP ToolsA Model Context Protocol (MCP) server that integrates with Jina AI Search Foundation APIs.
MiniMax MCPOfficial MiniMax Model Context Protocol (MCP) server that enables interaction with powerful Text to Speech, image generation and video generation APIs.
TimeA Model Context Protocol server that provides time and timezone conversion capabilities. This server enables LLMs to get current time information and perform timezone conversions using IANA timezone names, with automatic system timezone detection.
AiimagemultistyleA Model Context Protocol (MCP) server for image generation and manipulation using fal.ai's Stable Diffusion model.
Howtocook Mcp基于Anduin2017 / HowToCook (程序员在家做饭指南)的mcp server,帮你推荐菜谱、规划膳食,解决“今天吃什么“的世纪难题;
Based on Anduin2017/HowToCook (Programmer's Guide to Cooking at Home), MCP Server helps you recommend recipes, plan meals, and solve the century old problem of "what to eat today"
Serper MCP ServerA Serper MCP Server
Baidu Map百度地图核心API现已全面兼容MCP协议,是国内首家兼容MCP协议的地图服务商。
Tavily Mcp
Visual Studio Code - Open Source ("Code - OSS")Visual Studio Code
Playwright McpPlaywright MCP server
Amap Maps高德地图官方 MCP Server
CursorThe AI Code Editor