Skip to main content
Glama
webscraping-ai

WebScraping-AI MCP Server

Official

WebScraping.AI MCPサーバー

Web データ抽出機能のためにWebScraping.AIと統合するモデル コンテキスト プロトコル (MCP) サーバー実装。

特徴

  • ウェブページの内容に関する質問への回答

  • ウェブページからの構造化データ抽出

  • JavaScript レンダリングによる HTML コンテンツの取得

  • ウェブページからのプレーンテキスト抽出

  • CSSセレクタベースのコンテンツ抽出

  • 国を選択できる複数のプロキシタイプ(データセンター、住宅)

  • ヘッドレス Chrome/Chromium を使用した JavaScript レンダリング

  • レート制限による同時リクエスト管理

  • 対象ページでのカスタム JavaScript 実行

  • デバイスエミュレーション(デスクトップ、モバイル、タブレット)

  • アカウント使用状況の監視

Related MCP server: baidu-ai-search

インストール

npxで実行

env WEBSCRAPING_AI_API_KEY=your_api_key npx -y webscraping-ai-mcp

手動インストール

# Clone the repository
git clone https://github.com/webscraping-ai/webscraping-ai-mcp-server.git
cd webscraping-ai-mcp-server

# Install dependencies
npm install

# Run
npm start

カーソルでの設定

注: カーソルバージョン 0.45.6 以上が必要です

WebScraping.AI MCP サーバーは、Cursor で 2 つの方法で構成できます。

  1. プロジェクト固有の構成(チーム プロジェクトに推奨): プロジェクト ディレクトリに.cursor/mcp.jsonファイルを作成します。

    {
      "servers": {
        "webscraping-ai": {
          "type": "command",
          "command": "npx -y webscraping-ai-mcp",
          "env": {
            "WEBSCRAPING_AI_API_KEY": "your-api-key",
            "WEBSCRAPING_AI_CONCURRENCY_LIMIT": "5"
          }
        }
      }
    }
  2. グローバル構成(すべてのプロジェクトでの個人使用): 上記と同じ構成形式で、ホーム ディレクトリに~/.cursor/mcp.jsonファイルを作成します。

Windows を使用していて問題が発生している場合は、コマンドとしてcmd /c "set WEBSCRAPING_AI_API_KEY=your-api-key && npx -y webscraping-ai-mcp"を使用してみてください。

この構成により、Web スクレイピング タスクに関連する場合に、WebScraping.AI ツールが Cursor の AI エージェントで自動的に使用できるようになります。

Claude Desktopで実行中

これをclaude_desktop_config.jsonに追加します:

{
  "mcpServers": {
    "mcp-server-webscraping-ai": {
      "command": "npx",
      "args": ["-y", "webscraping-ai-mcp"],
      "env": {
        "WEBSCRAPING_AI_API_KEY": "YOUR_API_KEY_HERE",
        "WEBSCRAPING_AI_CONCURRENCY_LIMIT": "5"
      }
    }
  }
}

構成

環境変数

必須

  • WEBSCRAPING_AI_API_KEY : WebScraping.AI APIキー

    • すべての操作に必要

    • WebScraping.AIからAPIキーを取得する

オプション構成

  • WEBSCRAPING_AI_CONCURRENCY_LIMIT : 同時リクエストの最大数(デフォルト: 5

  • WEBSCRAPING_AI_DEFAULT_PROXY_TYPE : 使用するプロキシの種類(デフォルト: residential

  • WEBSCRAPING_AI_DEFAULT_JS_RENDERING : JavaScript レンダリングを有効/無効にする (デフォルト: true )

  • WEBSCRAPING_AI_DEFAULT_TIMEOUT : ウェブページの最大取得時間(ミリ秒)(デフォルト: 15000 、最大: 30000

  • WEBSCRAPING_AI_DEFAULT_JS_TIMEOUT : JavaScript レンダリングの最大時間(ミリ秒)(デフォルト: 2000

設定例

標準的な使用法:

# Required
export WEBSCRAPING_AI_API_KEY=your-api-key

# Optional - customize behavior (default values)
export WEBSCRAPING_AI_CONCURRENCY_LIMIT=5
export WEBSCRAPING_AI_DEFAULT_PROXY_TYPE=residential # datacenter or residential
export WEBSCRAPING_AI_DEFAULT_JS_RENDERING=true
export WEBSCRAPING_AI_DEFAULT_TIMEOUT=15000
export WEBSCRAPING_AI_DEFAULT_JS_TIMEOUT=2000

利用可能なツール

1. 質問ツール ( webscraping_ai_question )

Web ページのコンテンツについて質問します。

{
  "name": "webscraping_ai_question",
  "arguments": {
    "url": "https://example.com",
    "question": "What is the main topic of this page?",
    "timeout": 30000,
    "js": true,
    "js_timeout": 2000,
    "wait_for": ".content-loaded",
    "proxy": "datacenter",
    "country": "us"
  }
}

応答例:

{
  "content": [
    {
      "type": "text",
      "text": "The main topic of this page is examples and documentation for HTML and web standards."
    }
  ],
  "isError": false
}

2. フィールドツール( webscraping_ai_fields

指示に基づいて Web ページから構造化データを抽出します。

{
  "name": "webscraping_ai_fields",
  "arguments": {
    "url": "https://example.com/product",
    "fields": {
      "title": "Extract the product title",
      "price": "Extract the product price",
      "description": "Extract the product description"
    },
    "js": true,
    "timeout": 30000
  }
}

応答例:

{
  "content": [
    {
      "type": "text",
      "text": {
        "title": "Example Product",
        "price": "$99.99",
        "description": "This is an example product description."
      }
    }
  ],
  "isError": false
}

3. HTMLツール( webscraping_ai_html

JavaScript レンダリングを使用して Web ページの完全な HTML を取得します。

{
  "name": "webscraping_ai_html",
  "arguments": {
    "url": "https://example.com",
    "js": true,
    "timeout": 30000,
    "wait_for": "#content-loaded"
  }
}

応答例:

{
  "content": [
    {
      "type": "text",
      "text": "<html>...[full HTML content]...</html>"
    }
  ],
  "isError": false
}

4. テキストツール ( webscraping_ai_text )

Web ページから表示されているテキスト コンテンツを抽出します。

{
  "name": "webscraping_ai_text",
  "arguments": {
    "url": "https://example.com",
    "js": true,
    "timeout": 30000
  }
}

応答例:

{
  "content": [
    {
      "type": "text",
      "text": "Example Domain\nThis domain is for use in illustrative examples in documents..."
    }
  ],
  "isError": false
}

5. 選択されたツール ( webscraping_ai_selected )

CSS セレクターを使用して特定の要素からコンテンツを抽出します。

{
  "name": "webscraping_ai_selected",
  "arguments": {
    "url": "https://example.com",
    "selector": "div.main-content",
    "js": true,
    "timeout": 30000
  }
}

応答例:

{
  "content": [
    {
      "type": "text",
      "text": "<div class=\"main-content\">This is the main content of the page.</div>"
    }
  ],
  "isError": false
}

6. 複数選択ツール ( webscraping_ai_selected_multiple )

CSS セレクターを使用して複数の要素からコンテンツを抽出します。

{
  "name": "webscraping_ai_selected_multiple",
  "arguments": {
    "url": "https://example.com",
    "selectors": ["div.header", "div.product-list", "div.footer"],
    "js": true,
    "timeout": 30000
  }
}

応答例:

{
  "content": [
    {
      "type": "text",
      "text": [
        "<div class=\"header\">Header content</div>",
        "<div class=\"product-list\">Product list content</div>",
        "<div class=\"footer\">Footer content</div>"
      ]
    }
  ],
  "isError": false
}

7. アカウントツール( webscraping_ai_account

WebScraping.AI アカウントに関する情報を取得します。

{
  "name": "webscraping_ai_account",
  "arguments": {}
}

応答例:

{
  "content": [
    {
      "type": "text",
      "text": {
        "requests": 5000,
        "remaining": 4500,
        "limit": 10000,
        "resets_at": "2023-12-31T23:59:59Z"
      }
    }
  ],
  "isError": false
}

すべてのツールに共通するオプション

次のオプションは、すべてのスクレイピング ツールで使用できます。

  • timeout : ウェブページの最大取得時間(ミリ秒)(デフォルトは15000、最大値は30000)

  • js : ヘッドレスブラウザを使用してページ上の JavaScript を実行します(デフォルトでは true)

  • js_timeout : JavaScript レンダリングの最大時間(ミリ秒)(デフォルトは 2000)

  • wait_for : ページコンテンツを返す前に待機する CSS セレクタ

  • proxy : プロキシの種類、データセンターまたは住宅(デフォルトは住宅)

  • country : 使用するプロキシの国(デフォルトは米国)。サポートされている国: us、gb、de、it、fr、ca、es、ru、jp、kr、in

  • custom_proxy : 「 http://user:password@host:port 」形式の独自のプロキシ URL

  • device : デバイスエミュレーションの種類。サポートされる値: デスクトップ、モバイル、タブレット

  • error_on_404 : 対象ページの 404 HTTP ステータスでエラーを返します (デフォルトでは false)

  • error_on_redirect : 対象ページでのリダイレクト時にエラーを返す(デフォルトは false)

  • js_script : 対象ページで実行するカスタム JavaScript コード

エラー処理

サーバーは堅牢なエラー処理を提供します。

  • 一時的なエラーの自動再試行

  • バックオフによるレート制限の処理

  • 詳細なエラーメッセージ

  • ネットワークの回復力

エラー応答の例:

{
  "content": [
    {
      "type": "text",
      "text": "API Error: 429 Too Many Requests"
    }
  ],
  "isError": true
}

LLMとの統合

このサーバーはモデルコンテキストプロトコル(MCP)を実装しており、MCP対応のLLMプラットフォームと互換性があります。これらのツールをWebスクレイピングタスクに使用するようにLLMを設定できます。

例: MCP を使用した Claude の設定

const { Claude } = require('@anthropic-ai/sdk');
const { Client } = require('@modelcontextprotocol/sdk/client/index.js');
const { StdioClientTransport } = require('@modelcontextprotocol/sdk/client/stdio.js');

const claude = new Claude({
  apiKey: process.env.ANTHROPIC_API_KEY
});

const transport = new StdioClientTransport({
  command: 'npx',
  args: ['-y', 'webscraping-ai-mcp'],
  env: {
    WEBSCRAPING_AI_API_KEY: 'your-api-key'
  }
});

const client = new Client({
  name: 'claude-client',
  version: '1.0.0'
});

await client.connect(transport);

// Now you can use Claude with WebScraping.AI tools
const tools = await client.listTools();
const response = await claude.complete({
  prompt: 'What is the main topic of example.com?',
  tools: tools
});

発達

# Clone the repository
git clone https://github.com/webscraping-ai/webscraping-ai-mcp-server.git
cd webscraping-ai-mcp-server

# Install dependencies
npm install

# Run tests
npm test

# Add your .env file
cp .env.example .env

# Start the inspector
npx @modelcontextprotocol/inspector node src/index.js

貢献

  1. リポジトリをフォークする

  2. 機能ブランチを作成する

  3. テストを実行: npm test

  4. プルリクエストを送信する

ライセンス

MITライセンス - 詳細はLICENSEファイルを参照

Install Server
A
security – no known vulnerabilities
F
license - not found
A
quality - confirmed to work

Resources

Looking for Admin?

Admins can modify the Dockerfile, update the server description, and track usage metrics. If you are the server author, to access the admin panel.

Latest Blog Posts

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/webscraping-ai/webscraping-ai-mcp-server'

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