Web2mcpのロゴ

Web2mcp

コミュニティ
neelsomani

Generate an MCP for any web app

公開者neelsomani
リポジトリweb2mcp
言語TypeScript
フォーク
6
スター
57
利用可能なツール
0
通信方式stdio
ライセンスMIT
リンク
  • ツールをAIワークフローに接続

    Web2mcpは、対応するAIクライアントやAIエージェントから利用できるMCP機能を提供します。

  • 0個の利用可能なツール

    呼び出し可能なアクションを以下で確認できます。サーバーから提供されている場合は、名前や説明も表示されます。

  • コピーして使える設定

    セットアップ用の設定例を使って、お好みのMCPクライアントにこのサーバーを設定できます。

  • オープンソースの注目度

    リンク先のリポジトリには57件のスターと6件のフォークがあります。

web2mcp

A system that automatically generates expressive Model Context Protocol (MCP) implementations for any web application (SaaS or consumer-facing).

Problem Statement

Design a system that, given any web application (SaaS or consumer-facing), can automatically generate an expressive Model Control Protocol (MCP) implementation.

This is a fairly hard problem for (at least) three reasons:

  • Behavior tree size: Apps have many buttons and pages. We must traverse at least the important subset of these buttons and pages to establish an application's capabilities.

  • Semantic gap: While links/buttons can be easily identified, it's not clear when these links/buttons correspond to a meaningful tool to expose via the MCP. Similarly, what textual information on the page is relevant for read operations?

  • Under-specified hierarchy: We must infer the object hierarchy. What are the "resources" that the MCP should allow agents to act on? Which tools correspond to which resources?

I break the problem into two separate tasks: (1) define the MCP specification and (2) implement the specification.

Installation

Prerequisites

  1. Python Dependencies (for the test application):

    bash
    cd test
    pip3 install -r requirements.txt
  2. Node.js Setup:

    bash
    nvm use 18
    npm install
  3. Environment Variables:

    bash
    cp .env.example .env

    Then edit .env and set the following variables:

    bash
    BROWSERBASE_PROJECT_ID="YOUR_BROWSERBASE_PROJECT_ID"
    BROWSERBASE_API_KEY="YOUR_BROWSERBASE_API_KEY"
    OPENAI_API_KEY="THIS_IS_OPTIONAL_WITH_OPENAI_KEY"
    # SPA Crawler Configuration
    SPA_CRAWLER_URL="http://localhost:8000"
    SPA_CRAWLER_USERNAME="example@example.com"
    SPA_CRAWLER_PASSWORD="password123"
    SPA_CRAWLER_MAX_DEPTH="1"
    SPA_CRAWLER_ENV="LOCAL"

    By default, the SPA_* environment variables work for the demo app.

Getting Started

Example MCP Implementation

You can try a derived MCP for the demo email application:

  1. Run the demo app:

    bash
    cd test
    python3 app.py
  2. In a new terminal in the root directory:

    bash
    npm run build:mcp
    npx @modelcontextprotocol/inspector node dist/dynamicMcpServer.js test/exampleMcpConfig.json test/exampleSummaryPageActions.json
  3. Try the MCP in the launched browser window

Example MCP Derivation

  1. Start the demo app:

    bash
    cd test
    python3 app.py
  2. In the root directory, run the crawler:

    bash
    npx tsx spaCrawler.ts
  3. The resulting output is in outputMcpConfig.json and outputSummaryPageActions.json

  4. Use those with the MCP server:

    bash
    npm run build:mcp
    node dist/dynamicMcpServer.js outputMcpConfig.json outputSummaryPageActions.json

Project Structure

  • spaCrawler.ts - Main crawler that analyzes web applications and generates MCP configurations
  • dynamicMcpServer.ts - Dynamic MCP server implementation
  • sharedUtils.ts - Shared utilities for the project
  • test/ - Demo Flask application for testing
    • app.py - Simple email application demo
    • exampleMcpConfig.json - Example MCP configuration
    • exampleSummaryPageActions.json - Example page action definitions

How It Works

The system works in two phases:

  1. Analysis Phase: The spaCrawler.ts analyzes a web application by:

    • Crawling through pages and identifying interactive elements
    • Inferring the application's object hierarchy
    • Determining which actions correspond to meaningful MCP tools
    • Generating configuration files that define the MCP interface
  2. Execution Phase: The dynamicMcpServer.ts provides:

    • A dynamic MCP server that loads configurations at runtime
    • Tool execution that translates MCP calls into web application actions
    • Real-time interaction with the target web application

Development

Building

bash
npm run build:mcp

Running in Development

bash
npx tsx spaCrawler.ts
npx tsx dynamicMcpServer.ts

Testing with MCP Inspector

bash
npx @modelcontextprotocol/inspector node dist/dynamicMcpServer.js config.json actions.json

License

See LICENSE.txt for details.

Web2mcpのMCPを複数のAIモデルで活用

TypingMindはワークスペース単位でMCPツールに接続します。そのため、一度Web2mcpに接続すれば、モデルごとに個別に設定することなく、TypingMind内のさまざまなAIモデルで利用できます。 このMCPは、デバイス上のTypingMind MCPコネクタを通じてローカルで動作します。

ローカルコネクタのセットアップガイド

MCPサーバーが、お使いのコンピューター上のローカルファイル、アプリ、非公開リソースにアクセスする必要がある場合は、この方法を使います。

1

MCP設定を開く

TypingMindで「設定」、「詳細設定」、「MCP」の順に進み、「コネクタを設定」を選択してください。

  1. ブラウザでTypingMindを開いてください。
  2. 設定アイコンをクリックしてください。
  3. 「詳細設定」に移動してください。
  4. 「MCP」セクションを開いてください。
  5. 「コネクタを設定」をクリックし、「このデバイス」を選択してください。
「このデバイス」が選択されたTypingMindのMCPコネクタ設定画面
2

コネクタのコマンドを実行

「このデバイス」を選択し、TypingMindからコマンドをコピーしてターミナルで実行してください。MCPの使用中は、プロセスを実行したままにしてください。

  1. TypingMindに表示されるセットアップコマンドをコピーしてください。
  2. macOSではターミナルを、WindowsではWindows Terminalを開いてください。
  3. コマンドを貼り付けて実行してください。
  4. ターミナルで続行の確認を求められた場合は、パッケージのインストールを承認してください。
  5. MCPツールの使用中は、ターミナルウィンドウを開いたまま、プロセスの実行を継続してください。
3

Web2mcpをサーバーとして追加

コネクタのステータスが「準備完了」になったら、「サーバーを編集」をクリックし、MCPサーバーの設定を貼り付けてください。

  1. コネクタのステータスが「準備完了」になるまでお待ちください。
  2. 「サーバーを編集」をクリックしてください。
  3. Web2mcpのMCPサーバー設定を貼り付けてください。
  4. サーバー一覧を保存してください。
  5. コネクタが引き続き使用可能か確認するには、更新してください。
稼働中のサーバーと「サーバーを編集」ボタンが表示されたTypingMindのMCP設定画面
{
  "mcpServers": {
    "web2mcp": {
      "command": "npx",
      "args": [
        "-y",
        "<mcp-server-package>"
      ]
    }
  }
}
4

複数のモデルで同じ接続を使用

サーバー一覧を保存し、「プラグイン」を開いてWeb2mcpのMCPツールを有効にしてください。その後、TypingMindで対応するAIモデルを選択し、チャットでツールを使うか、AIエージェントに割り当ててください。

  1. TypingMindの「プラグイン」ページを開いてください。
  2. Web2mcpのMCPツールを有効にしてください。
  3. チャットを開始し、使用するAIモデルを選択してください。
  4. MCPツールをチャットで使うか、AIエージェントに割り当ててください。
  5. MCPに再接続することなく、必要に応じて別のAIモデルに切り替えられます。
選択したAIモデルと有効なMCPツールを使用したTypingMindのチャット
Web2mcpを使ってこのタスクを手伝ってもらえますか?
Web2mcp
はい、読みました。
Web2mcpで調べた結果をお伝えします。

よくある質問

Web2mcp MCPサーバーは何に使いますか?

Web2mcpは、対応するAIクライアントを外部ツールやコンテキストに接続するためのMCPサーバーです。TypingMindでは、このMCPサーバーを一度追加するだけで、AIワークスペース内でそのツールを利用できるようになります。

TypingMindでWeb2mcp MCPを複数のAIモデルと併用できますか?

はい。TypingMindはワークスペース単位でMCPツールに接続するため、モデルごとにMCPサーバーを設定する必要はありません。Claude、ChatGPT、Geminiや、TypingMindで設定したその他のAIモデルでWeb2mcpを利用できます。

TypingMindでWeb2mcp MCPを使うメリットは何ですか?

TypingMindは、複数のAIモデル、プロンプト、プラグイン、AIエージェント、APIキー、MCPツールを1つのワークスペースにまとめられる、LLMチャット向けの優れたフロントエンドです。Web2mcpを接続すると、TypingMindでチャットのワークフローを整理しながら、お好みのモデルでそのMCPツールを利用できます。

Web2mcp MCPをTypingMindに接続するにはどうすればよいですか?

Web2mcpはTypingMindのローカルMCPコネクタ経由で動作します。MCPサーバーがコンピューター上のローカルファイル、デスクトップアプリ、コマンドラインツール、プライベートリソースにアクセスする必要がある場合に最適です。

TypingMindでWeb2mcp MCPのどのようなツールを利用できますか?

Web2mcpはMCP機能を提供しています。TypingMindのプラグインページで有効にすると、チャットで使用したり、AIエージェントに割り当てたりできます。

Web2mcp MCPを使うには、APIキーをTypingMindと共有する必要がありますか?

いいえ。TypingMindはローカルファーストの設計で、モデルプロバイダー、APIキー、プロンプト、MCP設定をご自身で管理できます。Web2mcpで認証が必要な場合は、接続の作成時に、そのMCPサーバーに必要なヘッダー、OAuth設定、またはローカル設定を追加してください。

関連するMCPサーバー

すべて見る

今すぐ自分専用のAIワークスペースを作成

ニュースレターに登録すると、新機能や今後のプレゼント企画のお知らせが届きます👇