Modal云服务器添加福利群:解决AI开发者的「MCP实战痛点」一个用于在 Cursor 内与 Modal 卷交互并部署 Modal 应用程序的 MCP 服务器实现。
git clone https://github.com/smehmood/modal-mcp-server.git
cd modal-mcp-server

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 替换为克隆仓库的绝对路径。
uv 包管理器uv 进行依赖管理列出 Modal 卷 (list_modal_volumes)
列出卷内容 (list_modal_volume_contents)
volume_name: Modal 卷的名称path: 卷内的路径(默认: "/")复制文件 (copy_modal_volume_files)
volume_name: Modal 卷的名称paths: 路径列表,最后一个路径是目标位置["source.txt", "dest.txt"] 或 ["file1.txt", "file2.txt", "dest_dir/"]移除文件 (remove_modal_volume_file)
volume_name: Modal 卷的名称remote_path: 要删除的文件/目录的路径recursive: 递归删除的布尔标志(默认: false)上传文件 (put_modal_volume_file)
volume_name: Modal 卷的名称local_path: 要上传的本地文件/目录的路径remote_path: 卷内的上传路径(默认: "/")force: 布尔标志,用于覆盖现有文件(默认: false)下载文件 (get_modal_volume_file)
volume_name: Modal 卷的名称remote_path: 卷中要下载的文件/目录的路径local_destination: 保存下载文件的本地路径(默认: 当前目录)force: 布尔标志,用于覆盖现有文件(默认: false)local_destination 可以将文件内容写入标准输出deploy_modal_app)
absolute_path_to_app: 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 Request。
本项目采用 MIT 许可证 - 详情请参阅 LICENSE 文件。