Crawlab MCP server

Integrates with Crawlab to enable AI-driven web scraping, task automation, and data extraction workflows through spider management, file operations, and resource access tools.
Back to servers
Provider
Crawlab Team
Release date
Mar 04, 2025
Language
Python
Stats
3 stars

The Crawlab MCP (Model Context Protocol) server provides a standardized interface for AI applications to interact with Crawlab's functionality. It enables AI systems to manage spiders, tasks, and files through natural language commands, serving as a bridge between AI applications and Crawlab's API.

Installation Options

Using Python Package

Install the MCP server as a Python package for an easy-to-use CLI:

# Install from source
pip install -e .

# Or install from GitHub (when available)
# pip install git+https://github.com/crawlab-team/crawlab-mcp-server.git

After installation, use the CLI to start the server or client:

# Start the MCP server
crawlab_mcp-mcp server [--spec PATH_TO_SPEC] [--host HOST] [--port PORT]

# Start the MCP client
crawlab_mcp-mcp client SERVER_URL

Running Locally

Prerequisites

  • Python 3.8+
  • Crawlab instance running and accessible
  • API token from Crawlab

Configuration

  1. Create your environment file:

    cp .env.example .env
    
  2. Configure your Crawlab API details:

    CRAWLAB_API_BASE_URL=http://your-crawlab-instance:8080/api
    CRAWLAB_API_TOKEN=your_api_token_here
    

Start the Server

  1. Install dependencies:

    pip install -r requirements.txt
    
  2. Run the server:

    python server.py
    

Using Docker

  1. Build the image:

    docker build -t crawlab-mcp-server .
    
  2. Run the container:

    docker run -p 8000:8000 --env-file .env crawlab-mcp-server
    

Docker Compose Integration

Add the MCP server to your existing Crawlab Docker Compose setup:

services:
  # ... existing Crawlab services
  
  mcp-server:
    build: ./backend/mcp-server
    ports:
      - "8000:8000"
    environment:
      - CRAWLAB_API_BASE_URL=http://backend:8000/api
      - CRAWLAB_API_TOKEN=your_api_token_here
    depends_on:
      - backend

Using with AI Applications

Connection Setup

  1. Start the MCP server and ensure it's accessible
  2. Configure your AI client to connect to your MCP server

Claude Desktop Integration

  1. Open Claude Desktop
  2. Navigate to Settings > MCP Servers
  3. Add a new server with your MCP server URL (e.g., http://localhost:8000)
  4. Start using Crawlab through natural language in your conversations

Example Interactions

Creating a Spider:

User: "Create a new spider named 'Product Scraper' for the e-commerce project"

Running a Task:

User: "Run the 'Product Scraper' spider on all available nodes"

Common Commands

You can interact using natural language phrases such as:

  • "List all my spiders"
  • "Create a new spider with these specifications..."
  • "Show me the code for the spider named X"
  • "Update the file main.py in spider X with this code..."
  • "Run spider X and notify me when it's complete"
  • "Show me the results of the last run of spider X"

Available Functionality

Resources

  • Spider management
  • Task management
  • File operations

Tools

Spider Management

  • Get spider details
  • Create new spiders
  • Update existing spiders
  • Delete spiders

Task Management

  • View task details
  • Run spiders
  • Cancel running tasks
  • Restart tasks
  • Access task logs

File Management

  • List spider files
  • View file contents
  • Save file content

How to add this MCP server to Cursor

There are two ways to add an MCP server to Cursor. The most common way is to add the server globally in the ~/.cursor/mcp.json file so that it is available in all of your projects.

If you only need the server in a single project, you can add it to the project instead by creating or adding it to the .cursor/mcp.json file.

Adding an MCP server to Cursor globally

To add a global MCP server go to Cursor Settings > MCP and click "Add new global MCP server".

When you click that button the ~/.cursor/mcp.json file will be opened and you can add your server like this:

{
    "mcpServers": {
        "cursor-rules-mcp": {
            "command": "npx",
            "args": [
                "-y",
                "cursor-rules-mcp"
            ]
        }
    }
}

Adding an MCP server to a project

To add an MCP server to a project you can create a new .cursor/mcp.json file or add it to the existing one. This will look exactly the same as the global MCP server example above.

How to use the MCP server

Once the server is installed, you might need to head back to Settings > MCP and click the refresh button.

The Cursor agent will then be able to see the available tools the added MCP server has available and will call them when it needs to.

You can also explictly ask the agent to use the tool by mentioning the tool name and describing what the function does.

Want to 10x your AI skills?

Get a free account and learn to code + market your apps using AI (with or without vibes!).

Nah, maybe later