这是一个使用crawl4ai提供网络爬取功能的MCP服务器,并以Markdown格式输出给LLM。
git clone https://github.com/Ichigo3766/crawl4ai-mcp.git
cd crawl4ai-server
npm install
npm run build
{
"mcpServers": {
"crawl4ai": {
"command": "node",
"args": [
"/path/to/crawl4ai-server/build/index.js"
],
"env": {
"CRAWL4AI_API_URL": "http://127.0.0.1:11235",
"CRAWL4AI_AUTH_TOKEN": "your-auth-token" // 可选:如果需要认证
}
}
}
}
替换环境变量为您自己的值:
CRAWL4AI_API_URL:crawl4ai API服务的URL(可选)CRAWL4AI_AUTH_TOKEN:API的认证令牌(可选)crawl_urls - 爬取网页并获取带有引用的Markdown内容
urls(必需):要爬取的URL列表工具返回每个URL的带有引用的Markdown内容。多个URL之间用水平线(---)分隔。示例:
这是来自第一个URL的内容 [^1]
[^1]: https://example.com
---
这是来自第二个URL的内容 [^2]
[^2]: https://example.org
为了开发时自动重建:
npm run watch
常见问题及解决方案:
此MCP服务器采用MIT许可证。这意味着您可以自由地使用、修改和分发该软件,但需遵守MIT许可证的条款和条件。更多详情,请参见项目仓库中的LICENSE文件。