Modal MCP Server

local-only server

The server can only run on the client’s local machine because it depends on local resources.

Integrations

  • Serves as the API framework for the MCP server, providing documentation at /docs endpoint and RESTful endpoints for tool invocation.

  • Provides repository access for the MCP server code, supporting installation via git clone from a GitHub repository.

  • Provides tools for deploying and running Modal applications in the cloud, allowing AI agents to deploy Modal apps and execute functions within Modal applications.

モーダルMCPサーバー

モーダル ボリュームと対話し、カーソル内からモーダル アプリケーションを展開するための MCP サーバー実装。

インストール

  1. このリポジトリをクローンします:
git clone https://github.com/smehmood/modal-mcp-server.git cd modal-mcp-server
  1. uvを使用して依存関係をインストールします。
uv sync

構成

Cursor でこの MCP サーバーを使用するには、 ~/.cursor/mcp.jsonに次の構成を追加します。

{ "mcpServers": { "modal-mcp-server": { "command": "uv", "args": [ "--project", "/path/to/modal-mcp-server", "run", "/path/to/modal-mcp-server/src/modal_mcp/server.py" ] } } }

/path/to/modal-mcp-serverクローンしたリポジトリへの絶対パスに置き換えます。

要件

  • Python 3.11以上
  • uvパッケージマネージャー
  • 有効な資格情報で構成されたモーダル CLI
  • モーダルデプロイのサポート:
    • デプロイされるプロジェクトは依存関係の管理にuvを使用する必要があります
    • モーダルはプロジェクトの仮想環境にインストールする必要があります

サポートされているツール

モーダルボリューム操作

  1. モーダルボリュームの一覧表示( list_modal_volumes )
    • 環境内のすべてのモーダルボリュームを一覧表示します
    • JSON形式のボリューム情報を返します
    • パラメータ: なし
  2. ボリュームの内容の一覧表示( list_modal_volume_contents )
    • モーダルボリューム内のファイルとディレクトリを一覧表示します
    • パラメータ:
      • volume_name : モーダルボリュームの名前
      • path : ボリューム内のパス(デフォルト: "/")
  3. ファイルのコピー( copy_modal_volume_files )
    • モーダルボリューム内のファイルをコピーします
    • パラメータ:
      • volume_name : モーダルボリュームの名前
      • paths : 最後のパスが宛先であるパスのリスト
    • 例: ["source.txt", "dest.txt"]または["file1.txt", "file2.txt", "dest_dir/"]
  4. ファイルを削除( remove_modal_volume_file )
    • モーダルボリュームからファイルまたはディレクトリを削除します
    • パラメータ:
      • volume_name : モーダルボリュームの名前
      • remote_path : 削除するファイル/ディレクトリへのパス
      • recursive : 再帰削除のブールフラグ(デフォルト: false)
  5. ファイルのアップロード( put_modal_volume_file )
    • ファイルまたはディレクトリをモーダルボリュームにアップロードします
    • パラメータ:
      • volume_name : モーダルボリュームの名前
      • local_path : アップロードするローカルファイル/ディレクトリへのパス
      • remote_path : アップロード先のボリューム内のパス(デフォルト: "/")
      • force : 既存のファイルを上書きするためのブールフラグ(デフォルト: false)
  6. ファイルをダウンロード( get_modal_volume_file )
    • モーダルボリュームからファイルをダウンロードします
    • パラメータ:
      • volume_name : モーダルボリュームの名前
      • remote_path : ダウンロードするボリューム内のファイル/ディレクトリへのパス
      • local_destination : ダウンロードしたファイルを保存するローカルパス(デフォルト: 現在のディレクトリ)
      • force : 既存のファイルを上書きするためのブールフラグ(デフォルト: false)
    • 注: ファイルの内容を標準出力に書き込むには、 local_destinationとして "-" を使用します。

モーダル展開

  1. モーダルアプリをデプロイする( deploy_modal_app )
    • モーダルアプリケーションを展開する
    • パラメータ:
      • absolute_path_to_app : モーダルアプリケーションファイルへの絶対パス
    • 注: モーダル アプリを含むプロジェクトでは次の条件を満たす必要があります。
      • 依存関係の管理にはuvを使用する
      • modal CLIを仮想環境にインストールする

応答フォーマット

すべてのツールは、操作の種類に応じて若干の違いはあるものの、標準化された形式で応答を返します。

# JSON operations (list volumes, list contents): { "success": True, "data": {...} # JSON data from Modal CLI } # File operations (put, get, copy, remove): { "success": True, "message": "Operation successful message", "command": "executed command string", "stdout": "command output", # if any "stderr": "error output" # if any } # Error case (all operations): { "success": False, "error": "Error message describing what went wrong", "command": "executed command string", # for file operations "stdout": "command output", # if available "stderr": "error output" # if available }

貢献

貢献を歓迎します!お気軽にプルリクエストを送信してください。

ライセンス

このプロジェクトは MIT ライセンスに基づいてライセンスされています - 詳細についてはLICENSEファイルを参照してください。

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

AI エージェントが Modal と対話し、サーバーレス クラウド環境でアプリを展開して機能を実行できるようにする MCP サーバー。

  1. Installation
    1. Configuration
      1. Requirements
        1. Supported Tools
          1. Modal Volume Operations
          2. Modal Deployment
        2. Response Format
          1. Contributing
            1. License
              ID: gmerfou61f