This MCP server allows you to interact with Modal volumes and deploy Modal applications directly from within Cursor. It provides convenient tools for managing Modal volumes and deploying Modal applications through a standardized interface.
To install the Modal MCP server:
Clone the repository:
git clone https://github.com/smehmood/modal-mcp-server.git
cd modal-mcp-server
Install dependencies using uv
:
uv sync
To use this MCP server in Cursor, add the following configuration to your ~/.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"
]
}
}
}
Make sure to replace /path/to/modal-mcp-server
with the absolute path to your cloned repository.
Before using the Modal MCP server, ensure you have:
uv
package manager installeduv
for dependency managementLists all Modal volumes in your environment:
{
"tool": "list_modal_volumes"
}
Lists files and directories in a Modal volume:
{
"tool": "list_modal_volume_contents",
"volume_name": "your-volume-name",
"path": "/"
}
Copies files within a Modal volume:
{
"tool": "copy_modal_volume_files",
"volume_name": "your-volume-name",
"paths": ["source.txt", "dest.txt"]
}
You can also copy multiple files to a directory:
{
"tool": "copy_modal_volume_files",
"volume_name": "your-volume-name",
"paths": ["file1.txt", "file2.txt", "dest_dir/"]
}
Deletes a file or directory from a Modal volume:
{
"tool": "remove_modal_volume_file",
"volume_name": "your-volume-name",
"remote_path": "path/to/delete",
"recursive": false
}
Set recursive
to true
to delete directories recursively.
Uploads a file or directory to a Modal volume:
{
"tool": "put_modal_volume_file",
"volume_name": "your-volume-name",
"local_path": "path/to/local/file",
"remote_path": "/",
"force": false
}
Set force
to true
to overwrite existing files.
Downloads files from a Modal volume:
{
"tool": "get_modal_volume_file",
"volume_name": "your-volume-name",
"remote_path": "path/in/volume",
"local_destination": "./download-folder",
"force": false
}
Use -
as local_destination
to write file contents to stdout.
You can deploy a Modal application using:
{
"tool": "deploy_modal_app",
"absolute_path_to_app": "/absolute/path/to/your/app.py"
}
Note: The project containing the Modal app must:
uv
for dependency managementmodal
CLI installed in its virtual environmentAll tools return responses in a standardized format:
{
"success": true,
"data": {} // JSON data from Modal CLI
}
{
"success": true,
"message": "Operation successful message",
"command": "executed command string",
"stdout": "command output",
"stderr": "error output"
}
{
"success": false,
"error": "Error message describing what went wrong",
"command": "executed command string",
"stdout": "command output",
"stderr": "error output"
}
To add this MCP server to Claude Code, run this command in your terminal:
claude mcp add-json "modal-mcp-server" '{"command":"uv","args":["--project","/path/to/modal-mcp-server","run","/path/to/modal-mcp-server/src/modal_mcp/server.py"]}'
See the official Claude Code MCP documentation for more details.
There are two ways to add an MCP server to Cursor. The most common way is to add the server globally in the ~/.cursor/mcp.json
file so that it is available in all of your projects.
If you only need the server in a single project, you can add it to the project instead by creating or adding it to the .cursor/mcp.json
file.
To add a global MCP server go to Cursor Settings > Tools & Integrations and click "New MCP Server".
When you click that button the ~/.cursor/mcp.json
file will be opened and you can add your server like this:
{
"mcpServers": {
"modal-mcp-server": {
"command": "uv",
"args": [
"--project",
"/path/to/modal-mcp-server",
"run",
"/path/to/modal-mcp-server/src/modal_mcp/server.py"
]
}
}
}
To add an MCP server to a project you can create a new .cursor/mcp.json
file or add it to the existing one. This will look exactly the same as the global MCP server example above.
Once the server is installed, you might need to head back to Settings > MCP and click the refresh button.
The Cursor agent will then be able to see the available tools the added MCP server has available and will call them when it needs to.
You can also explicitly ask the agent to use the tool by mentioning the tool name and describing what the function does.
To add this MCP server to Claude Desktop:
1. Find your configuration file:
~/Library/Application Support/Claude/claude_desktop_config.json
%APPDATA%\Claude\claude_desktop_config.json
~/.config/Claude/claude_desktop_config.json
2. Add this to your configuration file:
{
"mcpServers": {
"modal-mcp-server": {
"command": "uv",
"args": [
"--project",
"/path/to/modal-mcp-server",
"run",
"/path/to/modal-mcp-server/src/modal_mcp/server.py"
]
}
}
}
3. Restart Claude Desktop for the changes to take effect