Skip to main content
Glama

模态 MCP 服务器

用于与 Modal 卷交互并从 Cursor 内部部署 Modal 应用程序的 MCP 服务器实现。

安装

  1. 克隆此存储库:

git clone https://github.com/smehmood/modal-mcp-server.git cd modal-mcp-server
  1. 使用uv安装依赖项:

uv sync

Related MCP server: MCP Shell Server

配置

要在 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进行依赖管理

    • Modal 必须安装在项目的虚拟环境中

支持的工具

模态体积操作

  1. 列出模态体积list_modal_volumes

    • 列出您环境中的所有 Modal 卷

    • 返回 JSON 格式的卷信息

    • 参数:无

  2. 列出卷内容list_modal_volume_contents

    • 列出 Modal 卷中的文件和目录

    • 参数:

      • volume_name :Modal卷的名称

      • path :卷内的路径(默认值:“/”)

  3. 复制文件copy_modal_volume_files

    • 复制 Modal 卷内的文件

    • 参数:

      • volume_name :Modal卷的名称

      • paths :最后一条路径为目的地的路径列表

    • 例如: ["source.txt", "dest.txt"]["file1.txt", "file2.txt", "dest_dir/"]

  4. 删除文件remove_modal_volume_file

    • 从 Modal 卷中删除文件或目录

    • 参数:

      • volume_name :Modal卷的名称

      • remote_path :要删除的文件/目录的路径

      • recursive :递归删除的布尔标志(默认值:false)

  5. 上传文件put_modal_volume_file

    • 将文件或目录上传到 Modal 卷

    • 参数:

      • volume_name :Modal卷的名称

      • local_path :要上传的本地文件/目录的路径

      • remote_path :要上传到的卷路径(默认值:“/”)

      • force :布尔标志,用于覆盖现有文件(默认值:false)

  6. 下载文件get_modal_volume_file

    • 从 Modal 卷下载文件

    • 参数:

      • volume_name :Modal卷的名称

      • remote_path :要下载的卷中的文件/目录的路径

      • local_destination :保存下载文件的本地路径(默认值:当前目录)

      • force :布尔标志,用于覆盖现有文件(默认值:false)

    • 注意:使用“-”作为local_destination将文件内容写入 stdout

模态部署

  1. 部署模态应用程序deploy_modal_app

    • 部署一个 Modal 应用程序

    • 参数:

      • absolute_path_to_app :Modal 应用程序文件的绝对路径

    • 注意:包含 Modal 应用的项目必须:

      • 使用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 }

贡献

欢迎贡献代码!欢迎提交 Pull 请求。

执照

该项目根据 MIT 许可证获得许可 - 有关详细信息,请参阅LICENSE文件。

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/smehmood/modal-mcp-server'

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