Modal MCP

Modal MCP

An MCP server for managing Modal — apps, containers, volumes, and secrets — and for deploying & running Modal apps directly from Claude Code and other MCP clients.

Category
访问服务器

README

<!-- mcp-name: io.github.george-bobby/mcp-modal -->

MCP Modal Server

mcp-modal MCP server

PyPI

An MCP server for managing Modal — apps, containers, volumes, and secrets — and for deploying & running Modal apps directly from Claude Code and other MCP clients.

Every tool shells out to your local modal CLI, so it operates against whatever Modal profile and credentials are configured on your machine. There are no extra tokens to manage.

Installation

The server is published on PyPI as mcp-modal. No manual install is needed — the recommended way to run it is with uvx, which fetches and launches it on demand. Just point your MCP client at the command below (see Configuration).

Logging in to Modal

This server uses your local Modal credentials. If you haven't authenticated yet, run:

modal setup

This opens a browser to log in and stores a token in ~/.modal.toml. Already logged in elsewhere? Check with modal profile current.

Configuration

Add the server to Claude Code with the claude mcp CLI:

claude mcp add mcp-modal -- uvx mcp-modal

Or add it to a .mcp.json file in your project root:

{
  "mcpServers": {
    "mcp-modal": {
      "command": "uvx",
      "args": ["mcp-modal"]
    }
  }
}

To pin a specific release, use uvx mcp-modal@0.2.0.

Requirements

  • Python 3.11 or higher
  • uv (provides uvx)
  • Modal CLI 1.x configured with valid credentials (modal setup)
  • For Modal deploy and run support:
    • The project being deployed/run must use uv for dependency management
    • modal must be installed in that project's virtual environment

Supported Tools

26 tools, grouped by area. Account-scoped tools accept an optional env argument to target a specific Modal environment; if omitted, they use the profile's default (or MODAL_ENVIRONMENT).

Deploy & Run

  1. Deploy Modal App (deploy_modal_app)

    • Deploys a Modal app (modal deploy). Deployed web endpoints persist, so any links in the output are live and shareable (returned in urls).
    • Parameters: absolute_path_to_app (required), env, name, tag, strategy (rolling/recreate), stream_logs
    • The app's directory must use uv with modal installed in its virtualenv.
  2. Run Modal App (run_modal_app)

    • Runs a function or local entrypoint once and streams its output (modal run).
    • Parameters: absolute_path_to_app (required), function_name, env, detach, timeout_seconds (default 120)
    • Returns a snapshot with truncated: true if the run is still going at the timeout. Pass detach=True to keep long jobs alive on Modal past the timeout.

Why no modal serve tool? modal serve only keeps its endpoints alive while the blocking process runs — an MCP tool that returns would tear them down immediately, handing back a dead URL. Use deploy_modal_app for a persistent, shareable endpoint.

Apps

  1. List Modal Apps (list_modal_apps)

    • Lists apps currently deployed/running or recently stopped. Use this to find the app name/ID for the other app tools.
    • Parameters: env
  2. Get Modal App Logs (get_modal_app_logs)

    • Fetches or streams logs for an app by name or ID (modal app logs).
    • Parameters: app_identifier (required), timeout_seconds (default 30), env, since, until, tail, search, source (stdout/stderr/system), timestamps (prefix each line with its wall-clock time), follow
    • With follow=True, logs stream until the app stops or timeout_seconds is reached, returning a snapshot with truncated: true.
    • Only covers the stdout/stderr/system streams; some failures (e.g. a crash reported as "... exited with ...") are Modal dashboard events, not log lines, and won't appear here.
  3. Stop Modal App (stop_modal_app)

    • Permanently stops an app and terminates its containers (modal app stop).
    • Parameters: app_identifier (required), env
  4. Roll Back Modal App (rollback_modal_app)

    • Redeploys a previous version of an app (modal app rollback).
    • Parameters: app_identifier (required), version (optional — defaults to the previous version), env
  5. Get Modal App History (get_modal_app_history)

    • Returns an app's deployment history (modal app history). Use it to find a version for rollback.
    • Parameters: app_identifier (required), env

Containers

  1. List Modal Containers (list_modal_containers)

    • Lists currently running containers (modal container list).
    • Parameters: app_id (optional filter), env
  2. Get Modal Container Logs (get_modal_container_logs)

    • Fetches or streams logs for a container ID (modal container logs).
    • Parameters: container_id (required), timeout_seconds (default 30), since, until, tail, search, source, timestamps, follow
    • Same stdout/stderr/system-only caveat as the app-logs tool above.
  3. Exec in Modal Container (exec_modal_container)

    • Runs a command inside a running container (modal container exec --no-pty).
    • Parameters: container_id (required), command (list of args, e.g. ["python", "-c", "print('hi')"]), timeout_seconds (default 60)
  4. Stop Modal Container (stop_modal_container)

    • Terminates a running container (modal container stop).
    • Parameters: container_id (required)

Log Search

  1. Search Modal Logs (search_modal_logs)
    • Greps an app's or container's logs for a pattern and returns each hit with the surrounding lines — built for "where did it go wrong?" debugging. Logs are fetched once and searched locally, so (unlike the search argument on the log tools) you get context, regex, case control, and match counts, not just the bare matching line.
    • Parameters: identifier (required — app name/ID or container ID), pattern (required), target (app/container, default app), regex, case_sensitive, context_lines (default 3), max_matches (default 50), since, tail (defaults to the last 1000 entries), source (stdout/stderr/system), exclude (drop noise lines before searching, e.g. "queue put failed"), timestamps (default true — carry each line's wall-clock time into the result), timeout_seconds, env
    • Returns match_count and matches: timestamped, line-numbered context blocks where matched lines are prefixed with >, e.g. > 8: 2026-06-04T... ValueError: bad input. Reports excluded_lines when exclude is used.
    • Only searches the stdout/stderr/system streams; failures emitted as Modal dashboard events (e.g. "... exited with ...") return 0 matches even when the failure is real.

Volumes — Files

  1. List Modal Volumes (list_modal_volumes) — lists all volumes. Parameters: none.
  2. List Volume Contents (list_modal_volume_contents) — volume_name, path (default /). Sets empty: true with a message when the listing genuinely returns nothing, so an empty directory is distinguishable from an error or a wrong path.
  3. Copy Files (copy_modal_volume_files) — volume_name, paths (last is destination).
  4. Remove File (remove_modal_volume_file) — volume_name, remote_path, recursive.
  5. Upload File (put_modal_volume_file) — volume_name, local_path, remote_path, force.
  6. Download File (get_modal_volume_file) — volume_name, remote_path, local_destination, force. Use - as the destination to stream contents to stdout.

Volumes — Lifecycle

  1. Create Volume (create_modal_volume) — creates a named persistent volume. Parameters: volume_name, env.
  2. Delete Volume (delete_modal_volume) — deletes a volume and all its data (irreversible). Parameters: volume_name, env.
  3. Rename Volume (rename_modal_volume) — Parameters: old_name, new_name, env.

Secrets

  1. List Secrets (list_modal_secrets)

    • Lists published secrets (names and timestamps only — values are never exposed).
    • Parameters: env
  2. Create Secret (create_modal_secret)

    • Creates a secret from inline key/values or a local file (modal secret create). Secret values are redacted from the returned command.
    • Parameters: secret_name (required), key_values (dict), from_dotenv (path), from_json (path), force, env. Provide at least one of key_values, from_dotenv, or from_json.
  3. Delete Secret (delete_modal_secret) — Parameters: secret_name, env.

Discovery

  1. Get Modal Profile (get_modal_profile)

    • Shows the active profile and all configured profiles. Use it to confirm which workspace/account the server is authenticated as. Parameters: none.
  2. List Modal Environments (list_modal_environments)

    • Lists the environments in the current workspace; the names are valid env arguments for the other tools. Parameters: none.

Response Format

All tools return responses in a standardized format, with slight variations depending on the operation type:

# JSON / list operations (apps, containers, volumes, secrets, history, ...):
{
    "success": True,
    "apps": [...]   # or "containers", "volumes", "secrets", "history", "environments"
}

# Action operations (deploy, stop, create, delete, rename, copy, put, get, rm):
{
    "success": True,
    "message": "Operation successful message",
    "command": "executed command string",
    "stdout": "command output",  # if any
    "stderr": "error output"     # if any
}

# Log / run / exec operations (snapshot-based):
{
    "success": True,
    "logs": "...",          # or "output" for run/exec
    "truncated": False,     # True when cut off at timeout_seconds
    "command": "executed command string"
}

# Error case (all operations):
{
    "success": False,
    "error": "Error message describing what went wrong",
    "command": "executed command string",
    "stdout": "command output",  # if available
    "stderr": "error output"     # if available
}

License

This project is licensed under the MIT License - see the LICENSE file for details.

推荐服务器

Baidu Map

Baidu Map

百度地图核心API现已全面兼容MCP协议,是国内首家兼容MCP协议的地图服务商。

官方
精选
JavaScript
Playwright MCP Server

Playwright MCP Server

一个模型上下文协议服务器,它使大型语言模型能够通过结构化的可访问性快照与网页进行交互,而无需视觉模型或屏幕截图。

官方
精选
TypeScript
Magic Component Platform (MCP)

Magic Component Platform (MCP)

一个由人工智能驱动的工具,可以从自然语言描述生成现代化的用户界面组件,并与流行的集成开发环境(IDE)集成,从而简化用户界面开发流程。

官方
精选
本地
TypeScript
Audiense Insights MCP Server

Audiense Insights MCP Server

通过模型上下文协议启用与 Audiense Insights 账户的交互,从而促进营销洞察和受众数据的提取和分析,包括人口统计信息、行为和影响者互动。

官方
精选
本地
TypeScript
VeyraX

VeyraX

一个单一的 MCP 工具,连接你所有喜爱的工具:Gmail、日历以及其他 40 多个工具。

官方
精选
本地
graphlit-mcp-server

graphlit-mcp-server

模型上下文协议 (MCP) 服务器实现了 MCP 客户端与 Graphlit 服务之间的集成。 除了网络爬取之外,还可以将任何内容(从 Slack 到 Gmail 再到播客订阅源)导入到 Graphlit 项目中,然后从 MCP 客户端检索相关内容。

官方
精选
TypeScript
Kagi MCP Server

Kagi MCP Server

一个 MCP 服务器,集成了 Kagi 搜索功能和 Claude AI,使 Claude 能够在回答需要最新信息的问题时执行实时网络搜索。

官方
精选
Python
e2b-mcp-server

e2b-mcp-server

使用 MCP 通过 e2b 运行代码。

官方
精选
Neon MCP Server

Neon MCP Server

用于与 Neon 管理 API 和数据库交互的 MCP 服务器

官方
精选
Exa MCP Server

Exa MCP Server

模型上下文协议(MCP)服务器允许像 Claude 这样的 AI 助手使用 Exa AI 搜索 API 进行网络搜索。这种设置允许 AI 模型以安全和受控的方式获取实时的网络信息。

官方
精选