Back to MCP directory
publicPublicdnsLocal runtime

jcrawl4ai-mcp-server

基于Spring Boot的Crawl4ai API交互服务器

article

README

🚀 jcrawl 项目

jcrawl 是一个基于 Java 的爬虫项目,借助 Spring AI MCP Server 和 Hutool 等依赖构建。它提供了 crawltask 两个主要接口,可高效完成网页爬取与任务管理。

🚀 快速开始

安装项目

使用 Maven 安装项目:

mvn clean install

运行项目

运行 Jar 包:

java -jar target/jcrawl-1.0.0.jar

注意:下载 JAR 文件的链接请见 官方文档

✨ 主要特性

  • 爬虫核心:负责页面抓取和解析。
  • 任务管理:支持批量爬取和任务调度。
  • 数据存储:提供多种数据持久化方案。

📦 安装指南

项目依赖以下组件:

  • Spring AI MCP Server
  • Spring Boot
  • Hutool

请确保在运行项目前安装好这些依赖。

💻 使用示例

接口使用

Crawl4aiApi 接口

crawl 方法
  • 功能:爬取指定 URL。
  • 参数
    • urls:目标网站地址列表。
    • strategy:爬取策略(如广度优先、深度优先)。
    • max_depth:最大爬取深度。
    • output_format:输出格式(如 JSON、XML)。
  • 返回:爬取结果的 JSON 字符串。
task 方法
  • 功能:获取指定任务的爬取结果。
  • 参数
    • taskId:任务唯一标识符。
  • 返回:爬取结果的 JSON 字符串。

示例配置

MCP Server 配置

{
  "mcpServers": {
    "jcrawl": {
      "autoApprove": ["crawl", "task"],
      "disabled": false,
      "timeout": 60,
      "command": "java",
      "args": [
        "-jar",
        "/path/to/jcrawl.jar"
      ],
      "transportType": "stdio"
    }
  }
}

📚 详细文档

配置

项目的配置文件位于 application.properties 中:

cawl4ai.base-url=
cawl4ai.api-token=

📄 联系方式

如需反馈或技术支持,请联系 Ken Ye

help

Runtime guide

cloud

Hosted runtime

Hosted servers run from a provider-managed environment. You usually connect the MCP client to the hosted endpoint or follow the provider's authorization flow, without keeping a local process alive

  1. Open provider connection page
  2. Authorize or copy endpoint
  3. Connect from your MCP client
terminal

Local runtime / other methods

Local servers run on your own machine or infrastructure. You normally copy the server_config into your MCP client, install the required package, and provide env variables from env_schema when needed

  1. Copy server_config
  2. Install required package
  3. Fill env variables and restart client