网页爬取服务

Firecrawl Server for MCP是一个提供网页爬取和内容抓取功能的Express API服务器,适用于需要批量处理URL或爬取整个网站的场景。

  • by radu103
  • JavaScript
  • 本地部署
  • 1 星标
  • 更新于
在 GitHub 查看 radu103/firecrawl-server-for-mcp

使用说明

MCP的防火墙服务器

用于Firecrawl的Express API服务器,为web爬网和抓取功能提供端点。

特性

  • 删除单个URL
  • 批量删除多个URL
  • 抓取网站并抓取所有页面

Docker设置

这个项目可以使用Docker和Docker Compose轻松运行。Docker Compose允许您轻松定义、管理和运行多容器Docker应用程序。

先决条件

Docker编写命令

构建并启动容器

# Build and start in detached mode
docker compose up -d

# Build the image without starting the container
docker compose build

# Build with no cache (force rebuild)
docker compose build --no-cache

# Build and start with logs in console (not detached)
docker compose up

管理容器

# Stop the container
docker compose stop

# Stop and remove the container
docker compose down

# Stop and remove the container and volumes
docker compose down -v

# View container logs
docker compose logs

# Follow container logs
docker compose logs -f

# Restart the container
docker compose restart

缩放(如果需要)

# Scale the service to multiple instances
docker compose up -d --scale firecrawl-server=3

标记并上传

docker tag firecrawl-server-for-mcp-tools yourusername/firecrawl-server-for-mcp:latest docker tag firecrawl-server-for-mcp-tools yourusername/firecrawl-server-for-mcp:0.0.1 docker push radu103/firecrawl-server-for-mcp:latest docker push radu103/firecrawl-server-for-mcp:0.0.1

Docker编写文件

该项目包括 docker-compose.yml 配置文件:

  • 港口测绘(3000:3000)
  • 环境变量
  • 用于持久存储下载文件的卷

API终点

  • GET /:显示API信息的主路由
  • POST /scrape:删除单个URL
  • POST /scrape-batch:删除多个URL
  • POST /crawl:抓取网站并抓取所有页面

示例请求

检查 sample_requests HTTP请求示例目录。

发展

无Docker安装

# Install dependencies
npm install

# Start server
npm start

默认情况下,服务器在端口3000或port环境变量中指定的端口上运行。