Skip to main content

Coala Runtime

An MCP (Model Context Protocol) server for executing Python and R scripts in containerized environments with support for dynamic package installation and file mounting.

Features

  • Containerized Execution: Run Python and R scripts in isolated containers (Docker, Podman, or Singularity/Apptainer — see COALA_CONTAINER_ENGINE in MCP_CONFIG.md)
  • Dynamic Package Installation:
    • Python: Uses uv for fast package installation
    • R: Based on bioconductor/bioconductor_docker (BiocManager for CRAN and Bioconductor packages)
  • File Mounting: Bind-mount local files and directories into containers
  • GPU Passthrough: Opt-in NVIDIA GPU access per call (gpu: true) or globally (COALA_GPU=1) — see MCP_CONFIG.md
  • Pre-installed packages: Python image includes numpy, pandas, scipy, matplotlib, scikit-learn, seaborn, openpyxl, xlrd; R image includes tidyverse, readxl, writexl
  • MCP Integration: Exposes coala_python_executor and coala_r_executor tools for LLM interaction

Prerequisites

  • Docker (default), Podman, or Singularity/Apptainer — set COALA_CONTAINER_ENGINE if not using Docker (see MCP_CONFIG.md)
  • Python 3.11 or higher
  • Executor images available locally or pullable (Docker/Podman: see Building Docker Images; Singularity/Apptainer: pulled on first run)

Installation

# Install dependencies
uv pip install -e .

# Or using pip
pip install -e .

Docker Images

Executor images (used by the MCP tools):

  • coala-runtime-python:latest
  • coala-runtime-r:latest

On MCP server start (Docker/Podman): if either image is missing locally, coala-runtime builds them from this repo (docker/build.sh). Set MCP cwd to the clone so the Dockerfiles are found.

coala-runtime          # build missing images, then start MCP server
coala-runtime --pull   # pull ghcr.io/coala-info/* , retag as coala-runtime-*:latest
coala-runtime --build  # force rebuild, then start
coala-runtime build    # build only (no MCP server)

Manual build (same tags as above):

./docker/build.sh

Usage

As MCP Server

The server can be run as an MCP server for LLM integration:

coala-runtime

Or with the module runner:

python -m coala_runtime

Use coala-runtime build to build images without starting the server; use --pull on start to fetch from Docker Hub instead of building.

Configuration

See MCP_CONFIG.md for detailed configuration instructions for various MCP clients (Cursor, Claude Desktop, etc.).

Tool Schemas

coala_python_executor

Executes Python scripts in a containerized environment with uv package management.

Input:

  • script or script_file (one required): Inline Python code or host path to a .py file
  • packages (optional): Additional packages to install via uv. The image already includes numpy, pandas, scipy, matplotlib, scikit-learn, seaborn, openpyxl, xlrd. Can include version specifiers (e.g., 'requests>=2.31.0')
  • conda_packages (optional, Python only): Conda specs installed before pip/uv (requires conda/mamba in the image)
  • docker_image (optional): Docker image to run instead of the default Coala Python image (e.g. python:3.12-slim, quay.io/biocontainers/...)
  • skip_package_install (optional): If true, skip install step (typical when docker_image already has all dependencies)
  • input_files (optional): Map of container paths to host paths for bind-mounting (e.g., {'/input/data.csv': '/host/path/data.csv'})
  • timeout (optional): Execution timeout in seconds (default: 300, 0 = no timeout, max: 3600)
  • gpu (optional): If true, expose the host's NVIDIA GPUs to the container (--gpus all on Docker/Podman, --nv on Singularity/Apptainer). Omit to follow COALA_GPU (default off). The default images have no CUDA libraries; add e.g. torch via packages or use a CUDA docker_image

Output:

  • success: Whether execution succeeded
  • exit_code: Process exit code (0 = success)
  • stdout: Standard output from script
  • stderr: Standard error output
  • output_files: List of output file paths (for files/images generated by the script)
  • output_data: Echoed output for strings/numbers (captured via print statements)
  • container_logs: Full container execution logs including package installation
  • execution_time: Execution time in seconds

coala_r_executor

Executes R scripts in a containerized environment with Bioconductor Docker (BiocManager for extra packages).

Input:

  • script or script_file (one required): Inline R code or host path to an .R file
  • packages (optional): Additional R packages to install. Use 'bioc::package_name' format for Bioconductor packages. The image already includes tidyverse, readxl, writexl. Examples: ['ggplot2', 'dplyr', 'bioc::Biobase']
  • docker_image (optional): Docker image to run instead of the default Coala R image (must provide Rscript on PATH)
  • skip_package_install (optional): If true, skip install step (typical when docker_image already has all dependencies)
  • input_files (optional): Map of container paths to host paths for bind-mounting (e.g., {'/input/data.csv': '/host/path/data.csv'})
  • timeout (optional): Execution timeout in seconds (default: 300, 0 = no timeout, max: 3600)
  • gpu (optional): If true, expose the host's NVIDIA GPUs to the container (--gpus all on Docker/Podman, --nv on Singularity/Apptainer). Omit to follow COALA_GPU (default off). The default images have no CUDA libraries; add e.g. torch via packages or use a CUDA docker_image

Output: Same as coala_python_executor

Development

# Install with dev dependencies
uv pip install -e ".[dev]"

# Run tests
pytest

# Format code
black src tests

# Lint code
ruff check src tests

License

MIT

Metadata

Release files for coala-runtime 0.1.11

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for coala-runtime 0.1.11
File Size Uploaded Provenance Actions
coala_runtime-0.1.11.tar.gz 124.0 kB With provenance Details for coala_runtime-0.1.11.tar.gz

Built distribution (wheel)

Table of built distributions (wheels) for coala-runtime 0.1.11
File Interpreter ABI Platform Actions
coala_runtime-0.1.11-py3-none-any.whl Python 3 none any Details for coala_runtime-0.1.11-py3-none-any.whl

Total release size: 167.4 kB

Release files / coala_runtime-0.1.11.tar.gz

Download URL coala_runtime-0.1.11.tar.gz
Size 124.0 kB
Tags Source
SHA-256 checksum
How to use checksums
36c93094c99b8d52c3ed9c2b3bef61b092b4bcb60b7dd88111bab5ea4504d382
BLAKE2b-256 checksum
How to use checksums
8d57d413a9491a17e3e1e631d0428d8c1f2fad5e087ad08fbc804184772b4831
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.16

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Nov 10, 2026.

Transparency log

Release files / coala_runtime-0.1.11-py3-none-any.whl

Download URL coala_runtime-0.1.11-py3-none-any.whl
Size 43.4 kB
Tags Python 3
SHA-256 checksum
How to use checksums
576e53442ec42027e03459c6d31da11db8288888f34cab5eb00fb54da291882b
BLAKE2b-256 checksum
How to use checksums
586231f093a0f575c84e3025d3bf3bcfa23814c276026771f97146d5ecf378f8
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.16

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Nov 10, 2026.

Transparency log

Security for coala-runtime 0.1.11

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

Full provenance

Both files in this release have been uploaded with provenance metadata.

Select from 2 files

Attestation for coala_runtime-0.1.11.tar.gz

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Nov 10, 2026.

Transparency log

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page