网页抓取 MCP 服务

这是一个将 Scrapling 网页抓取能力封装为 HTTP/SSE 接口的 MCP 服务器,支持部署在 Coolify 或任意容器平台,并通过 fetch 工具从 URL 获取 HTML/Markdown 内容。

  • by addison-w
  • Python
  • 混合部署
  • 1 星标
  • 更新于
在 GitHub 查看 addison-w/scrapling-mcp-server

使用说明

Scrapling MCP Server

A Streamable HTTP wrapper for scrapling-fetch-mcp that exposes it as an HTTP/SSE endpoint for deployment on Coolify or any container platform.

Endpoints

  • GET / - Server info
  • GET /health - Health check
  • POST /mcp - MCP JSON-RPC endpoint (primary)
  • GET /mcp/stream - SSE streaming endpoint
  • POST /scrape - Simple REST scrape endpoint

Deployment on Coolify

  1. Create a new Git-based application
  2. Point to this repository
  3. Use Dockerfile deployment
  4. Expose port 8000
  5. Coolify handles SSL/TLS automatically

Environment Variables

  • PORT - Server port (default: 8000)

MCP Tools Available

  • fetch - Fetch HTML/markdown from URLs using Scrapling

Testing

# Health check
curl https://your-domain.com/health

# Simple scrape
curl -X POST https://your-domain.com/scrape \
  -H "Content-Type: application/json" \
  -d '{"url": "https://example.com", "mode": "markdown"}'

# MCP JSON-RPC
curl -X POST https://your-domain.com/mcp \
  -H "Content-Type: application/json" \
  -d '{
    "jsonrpc": "2.0",
    "id": "1",
    "method": "tools/call",
    "params": {
      "name": "fetch",
      "arguments": {"url": "https://example.com", "mode": "markdown"}
    }
  }'