MCP Web Tools Server

hybrid server

The server is able to function both locally and remotely, depending on the configuration or use case.

Integrations

  • Converts scraped web content into markdown format for easier processing by Claude

  • Explicitly mentioned as an example website whose content can be fetched and summarized using the web_scrape tool

  • Provides a UI for connecting to and testing MCP servers, including viewing available tools and executing them

MCP Webツールサーバー

Web関連の操作ツールを提供するモデルコンテキストプロトコル(MCP)サーバー。このサーバーにより、LLMは標準化されたツールを通じてWebコンテンツを操作できるようになります。

現在のツール

  • web_scrape : URLをr.jina.aiをプレフィックスとして変換し、マークダウンコンテンツを返します。

インストール

  1. このリポジトリをクローンします:
    git clone <repository-url> cd MCP
  2. 必要な依存関係をインストールします。
    pip install -r requirements.txt
    あるいは、より高速なインストールのためにuv を使用することもできます。
    uv pip install -r requirements.txt

サーバーとUIの実行

このリポジトリには、MCP サーバーまたは Streamlit UI を実行するための便利なスクリプトが含まれています。

実行スクリプトの使用

macOS/Linuxの場合:

# Run the server with stdio transport (default) ./run.sh server # Run the server with SSE transport ./run.sh server --transport sse --host localhost --port 5000 # Run the Streamlit UI ./run.sh ui

Windowsの場合:

# Run the server with stdio transport (default) run.bat server # Run the server with SSE transport run.bat server --transport sse --host localhost --port 5000 # Run the Streamlit UI run.bat ui

手動で実行

あるいは、サーバーを直接実行することもできます。

stdio を使用する (デフォルト)

python server.py

SSEの使用

python server.py --transport sse --host localhost --port 5000

これにより、MCP 接続を受け入れるlocalhost:5000上の HTTP サーバーが起動します。

Streamlit UI を手動で実行するには:

streamlit run streamlit_app.py

MCP Inspectorによるテスト

MCP Inspectorは、MCPサーバーのテストとデバッグのためのツールです。これを使用してサーバーと対話することができます。

  1. MCP Inspector をインストールします。
    npm install -g @modelcontextprotocol/inspector
  2. サーバーで Inspector を実行します。
    npx @modelcontextprotocol/inspector python server.py
  3. Inspector インターフェースを使用して、 example.comなどの URL を指定し、返されたマークダウン コンテンツを表示することで、 web_scrapeツールをテストします。

Claude for Desktopとの統合

このサーバーをClaude for Desktopで使用するには:

  1. Claude for Desktopがインストールされていることを確認してください。
  2. Claude for Desktop 構成ファイルを開きます。
    • Mac: ~/Library/Application Support/Claude/claude_desktop_config.json
    • Windows: %APPDATA%\Claude\claude_desktop_config.json
  3. 次の構成を追加します (必要に応じてパスを調整します)。
{ "mcpServers": { "web-tools": { "command": "python", "args": [ "/absolute/path/to/MCP/server.py" ] } } }
  1. Claude for Desktop を再起動します。
  2. Claudeのインターフェースにweb_scrapeツールが表示されるようになりました。Claudeにウェブサイトからコンテンツを取得するよう指示すると、このツールが使われます。

使用例

Claude と統合すると、次のような質問をすることができます。

  • 「example.com のホームページには何があるのですか?」
  • 「mozilla.org からコンテンツを取得して要約してもらえますか?」
  • 「wikipedia.org/wiki/Model_Context_Protocol からコンテンツを取得して説明してください。」

Claude は web_scrape ツールを使用してコンテンツを取得し、それを応答で提供します。

ツールの追加

このサーバーにさらにツールを追加するには:

  1. tools/ディレクトリに新しい Python ファイル (例: tools/new_tool.pyを作成します。
  2. 既存のツールと同様のパターンに従って、ツール機能を実装します。
  3. server.pyにツールをインポートし、MCP サーバーに登録します。
# Import your new tool from tools.new_tool import new_tool_function # Register the tool with the MCP server @mcp.tool() async def new_tool(param1: str, param2: int) -> str: """ Description of what your tool does. Args: param1: Description of param1 param2: Description of param2 Returns: Description of return value """ return await new_tool_function(param1, param2)
  1. 変更を適用するにはサーバーを再起動します。

流線型のUI

このリポジトリには、Claude for Desktop で構成されているすべての MCP サーバーに接続してテストできる Streamlit アプリケーションが含まれています。

Streamlit UIの実行

streamlit run streamlit_app.py

これにより、Streamlit サーバーが起動し、UI 付きの Web ブラウザーが開きます。

特徴

  • Claude for Desktop 構成ファイルを読み込み、解析します。
  • 構成されたすべてのMCPサーバーを表示
  • 任意のサーバーに接続し、利用可能なツールを表示します
  • 入力パラメータを指定して結果を表示するテストツール
  • 利用可能なリソースとプロンプトを表示する

使用法

  1. Streamlitアプリを起動する
  2. Claude for Desktop 構成ファイルへのパスを入力します (デフォルトのパスは事前に入力されています)
  3. 「サーバーをロード」をクリックすると、利用可能なすべてのMCPサーバーが表示されます。
  4. サーバータブを選択し、「接続」をクリックしてツールを読み込みます
  5. ツールを選択し、必要なパラメータを入力します
  6. 「実行」をクリックしてツールを実行し、結果を確認します。

トラブルシューティング

  • 依存関係が不足しています: requirements.txt内のすべての依存関係がインストールされていることを確認してください。
  • 接続の問題: サーバーが実行中であること、および Claude for Desktop の構成が正しいパスを指していることを確認します。
  • ツール実行エラー: サーバー出力でエラー メッセージを探します。
  • Streamlit UI の問題: Streamlit が正しくインストールされ、構成ファイルのパスが正しいことを確認してください。

ライセンス

このプロジェクトはMITライセンスの下で利用可能です。詳細はLICENSEファイルをご覧ください。

-
security - not tested
A
license - permissive license
-
quality - not tested

LLM が標準化されたツールを通じて Web コンテンツと対話できるようにするモデル コンテキスト プロトコル サーバー。現在、Web スクレイピング機能をサポートしています。

  1. Current Tools
    1. Installation
      1. Running the Server and UI
        1. Using the Run Scripts
        2. Running Manually
      2. Testing with MCP Inspector
        1. Integrating with Claude for Desktop
          1. Example Usage
            1. Adding More Tools
              1. Streamlit UI
                1. Running the Streamlit UI
                2. Features
                3. Usage
              2. Troubleshooting
                1. License
                  ID: cn5q63wd5r