Skip to main content
Glama

Crawlab MCP サーバー

これは Crawlab のモデル コンテキスト プロトコル (MCP) サーバーであり、AI アプリケーションが Crawlab の機能と対話できるようにします。

概要

MCP サーバーは、AI アプリケーションが Crawlab の機能にアクセスするための標準化された方法を提供します。これには以下が含まれます。

  • スパイダー管理(作成、読み取り、更新、削除)

  • タスク管理(実行、キャンセル、再開)

  • ファイル管理(読み取り、書き込み)

  • リソース アクセス (スパイダー、タスク)

建築

MCP サーバー/クライアント アーキテクチャは、AI アプリケーションと Crawlab 間の通信を容易にします。

graph TB User[User] --> Client[MCP Client] Client --> LLM[LLM Provider] Client <--> Server[MCP Server] Server <--> Crawlab[Crawlab API] subgraph "MCP System" Client Server end subgraph "Crawlab System" Crawlab DB[(Database)] Crawlab <--> DB end class User,LLM,Crawlab,DB external; class Client,Server internal; %% Flow annotations LLM -.-> |Tool calls| Client Client -.-> |Executes tool calls| Server Server -.-> |API requests| Crawlab Crawlab -.-> |API responses| Server Server -.-> |Tool results| Client Client -.-> |Human-readable response| User classDef external fill:#f9f9f9,stroke:#333,stroke-width:1px; classDef internal fill:#d9edf7,stroke:#31708f,stroke-width:1px;

コミュニケーションフロー

  1. ユーザークエリ: ユーザーはMCPクライアントに自然言語クエリを送信します。

  2. LLM処理: クライアントはクエリをLLMプロバイダー(例:Claude、OpenAI)に転送します。

  3. ツール選択: LLMは必要なツールを識別し、ツール呼び出しを生成します

  4. ツール実行: クライアントはツール呼び出しをMCPサーバーに送信します。

  5. APIインタラクション: サーバーは対応するCrawlab APIリクエストを実行します。

  6. レスポンス生成: 結果はサーバーを経由してクライアントへ、そしてLLMへ返されます。

  7. ユーザーの応答: クライアントは最終的な人間が読める応答をユーザーに配信します。

インストールと使用方法

オプション1: Pythonパッケージとしてインストールする

便利な CLI を提供する Python パッケージとして MCP サーバーをインストールできます。

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

インストール後、CLI を使用できます。

# 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

オプション2: ローカルで実行

前提条件

  • Python 3.8以上

  • Crawlab インスタンスが実行中でありアクセス可能

  • CrawlabからのAPIトークン

構成

  1. .env.exampleファイルを.envにコピーします。

    cp .env.example .env
  2. Crawlab API の詳細を使用して.envファイルを編集します。

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

ローカルで実行

  1. 依存関係をインストールします:

    pip install -r requirements.txt
  2. サーバーを実行します。

    python server.py

Dockerで実行する

  1. Docker イメージをビルドします。

    docker build -t crawlab-mcp-server .
  2. コンテナを実行します。

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

Docker Composeとの統合

既存の Crawlab Docker Compose セットアップに MCP サーバーを追加するには、次のサービスをdocker-compose.ymlに追加します。

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

AIアプリケーションでの使用

MCPサーバーは、AIアプリケーションが自然言語を介してCrawlabと対話することを可能にします。上記のアーキテクチャ図に従って、MCPシステムの使用方法は以下のとおりです。

接続の設定

  1. MCPサーバーを起動します。MCPサーバーが実行中でアクセス可能であることを確認します。

  2. AIクライアントを構成する: AIアプリケーションをMCPサーバーに接続する

例: Claude Desktop での使用

  1. クロードデスクトップを開く

  2. 設定 > MCPサーバーへ移動

  3. MCP サーバーの URL (例: http://localhost:8000 ) を使用して新しいサーバーを追加します。

  4. クロードとの会話では、自然言語でやりたいことを説明することで、Crawlabの機能を使用できるようになりました。

やり取りの例

私たちのアーキテクチャに基づいた、システムとのやり取りの例を以下に示します。

スパイダーを作成する:

User: "Create a new spider named 'Product Scraper' for the e-commerce project" ↓ LLM identifies intent and calls the create_spider tool ↓ MCP Server executes the API call to Crawlab ↓ Spider is created and details are returned to the user

タスクを実行する:

User: "Run the 'Product Scraper' spider on all available nodes" ↓ LLM calls the run_spider tool with appropriate parameters ↓ MCP Server sends the command to Crawlab API ↓ Task is started and confirmation is returned to the user

利用可能なコマンド

次のような自然言語コマンドを使用してシステムと対話できます。

  • 「私のクモをすべてリストする」

  • 「これらの仕様で新しいスパイダーを作成します...」

  • 「Xという名のクモのコードを見せてください」

  • 「このコードを使用して、Spider X の main.py ファイルを更新します...」

  • 「スパイダーXを実行し、完了したら通知してください」

  • 「スパイダーXの最後の実行結果を見せてください」

利用可能なリソースとツール

これらは、自然言語によるやりとりを可能にする基礎となるツールです。

リソース

  • spiders : すべてのクモを一覧表示

  • tasks : すべてのタスクを一覧表示する

ツール

クモ管理

  • get_spider : 特定のスパイダーの詳細を取得する

  • create_spider : 新しいスパイダーを作成する

  • update_spider : 既存のスパイダーを更新する

  • delete_spider : スパイダーを削除する

タスク管理

  • get_task : 特定のタスクの詳細を取得する

  • run_spider : スパイダーを実行する

  • cancel_task : 実行中のタスクをキャンセルする

  • restart_task : タスクを再開する

  • get_task_logs : タスクのログを取得する

ファイル管理

  • get_spider_files : スパイダーのファイルを一覧表示する

  • get_spider_file : 特定のファイルの内容を取得する

  • save_spider_file : コンテンツをファイルに保存する

-
security - not tested
F
license - not found
-
quality - not tested

Related MCP Servers

  • A
    security
    A
    license
    A
    quality
    A production-ready Model Context Protocol server that enables language models to leverage AI-powered web scraping capabilities, offering tools for transforming webpages to markdown, extracting structured data, and executing AI-powered web searches.
    Last updated -
    5
    45
    MIT License
    • Apple
  • A
    security
    A
    license
    A
    quality
    A Model Context Protocol server that enables web search, scraping, crawling, and content extraction through multiple engines including SearXNG, Firecrawl, and Tavily.
    Last updated -
    4
    52
    61
    MIT License
  • -
    security
    A
    license
    -
    quality
    A Model Context Protocol server that enables AI assistants to perform advanced web scraping, crawling, searching, and data extraction through the Firecrawl API.
    Last updated -
    32,387
    MIT License
    • Apple
    • Linux
  • A
    security
    F
    license
    A
    quality
    A Model Context Protocol server that enables AI assistants to perform real-time web searches, retrieving up-to-date information from the internet via a Crawler API.
    Last updated -
    1
    43
    19
    • Apple
    • Linux

View all related MCP servers

MCP directory API

We provide all the information about MCP servers via our MCP API.

curl -X GET 'https://glama.ai/api/mcp/v1/servers/crawlab-team/crawlab-mcp'

If you have feedback or need assistance with the MCP directory API, please join our Discord server