Skip to main content
Glama
milkymap

MCP4Modal Sandbox

by milkymap

MCP4Modal Sandbox

A powerful Model Context Protocol (MCP) server that provides seamless cloud-based sandbox management using Modal.com. This project enables LLMs and AI assistants to spawn, manage, and interact with isolated compute environments in the cloud with full GPU support.

Features

Core Sandbox Management

  • Launch Sandboxes: Create isolated Python environments with custom configurations

  • Terminate Sandboxes: Clean resource management and controlled shutdown

  • List Sandboxes: Monitor and track active sandbox environments

  • App Namespacing: Organize sandboxes within Modal app namespaces

Advanced Configuration

  • Python Versions: Support for multiple Python versions (default: 3.12)

  • Package Management: Install pip and apt packages during sandbox creation

  • Resource Allocation: Configure CPU cores, memory, and execution timeouts

  • Working Directory: Set custom working directories for sandbox environments

GPU Support

Comprehensive GPU support for machine learning and compute-intensive workloads:

  • T4: Entry-level GPU, ideal for inference workloads

  • L4: Mid-range GPU for general ML tasks

  • A10G: High-performance GPU for training (up to 4 GPUs)

  • A100-40GB/80GB: High-end GPUs for large-scale training

  • L40S: Latest generation GPU for ML workloads

  • H100: Latest generation high-end GPU

  • H200: Latest generation flagship GPU

  • B200: Latest generation enterprise GPU

File Operations

  • Push Files: Upload files from local filesystem to sandboxes

  • Pull Files: Download files from sandboxes to local filesystem

  • Read File Content: View file contents directly without downloading

  • Write File Content: Create and edit files within sandboxes

  • Directory Management: Create, list, and remove directories

Command Execution

  • Remote Execution: Run arbitrary commands in sandbox environments

  • Output Capture: Capture stdout, stderr, and return codes

  • Timeout Control: Configure execution timeouts for long-running tasks

  • Performance Metrics: Track execution time and resource usage

Security & Environment Management

  • Secrets Management: Inject environment variables and secrets

  • Predefined Secrets: Reference existing secrets from Modal dashboard

  • Volume Mounting: Attach persistent storage volumes

  • Isolated Environments: Complete isolation between sandbox instances

Transport Options

  • stdio: Direct command-line interface (default)

  • streamable-http: HTTP-based communication

  • SSE: Server-Sent Events for real-time updates

Related MCP server: MCP Python Interpreter

rerequisites

  • Python 3.12+

  • Modal.com account and API key

  • Environment variables configured (see Configuration section)

Installation

# Clone the repository
git clone https://github.com/milkymap/mcp4modal_sandbox.git
cd mcp4modal_sandbox

# Install dependencies
uv sync

# Install in development mode
uv pip install -e .

Using Docker

Build the Docker Image

# Build the Docker image
docker build -t mcp4modal-sandbox f Dockerfile .

Run with stdio Transport (Default)

# Run --help to find options
docker run -it \
  -e MODAL_TOKEN_ID="your_modal_token_id" \
  -e MODAL_TOKEN_SECRET="your_modal_token_secret" \
  mcp4modal-sandbox --help

Configuration

Environment Variables

Create a .env file in the project root:

# Required: Modal.com API Configuration
MODAL_TOKEN_ID="your_modal_token_id"
MODAL_TOKEN_SECRET="your_modal_token_secret"

# Optional: HTTP Transport Configuration (only needed for streamable-http/sse transports)
MCP_HOST="0.0.0.0"  # Default: 0.0.0.0
MCP_PORT=8000       # Default: 8000

Modal.com Setup

  1. Create an account at Modal.com

  2. Generate API tokens from your Modal dashboard

  3. Configure the tokens in your environment variables

Integration with Claude Desktop

Add to your Claude Desktop configuration:

uvx

{
  "mcpServers": {
    "mcp4modal-sandbox": {
        "command": "uvx",
        "args": [
          "mcp4modal-sandbox",
          "--transport", "stdio",
          "--app_name", "namespace",
          "--preloaded_secrets", "group0", // modal secret
          "--preloaded_secrets", "group1" // modal secret
          ],
        "env": {
          "MODAL_TOKEN_ID": "",
          "MODAL_TOKEN_SECRET": ""
        }
    }
  }
}

docker

{
  "mcpServers": {
    "mcp4modal-sandbox": {
        "command": "docker",
        "args": [
          "run", "--rm", "-i", "--name", "modal_sandbox",
          "-e", "MODAL_TOKEN_ID", "-e", "MODAL_TOKEN_SECRET", 
          "-v", "/path/to/volume", 
          "milkymap/modal_sandbox:0.1", 
          "--transport", "stdio",
          "--app_name", "namespace",
          "--preloaded_secrets", "group0",
          "--preloaded_secrets", "group1"
          ],
        "env": {
          "MODAL_TOKEN_ID": "",
          "MODAL_TOKEN_SECRET": ""
        }
    }
  }
}

Available Tools

The MCP server provides 11 tools for comprehensive sandbox management:

  1. launch_sandbox - Create new Modal sandboxes with custom configuration (Python version, packages, GPU, secrets)

  2. terminate_sandbox - Stop and clean up running sandboxes

  3. list_sandboxes - List all sandboxes in an app namespace with their status

  4. execute_command - Run shell commands in sandboxes and capture output

  5. push_file_to_sandbox - Upload files from local filesystem to sandboxes

  6. pull_file_from_sandbox - Download files from sandboxes to local filesystem

  7. list_directory_contents - List contents of directories within sandboxes

  8. make_directory - Create directories in sandboxes

  9. remove_path - Remove files or directories from sandboxes

  10. read_file_content_from_sandbox - Read file contents directly from sandboxes

  11. write_file_content_to_sandbox - Write content to files within sandboxes

Available Tools

11 tools
execute_commandA
        Executes a command in a specified Modal sandbox environment.
        
        Parameters:
        - sandbox_id: The unique identifier of the sandbox to run the command in
        - command: The shell command to execute (e.g. "python script.py", "ls -la", etc.)
        - working_dir: Optional working directory to execute the command from
        - timeout: Optional timeout in seconds for command execution
        
        Returns a SandboxExecuteResponse containing:
        - stdout: Standard output from the command execution
        - stderr: Standard error output from the command execution  
        - returncode: Exit code of the command (0 typically indicates success)
        - execution_time: Time taken to execute the command in seconds
        
        This tool is useful for:
        - Running arbitrary commands in isolated sandbox environments
        - Testing scripts and programs in clean environments
        - Executing programs with specific dependencies
        - Debugging environment-specific issues
        - Running automated tests in isolation
        
        The tool will:
        1. Verify the sandbox exists and is running
        2. Execute the specified command in that sandbox
        3. Capture all output and timing information
        4. Return detailed execution results
        
ParametersJSON Schema
NameRequiredDescriptionDefault
sandbox_idYes
commandYes
timeout_secondsNo

TDQS

A4.4/5.0
Behavior4/5

Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?

With no annotations provided, the description carries full burden and does well by detailing behavioral traits: it verifies sandbox existence/running status, executes commands, captures output/timing, and returns specific results (stdout, stderr, etc.). It also implies isolation and potential timeouts, though it could mention error handling or security constraints more explicitly.

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness4/5

Is the description appropriately sized, front-loaded, and free of redundancy?

The description is appropriately sized and front-loaded, starting with the core purpose. However, it includes some redundancy (e.g., listing return values in detail after stating 'Returns a SandboxExecuteResponse') and could be more streamlined by merging the 'useful for' and 'The tool will' sections into a single usage overview.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness4/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

Given the tool's complexity (command execution in sandboxes), no annotations, and no output schema, the description is mostly complete: it explains purpose, parameters, return values, and usage scenarios. It could improve by addressing potential errors (e.g., what if sandbox isn't running) or linking to sibling tools for sandbox management, but overall it provides sufficient context for an agent to use the tool correctly.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters5/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

Schema description coverage is 0%, so the description must compensate fully. It adds significant meaning beyond the schema: explains sandbox_id as 'unique identifier of the sandbox,' command as 'shell command to execute' with examples, working_dir as 'optional working directory' (though not in schema, adding clarification), and timeout as 'optional timeout in seconds.' This covers all parameters effectively.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose5/5

Does the description clearly state what the tool does and how it differs from similar tools?

The description clearly states the tool 'executes a command in a specified Modal sandbox environment,' using specific verbs ('executes,' 'run') and resources ('command,' 'sandbox'). It distinguishes from siblings like launch_sandbox (creates sandbox) or list_directory_contents (reads files) by focusing on command execution within an existing sandbox.

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines4/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

The description provides clear context for when to use this tool ('useful for running arbitrary commands in isolated sandbox environments, testing scripts, debugging, etc.'), but does not explicitly state when NOT to use it or name alternatives among siblings (e.g., use list_directory_contents for file listing instead of 'ls' via this tool).

Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.

launch_sandboxA
        Launches a new Modal sandbox with specified configuration.
        
        Parameters:
        - python_version: Python version to use (default: "3.12")
        - pip_packages: List of pip packages to install
        - apt_packages: List of apt packages to install
        - timeout_seconds: Maximum runtime in seconds (default: 3600)
        - cpu: CPU cores allocated (default: 1.0)
        - memory: Memory in MB allocated (default: 1024)
        - secrets: Dictionary of environment variables to inject (creates new secret)
        - volumes: Dictionary of volumes to mount in sandbox, where the key is the path in the sandbox and the value is the name of the volume
        - workdir: Working directory in sandbox (default: "/")
        - gpu_type: Type of GPU to use (optional). Supported types:
          * T4: Entry-level GPU, good for inference
          * L4: Mid-range GPU, good for general ML tasks
          * A10G: High-performance GPU, good for training
          * A100-40GB: High-end GPU with 40GB memory
          * A100-80GB: High-end GPU with 80GB memory
          * L40S: Latest generation GPU, good for ML workloads
          * H100: Latest generation high-end GPU
          * H200: Latest generation flagship GPU
          * B200: Latest generation enterprise GPU
        - gpu_count: Number of GPUs to use (optional, default: 1)
          * A10G supports up to 4 GPUs
          * Other types support up to 8 GPUs
        
        Returns a SandboxLaunchResponse containing:
        - sandbox_id: Unique identifier for the sandbox
        - status: Current status of the sandbox
        - python_version: Python version installed
        - pip_packages: List of pip packages installed
        - apt_packages: List of apt packages installed
        - preloaded_secrets: List of predefined secrets injected from Modal dashboard
        
        This tool is useful for:
        - Creating isolated Python environments
        - Running code with specific dependencies
        - Testing in clean environments
        - Executing long-running tasks
        - Running GPU-accelerated workloads
        - Training machine learning models
        - Running inference on large models
        
        Secrets Management:
        - Use 'secrets' parameter to create new secrets with key-value pairs
        - Use 'inject_predefined_secrets' to reference existing secrets from Modal dashboard
        - Predefined secrets are applied after custom secrets, so they can override values
        - Access secrets as environment variables in your sandbox code using os.environ
        
ParametersJSON Schema
NameRequiredDescriptionDefault
python_versionNo3.12
pip_packagesNo
apt_packagesNo
timeout_secondsNo
cpuNo
memoryNo
secretsNo
volumesNo
workdirNo/home/solver
gpu_typeNo
gpu_countNo

TDQS

A4.3/5.0
Behavior4/5

Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?

With no annotations provided, the description carries full burden and does well by disclosing behavioral traits: it creates new secrets, mentions runtime limits via timeout, describes GPU constraints, and explains secrets management. It doesn't cover rate limits or error conditions.

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness3/5

Is the description appropriately sized, front-loaded, and free of redundancy?

The description is appropriately front-loaded with core purpose, but the 'This tool is useful for' section contains redundant items (e.g., 'Running GPU-accelerated workloads' and 'Training machine learning models' overlap). Some sentences could be consolidated for better efficiency.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness4/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

Given the complexity (11 parameters, no annotations, no output schema), the description is quite complete. It explains parameters thoroughly, describes return values, and covers behavioral aspects. Minor gaps include lack of error handling or cost implications.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters5/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

With 0% schema description coverage, the description fully compensates by providing detailed parameter explanations beyond just names. It adds meaning for all 11 parameters including defaults, GPU type descriptions with use cases, and constraints like GPU count limits.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose5/5

Does the description clearly state what the tool does and how it differs from similar tools?

The description clearly states the verb ('launches') and resource ('new Modal sandbox') with specific configuration. It distinguishes from siblings like 'list_sandboxes' (reads) and 'terminate_sandbox' (destroys) by focusing on creation.

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines4/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

The 'This tool is useful for' section provides clear context about when to use it (isolated environments, specific dependencies, GPU workloads). However, it doesn't explicitly state when NOT to use it or mention alternatives like 'execute_command' for simpler tasks.

Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.

list_directory_contentsA
        Lists contents of a directory in the sandbox.
        
        Parameters:
        - sandbox_id: The unique identifier of the sandbox
        - path: Directory path to list in the sandbox
        
        Returns a SandboxListDirectoryResponse containing:
        - contents: List of filenames/directories at the specified path
        
        This tool is useful for:
        - Exploring sandbox filesystem structure
        - Verifying file operations
        - Debugging file-related issues
        - Managing sandbox content
        
        The tool will:
        1. Verify sandbox and directory exist
        2. List all contents at specified path
        3. Return directory listing
        
ParametersJSON Schema
NameRequiredDescriptionDefault
sandbox_idYes
pathYes

TDQS

A4.3/5.0
Behavior4/5

Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?

With no annotations provided, the description carries full burden and does well by disclosing behavioral traits: it describes the verification step ('Verify sandbox and directory exist'), the listing process, and the return format. It doesn't mention error handling, permissions, or rate limits, but provides solid operational context beyond basic functionality.

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness4/5

Is the description appropriately sized, front-loaded, and free of redundancy?

Well-structured with clear sections (purpose, parameters, returns, use cases, process steps) and front-loaded key information. Some redundancy exists (parameters listed twice in different formats), but every sentence adds value and the length is appropriate for the tool's complexity.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness4/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

Given no annotations and no output schema, the description provides good coverage: explains purpose, parameters, return format, use cases, and operational steps. It doesn't detail error conditions or response structure beyond mentioning 'SandboxListDirectoryResponse', but is reasonably complete for a directory listing tool.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters4/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

With 0% schema description coverage, the description compensates by clearly explaining both parameters: sandbox_id as 'unique identifier of the sandbox' and path as 'Directory path to list in the sandbox'. This adds essential meaning beyond the bare schema, though it could provide more detail about path format or sandbox_id constraints.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose5/5

Does the description clearly state what the tool does and how it differs from similar tools?

The description clearly states the tool's purpose with specific verb ('Lists') and resource ('contents of a directory in the sandbox'), distinguishing it from siblings like list_sandboxes (which lists sandboxes) or read_file_content_from_sandbox (which reads file contents). The opening sentence provides immediate clarity without redundancy.

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines4/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

The 'This tool is useful for:' section provides clear context for when to use it (exploring filesystem, verifying operations, debugging, managing content), helping differentiate from tools like execute_command or remove_path. However, it doesn't explicitly state when NOT to use it or name specific alternatives for overlapping use cases.

Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.

list_sandboxesA
        Lists all Modal sandboxes for a specific app namespace and their current status.
        
        Parameters:
        - app_name: Name of the Modal app namespace to list sandboxes for
        
        Returns a list of sandboxes containing:
        - sandbox_id: Unique identifier for each sandbox
        - sandbox_status: Current state of the sandbox (running/stopped)
        
        This tool is useful for:
        - Monitoring active Modal sandbox environments within an app namespace
        - Checking which sandboxes are currently running
        - Getting sandbox IDs for further management operations
        
ParametersJSON Schema
NameRequiredDescriptionDefault

No parameters

TDQS

A4.3/5.0
Behavior4/5

Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?

With no annotations provided, the description carries the full burden of behavioral disclosure. It effectively describes the tool's behavior: it lists sandboxes, returns specific data (sandbox_id and sandbox_status), and implies it's a read-only operation for monitoring. It could improve by mentioning potential limitations like pagination or rate limits, but it provides good context beyond basic functionality.

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness4/5

Is the description appropriately sized, front-loaded, and free of redundancy?

The description is well-structured with clear sections (purpose, parameters, returns, use cases) and is appropriately sized. Every sentence adds value, such as explaining the return format and practical applications. It could be slightly more concise by integrating the 'useful for' points into the main description.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness4/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

Given the tool's moderate complexity (listing resources), no annotations, no output schema, and 0 parameters with full schema coverage, the description is mostly complete. It explains what the tool does, what it returns, and when to use it. It could be improved by detailing error cases or authentication needs, but it adequately covers the core functionality.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters4/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

The input schema has 0 parameters with 100% coverage, so the baseline is 4. The description mentions 'app_name' as a parameter, which adds meaning by specifying it's required for listing sandboxes, but this contradicts the schema (which has no parameters). However, since the schema coverage is high and parameters are zero, the description's extra detail is not penalized heavily.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose5/5

Does the description clearly state what the tool does and how it differs from similar tools?

The description clearly states the specific action ('Lists all Modal sandboxes') and resource ('for a specific app namespace'), distinguishing it from siblings like 'launch_sandbox' or 'terminate_sandbox' which perform different operations. It specifies the scope ('and their current status'), making the purpose unambiguous.

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines4/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

The description provides clear context for when to use this tool ('Monitoring active Modal sandbox environments within an app namespace', 'Checking which sandboxes are currently running', 'Getting sandbox IDs for further management operations'). However, it does not explicitly state when not to use it or name alternatives among the sibling tools.

Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.

make_directoryA
        Creates a new directory in the sandbox.
        
        Parameters:
        - sandbox_id: The unique identifier of the sandbox
        - path: Directory path to create in the sandbox
        - parents: Whether to create parent directories if they don't exist
        
        Returns a SandboxMakeDirectoryResponse containing:
        - success: Boolean indicating if directory creation was successful
        - message: Descriptive message about the operation
        - path_created: The path that was created
       
        
        This tool is useful for:
        - Setting up directory structures
        - Preparing for file operations
        - Organizing sandbox content
        
        The tool will:
        1. Verify sandbox exists and is running
        2. Create directory at specified path
        3. Return status of the operation
        
ParametersJSON Schema
NameRequiredDescriptionDefault
sandbox_idYes
pathYes
parentsNo

TDQS

A4.4/5.0
Behavior4/5

Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?

With no annotations provided, the description carries the full burden and does so well by detailing behavioral traits: it outlines a three-step process (verifying sandbox, creating directory, returning status), specifies what gets returned (success, message, path_created), and implies mutation (creation). It does not mention rate limits or auth needs, but covers key operational aspects.

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness4/5

Is the description appropriately sized, front-loaded, and free of redundancy?

The description is well-structured with sections for purpose, parameters, returns, usage contexts, and behavioral steps, making it easy to scan. It is appropriately sized, but could be slightly more concise by integrating the 'useful for' list into the main flow without redundancy.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness4/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

Given no annotations, no output schema, and 0% schema coverage, the description provides comprehensive context: it explains the tool's purpose, parameters, return values, usage scenarios, and behavioral steps. It adequately covers the complexity, though it could note potential errors or prerequisites more explicitly.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters5/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

Schema description coverage is 0%, so the description must compensate fully, which it does by listing all three parameters with clear explanations: sandbox_id as 'unique identifier', path as 'Directory path to create', and parents as 'Whether to create parent directories if they don't exist'. This adds essential meaning beyond the bare schema.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose5/5

Does the description clearly state what the tool does and how it differs from similar tools?

The description clearly states the specific action ('Creates a new directory') and resource ('in the sandbox'), distinguishing it from siblings like list_directory_contents or remove_path. It provides a verb+resource combination that is precise and unambiguous.

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines4/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

The description includes a 'useful for' section with explicit contexts (e.g., 'Setting up directory structures', 'Preparing for file operations'), which gives clear guidance on when to use this tool. However, it does not explicitly mention when not to use it or name alternatives among siblings, such as remove_path for deletion.

Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.

pull_file_from_sandboxA
        Copies a file from a Modal sandbox to the local filesystem.
        
        Parameters:
        - sandbox_id: The unique identifier of the sandbox
        - sandbox_path: Path to the file in the sandbox
        - local_path: Destination path on local filesystem
        
        Returns a PullFileFromSandboxResponse containing:
        - success: Boolean indicating if copy was successful
        - message: Descriptive message about the copy operation
        - sandbox_path: The source path in sandbox
        - local_path: The destination path on local filesystem
        - file_size: Size of the file in bytes
       
        
        This tool is useful for:
        - Retrieving output files from sandbox executions
        - Backing up sandbox data
        - Analyzing sandbox-generated content locally
        - Debugging sandbox operations
        
        The tool will:
        1. Verify sandbox and source file exist
        2. Create local destination directory if needed
        3. Copy file contents from sandbox to local system
        4. Return status of the operation
        
ParametersJSON Schema
NameRequiredDescriptionDefault
sandbox_idYes
sandbox_pathYes
local_pathYes

TDQS

A4.3/5.0
Behavior4/5

Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?

With no annotations provided, the description carries full burden and does well by disclosing the multi-step behavior (verification, directory creation, copying, status return). It doesn't mention potential failure modes, permissions, or rate limits, but provides substantial operational transparency beyond basic function.

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness4/5

Is the description appropriately sized, front-loaded, and free of redundancy?

Well-structured with clear sections (purpose, parameters, returns, use cases, behavior). Some redundancy exists (parameters listed twice in different sections), but overall efficient with every sentence adding value. Could be slightly more front-loaded.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness4/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

For a 3-parameter tool with no annotations and no output schema, the description provides comprehensive coverage: clear purpose, parameter meanings, return value structure, use cases, and operational steps. The main gap is lack of explicit error handling or constraints documentation.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters4/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

Schema description coverage is 0%, but the description provides clear parameter documentation with meaningful explanations of each parameter's role. The description compensates well for the schema's lack of descriptions, though it doesn't specify format requirements (e.g., path syntax, sandbox ID format).

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose5/5

Does the description clearly state what the tool does and how it differs from similar tools?

The description clearly states the specific action ('Copies a file from a Modal sandbox to the local filesystem') with precise verb+resource combination. It distinguishes from siblings like 'push_file_to_sandbox' (reverse direction) and 'read_file_content_from_sandbox' (reads content without copying).

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines4/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

The 'This tool is useful for' section provides clear context about when to use this tool (retrieving output files, backing up data, analyzing content, debugging). However, it doesn't explicitly state when NOT to use it or mention specific alternatives like 'read_file_content_from_sandbox' for content-only access.

Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.

push_file_to_sandboxA
        Copies a file from the local filesystem to a Modal sandbox.
        
        Parameters:
        - sandbox_id: The unique identifier of the sandbox
        - local_path: Path to the source file on local filesystem
        - sandbox_path: Destination path in the sandbox
        - read_file_mode: Optional mode for reading local file (default: "rb")
        - writefile_mode: Optional mode for writing to sandbox (default: "wb")
        
        Returns a PushFileToSandboxResponse containing:
        - success: Boolean indicating if copy was successful
        - message: Descriptive message about the copy operation
        - local_path: The source path on local filesystem
        - sandbox_path: The destination path in sandbox
        - file_size: Size of the file in bytes
        
        This tool is useful for:
        - Uploading input files to sandboxes
        - Transferring configuration files
        - Setting up sandbox environments
        - Deploying code to sandboxes
        
        The tool will:
        1. Verify sandbox is running and local file exists
        2. Read contents from local file
        3. Write contents to sandbox path
        4. Return status of the operation
        
ParametersJSON Schema
NameRequiredDescriptionDefault
sandbox_idYes
local_pathYes
sandbox_pathYes
read_file_modeNorb
writefile_modeNowb

TDQS

A4.7/5.0
Behavior5/5

Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?

With no annotations provided, the description carries full burden and delivers comprehensive behavioral disclosure. It describes the multi-step process (verification, reading, writing, returning status), mentions preconditions (sandbox must be running, local file must exist), and details the response structure including success indicators and file metadata. This goes well beyond basic functionality description.

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness4/5

Is the description appropriately sized, front-loaded, and free of redundancy?

The description is well-structured with clear sections (purpose, parameters, returns, use cases, process) and every sentence adds value. However, it could be slightly more front-loaded by moving the 'useful for' section after the core description rather than after the return values. The length is appropriate for a 5-parameter tool with no annotations.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness5/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

For a file transfer tool with 5 parameters, no annotations, and no output schema, the description provides excellent completeness. It covers purpose, all parameters with semantics, return value structure, use cases, and operational behavior. The agent has everything needed to understand when and how to use this tool effectively without needing additional structured data.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters5/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

Despite 0% schema description coverage, the description provides complete parameter documentation with clear explanations for all 5 parameters, including optional parameters with their defaults. It adds meaningful context about what each parameter represents (e.g., 'unique identifier of the sandbox', 'path to source file on local filesystem', 'destination path in sandbox') that the schema titles alone don't convey.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose5/5

Does the description clearly state what the tool does and how it differs from similar tools?

The description clearly states the specific action ('Copies a file') and resources involved ('from the local filesystem to a Modal sandbox'), distinguishing it from sibling tools like pull_file_from_sandbox (reverse direction) and write_file_content_to_sandbox (creates content rather than copying files). The verb+resource combination is precise and unambiguous.

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines4/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

The description provides clear context about when to use this tool ('useful for uploading input files, transferring configuration files, setting up sandbox environments, deploying code'), but doesn't explicitly state when NOT to use it or mention specific alternatives like write_file_content_to_sandbox for creating new files from content rather than copying existing files. The guidance is helpful but lacks exclusion criteria.

Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.

read_file_content_from_sandboxA
        Reads the content of a file in the sandbox.
        
        Parameters:
        - sandbox_id: The unique identifier of the sandbox
        - path: Path to the file to read
        
        Returns a SandboxReadFileContentResponse containing:
        - content: String content of the file
        
        This tool is useful for:
        - Viewing file contents without downloading
        - Debugging sandbox operations
        - Checking operation results
        - Quick file inspection
        
        The tool will:
        1. Verify sandbox and file exist
        2. Read file contents
        3. Return file content as string
        
ParametersJSON Schema
NameRequiredDescriptionDefault
sandbox_idYes
pathYes

TDQS

A4.4/5.0
Behavior4/5

Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?

With no annotations provided, the description carries the full burden of behavioral disclosure. It effectively describes the tool's behavior: verifying existence, reading content, and returning as string. It also implies this is a read-only operation (consistent with 'read' in the name) and doesn't mention destructive actions. However, it doesn't cover potential error conditions, permissions, or rate limits.

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness4/5

Is the description appropriately sized, front-loaded, and free of redundancy?

The description is well-structured with clear sections (purpose, parameters, returns, usage, steps). However, the 'useful for' section contains some redundancy (e.g., 'debugging sandbox operations' and 'checking operation results' overlap), and the numbered steps partially repeat what's already implied in the main description, making it slightly less concise than ideal.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness4/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

For a 2-parameter read tool with no annotations and no output schema, the description provides good coverage: clear purpose, parameter explanations, return value description, usage context, and behavioral steps. The main gap is the lack of explicit error handling information (what happens if file doesn't exist or path is invalid), which would be helpful for agent decision-making.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters5/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

With 0% schema description coverage, the description fully compensates by providing clear parameter documentation. It explains both parameters (sandbox_id as 'unique identifier', path as 'Path to the file') and their purpose, adding essential meaning beyond the bare schema. This is exactly what's needed when schema coverage is low.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose5/5

Does the description clearly state what the tool does and how it differs from similar tools?

The description clearly states the specific action ('Reads the content of a file') and resource ('in the sandbox'), distinguishing it from siblings like list_directory_contents (which lists files) or pull_file_from_sandbox (which downloads files). The verb+resource combination is precise and unambiguous.

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines4/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

The 'useful for' section provides clear context about when to use this tool (viewing without downloading, debugging, checking results, quick inspection). However, it doesn't explicitly state when NOT to use it or name specific alternatives like pull_file_from_sandbox for downloading files, which would provide stronger differentiation.

Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.

remove_pathA
        Removes a file or directory from the sandbox.
        
        Parameters:
        - sandbox_id: The unique identifier of the sandbox
        - path: Path to remove from the sandbox
        - recursive: Whether to remove the path recursively
        
        Returns a SandboxRemovePathResponse containing:
        - success: Boolean indicating if removal was successful
        - message: Descriptive message about the operation
        - path_removed: The path that was removed
       
        
        This tool is useful for:
        - Cleaning up temporary files
        - Removing unwanted content
        - Managing sandbox storage
        
        The tool will:
        1. Verify sandbox exists and is running
        2. Remove specified path (file or directory)
        3. Return status of the operation
        
ParametersJSON Schema
NameRequiredDescriptionDefault
sandbox_idYes
pathYes
recursiveNo

TDQS

A4.4/5.0
Behavior4/5

Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?

With no annotations provided, the description carries full burden and does well by disclosing: 1) The 3-step process including verification, removal, and status return, 2) What gets removed (file or directory), 3) The return structure with success flag and message. It doesn't mention permission requirements or rate limits, but provides solid behavioral context.

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness4/5

Is the description appropriately sized, front-loaded, and free of redundancy?

Well-structured with clear sections (purpose, parameters, returns, usage, process). Some redundancy exists (parameters listed twice in description and schema), but overall efficient with every sentence adding value. Could be slightly more front-loaded.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness4/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

For a destructive tool with no annotations and no output schema, the description provides good completeness: explains what it does, parameters, return structure, use cases, and process. Missing details about error conditions or specific limitations, but covers the essentials well given the context.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters5/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

With 0% schema description coverage, the description fully compensates by explaining all 3 parameters: sandbox_id (unique identifier), path (path to remove), and recursive (whether to remove recursively). It adds crucial meaning beyond the bare schema, especially clarifying what 'recursive' means in this context.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose5/5

Does the description clearly state what the tool does and how it differs from similar tools?

The description clearly states the tool 'Removes a file or directory from the sandbox' with specific verb (remove) and resource (file/directory in sandbox). It distinguishes from siblings like list_directory_contents (read-only) or terminate_sandbox (destroys entire sandbox).

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines4/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

The 'This tool is useful for' section provides clear context about when to use it (cleaning up temporary files, removing unwanted content, managing storage). However, it doesn't explicitly state when NOT to use it or name specific alternatives among siblings.

Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.

terminate_sandboxA
        Terminates a Modal sandbox by its ID.
        
        Parameters:
        - sandbox_id: The unique identifier of the sandbox to terminate
        
        Returns a SandboxTerminateResponse containing:
        - success: Boolean indicating if termination was successful
        - message: Detailed message about the termination result
        
        This tool is useful for:
        - Stopping running sandboxes that are no longer needed
        - Cleaning up resources
        - Forcefully ending long-running or stuck sandboxes
        - Managing sandbox lifecycle
        
        The tool will:
        1. Check if the sandbox exists and is running
        2. Send termination signal if running
        3. Wait for confirmation of termination
        4. Return status of the operation
        
ParametersJSON Schema
NameRequiredDescriptionDefault
sandbox_idYes

TDQS

A4.8/5.0
Behavior4/5

Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?

With no annotations provided, the description carries the full burden and does so effectively by detailing the tool's behavior: it checks if the sandbox exists and is running, sends a termination signal, waits for confirmation, and returns status. It also implies destructive action ('terminates', 'forcefully ending'), which is appropriate for this operation.

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness5/5

Is the description appropriately sized, front-loaded, and free of redundancy?

The description is well-structured with clear sections (purpose, parameters, returns, use cases, behavior steps) and front-loaded key information. Every sentence adds value, such as detailing the return object and step-by-step process, without unnecessary fluff.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness5/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

Given the tool's complexity (destructive operation with 1 parameter), no annotations, and no output schema, the description is highly complete. It covers purpose, parameters, return values, usage scenarios, and behavioral steps, providing all necessary context for an AI agent to use the tool correctly.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters5/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

Schema description coverage is 0%, so the description must compensate, and it does by explaining the parameter 'sandbox_id' as 'The unique identifier of the sandbox to terminate', adding essential meaning beyond the schema's basic type information. This is crucial for correct tool invocation.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose5/5

Does the description clearly state what the tool does and how it differs from similar tools?

The description clearly states the specific action ('terminates') and resource ('Modal sandbox by its ID'), distinguishing it from sibling tools like 'launch_sandbox' or 'list_sandboxes'. It precisely communicates the tool's function without ambiguity.

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines5/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

The description explicitly lists use cases ('Stopping running sandboxes that are no longer needed', 'Cleaning up resources', 'Forcefully ending long-running or stuck sandboxes', 'Managing sandbox lifecycle'), providing clear guidance on when to use this tool versus alternatives like 'list_sandboxes' or 'launch_sandbox'.

Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.

write_file_content_to_sandboxA
        Writes content to a file in a Modal sandbox.
        This is useful for writing code, text, or any other content to a file in the sandbox.

        Parameters:
        - sandbox_id: ID of the target sandbox where code will be written
        - sandbox_path: Path where the code file should be created/written in the sandbox
        - content: Content to write to the file

        Returns a SandboxWriteCodeResponse containing:
        - success: Boolean indicating if code was written successfully
        - message: Descriptive message about the operation
        - file_path: Path where code was written in sandbox

        This tool is powerful for:
        - Rapid prototyping and code generation
        - Creating boilerplate code
        - Implementing algorithms from descriptions
        - Converting pseudocode to actual code
        - Generating test cases
        - Creating utility functions and helper code

        The tool will:
        1. Verify the sandbox is running
        2. Write content to specified path in sandbox
        3. Handle errors and provide detailed feedback
ParametersJSON Schema
NameRequiredDescriptionDefault
sandbox_idYes
sandbox_pathYes
contentYes

TDQS

A4.1/5.0
Behavior4/5

Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?

With no annotations provided, the description carries the full burden of behavioral disclosure. It effectively describes the tool's operational steps (verifying sandbox running, writing content, handling errors) and the return structure (success boolean, message, file_path). However, it doesn't mention potential side effects like overwriting existing files, permission requirements, or rate limits.

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness3/5

Is the description appropriately sized, front-loaded, and free of redundancy?

The description is appropriately front-loaded with the core purpose, but contains some redundancy (e.g., repeating 'code' when the tool handles any content) and includes an overly detailed 'powerful for' list that could be condensed. The three-step operational description is useful but could be more concise.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness4/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

For a 3-parameter mutation tool with no annotations and no output schema, the description provides good coverage: clear purpose, parameter semantics, return structure, and operational behavior. The main gap is lack of explicit guidance on when to use versus sibling tools, but overall it's reasonably complete for the tool's complexity.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters5/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

With 0% schema description coverage, the description fully compensates by providing clear semantic explanations for all three parameters: 'sandbox_id' identifies the target, 'sandbox_path' specifies where to create/write, and 'content' is what to write. The description adds essential meaning beyond the bare schema field names.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose5/5

Does the description clearly state what the tool does and how it differs from similar tools?

The description clearly states the specific action ('writes content to a file') and target resource ('in a Modal sandbox'), distinguishing it from sibling tools like 'push_file_to_sandbox' (which likely transfers external files) and 'read_file_content_from_sandbox' (which reads rather than writes). The opening sentence provides a complete, unambiguous purpose statement.

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines3/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

The description provides some implied usage context through the 'useful for' section listing scenarios like rapid prototyping and code generation, but it doesn't explicitly state when to use this tool versus alternatives like 'push_file_to_sandbox' or 'make_directory'. No explicit when-not-to-use guidance or prerequisite information is provided.

Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.

Tool Schema Changelog

Recent tool additions, removals, and schema changes observed during successful MCP inspections. Dates show when Glama detected each change.

  1. 11 tool updates
    • First observedexecute_command
    • First observedlaunch_sandbox
    • First observedlist_directory_contents
    • First observedlist_sandboxes
    • First observedmake_directory
    • First observedpull_file_from_sandbox
    • First observedpush_file_to_sandbox
    • First observedread_file_content_from_sandbox
    • First observedremove_path
    • First observedterminate_sandbox
    • First observedwrite_file_content_to_sandbox

TDQS

A4.4/5.0
Disambiguation5/5

Each tool has a clearly distinct purpose with no overlap. For example, execute_command runs commands, launch_sandbox creates sandboxes, list_directory_contents lists files, and push_file_to_sandbox transfers files, all serving unique functions within the sandbox management domain. The descriptions clearly differentiate between creation, execution, file operations, and lifecycle management.

Naming Consistency4/5

Most tools follow a consistent verb_noun pattern (e.g., execute_command, launch_sandbox, list_directory_contents). However, there are minor deviations like pull_file_from_sandbox and push_file_to_sandbox using 'from/to' prepositions, and read_file_content_from_sandbox being slightly verbose compared to others. Overall, the naming is highly readable and predictable.

Tool Count5/5

With 11 tools, this server is well-scoped for managing Modal sandboxes. The count covers essential operations like sandbox lifecycle (launch, terminate), file management (read, write, push, pull, list, remove), and command execution, without being excessive. Each tool earns its place by addressing a specific need in the domain.

Completeness5/5

The tool set provides complete coverage for sandbox management, including CRUD-like operations: create (launch_sandbox), read (list_sandboxes, read_file_content_from_sandbox, list_directory_contents), update (write_file_content_to_sandbox, push_file_to_sandbox), and delete (terminate_sandbox, remove_path). It also supports execution (execute_command) and file transfer (pull_file_from_sandbox), ensuring no dead ends for agents working with sandboxes.

Maintenance

ActivityInactive
ResponsivenessNo issues

Resources

Unclaimed servers have limited discoverability.

Looking for Admin?

If you are the server author, to access and configure the admin panel.

Related MCP Connectors

Related MCP Servers

  • A
    license
    Not graded
    quality
    C
    maintenance
    A Model Context Protocol server that enables AI assistants like Claude to perform Python development tasks through file operations, code analysis, project management, and safe code execution.
    9
    MIT
  • -
    license
    A
    quality
    Not graded
    maintenance
    A Model Context Protocol server that allows LLMs to interact with Python environments, enabling code execution, file operations, package management, and development workflows.
    9
    -
  • A
    license
    B
    quality
    D
    maintenance
    A secure Model Context Protocol server that allows AI assistants and LLM applications to safely execute Python and JavaScript code snippets in containerized environments.
    2
    203
    MIT

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/milkymap/mcp4modal_sandbox'

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