Skip to main content
Glama

viva-mcp

ci

An MCP server that fronts compose-api — the hosted cosimulation service for reproducible biological workflows. It exposes compose-api's run / status / fetch / catalog surface as MCP tools, so any MCP client — a chat session, Claude Science, or Claude Code — can run process-bigraph composites without a local Workbench server.

This is Phase 1 (P1) of RFC-0009: a thin, stateless FastMCP wrapper over the typed compose-api-client. compose-api runs the same process-bigraph / bigraph-schema runtime as the viva ecosystem, so it executes viva composites natively.

Tools

Tool

What it does

compose-api

whoami

Who the server is authed as (or anonymous) + service health

whoami, health

list_simulators

The simulators the service can run

simulators

list_processes

Registered process-bigraph processes

processes

run_simulation

Submit a composite/SED-ML document (detached by default; wait=True to block)

submit / run_and_wait

simulation_status

Poll a run's status

status

fetch_results

Download a finished run's results to a local file

download

list_simulations

Recent runs (filter by status / only yours)

simulations

cancel_simulation

Cancel a running simulation

cancel_simulation

Typical flow: list_simulators → run_simulation(document_path=…) → simulation_status(id) until terminal → fetch_results(id).

Observability, datasets, and registry

Tool

What it does

compose-api

simulation_detail

One run's detail — latest job, event/dataset counts

simulation

simulation_events

A page of a run's events (filter by level/name; paged)

events

simulation_trace

A run's execution trace as a tree of spans

trace

list_datasets

Data files a run (or the caller) advertised

datasets

fetch_dataset

Download one dataset file locally

download_dataset

catalog

The registry — entries, curation level, providing environments

catalog

list_environments

The environments documents run in

environments

list_steps

Registered process-bigraph Steps (the /core steps)

steps

Read catalog / list_environments before authoring a document to see which process/step classes are available and in which environment.

Related MCP server: mcp-compressor

Install & run

uv pip install -e .            # or: pip install -e .
viva-mcp                       # serves over stdio (the default MCP transport)

Register it with an MCP client (Claude Code example):

claude mcp add viva-mcp -- viva-mcp

Configuration (environment)

Variable

Default

Meaning

COMPOSE_API_URL

https://compose.cam.uchc.edu

compose-api base URL (point at a local instance for dev)

COMPOSE_API_TOKEN

(unset)

Bearer token. Omit to run anonymously — anonymous runs are public.

Without a token the server runs anonymously (public runs). To run as yourself, obtain a token via the compose-api CLI (compose-api auth login, then an automation token) and set COMPOSE_API_TOKEN. See the compose-api CLI docs.

Develop

uv venv .venv && . .venv/bin/activate
uv pip install -e ".[dev]"
pytest -q                      # unit tests run offline (compose-api is mocked)

Status & roadmap

P1 (this repo) covers the run/status/fetch/catalog surface over stdio, and the full run → status → fetch chain is validated live (anonymously) against compose.cam.uchc.edu. Later phases (per RFC-0009): complete the surface (trace/events/datasets/registry), a hosted streamable-HTTP transport with token passthrough, and declaring the connector in the viva plugin so chat/Claude Science clients pick it up automatically.

Submitting documents. run_simulation takes a .pbg (process-bigraph composite) or .omex. A .pbg that references an external model file needs an .omex bundle instead. The environment is inferred from the document's process classes; this deployment currently offers viva-biogears and viva-pde-particle.

License

Apache-2.0.

Available Tools

16 tools
cancel_simulationCancel SimulationC

Cancel a running simulation.

Inputs: simulation_id (required). Returns: object

catalogCatalogA

The registry: every entry with its curation level and the environments that provide its classes.

This is the authoritative view of what the service can run — read it before authoring a document to see which process/step classes are available and where.

Inputs: no named parameters. Returns: object

fetch_datasetFetch DatasetA

Download one dataset (a file a run advertised) to a local file; returns the path and size.

dataset_id comes from list_datasets. Writes into dest_dir (a temp dir by default).

Inputs: dataset_id (required), dest_dir. Returns: object

fetch_resultsFetch ResultsA

Download a finished simulation's results to a local file.

Writes the results archive to dest_dir (a temp dir by default) and returns the path and size rather than the raw bytes, so the host can open or publish the file. Call only once the run is terminal (see simulation_status).

Inputs: simulation_id (required), dest_dir. Returns: object

list_datasetsList DatasetsA

The data files runs advertised: one simulation's (pass simulation_id) or all the caller may read.

Filter by kind or query q; page with the returned next_offset. Fetch one with fetch_dataset.

Inputs: q, kind, limit, offset, +1 more. Returns: object

list_environmentsList EnvironmentsB

The environments documents run in, with what their interface manifests hold.

A submitted document's environment is inferred from its process classes; this lists the choices.

Inputs: no named parameters. Returns: object

list_processesList ProcessesB

List the process-bigraph processes registered on the service.

Inputs: no named parameters. Returns: object

list_simulationsList SimulationsC

List recent simulations on the service (filter by status, or only yours).

Inputs: mine, limit, status. Returns: object

list_simulatorsList SimulatorsB

List the simulators compose-api can run (the run catalog).

Inputs: no named parameters. Returns: object

list_stepsList StepsA

List the process-bigraph Steps registered on the service (the /core steps catalog; see also list_processes).

Inputs: no named parameters. Returns: object

run_simulationRun SimulationA

Submit a composite/SED-ML document to compose-api for simulation.

document_path is a local path to the composite or SED-ML document. By default the run is detached: the tool returns a simulation id and status; poll with simulation_status and collect with fetch_results. Set wait=True to block (up to timeout seconds) and return the terminal status in one call — use only for short runs.

Inputs: document_path (required), wait, timeout, interval, +2 more. Returns: object

simulation_detailSimulation DetailA

Detail for one simulation: its latest job, and how many events and datasets its run recorded.

Richer than simulation_status (which is just the current job state) — use it to see whether a finished run produced events/datasets worth fetching.

Inputs: simulation_id (required). Returns: object

simulation_eventsSimulation EventsA

A page of a run's events, in the order recorded (logs/progress/warnings).

Pass the returned next_cursor as after for the next page; narrow with level (e.g. "error") or an event name. Use this to see why a run behaved as it did.

Inputs: simulation_id (required), after, event, level, +1 more. Returns: object

simulation_statusSimulation StatusA

Current status of a submitted simulation (poll until terminal).

Inputs: simulation_id (required). Returns: object

simulation_traceSimulation TraceC

A run's execution trace as a tree of spans, each with its own events — where the run spent its time.

Inputs: simulation_id (required). Returns: object

whoamiWhoamiA

Who the server is authenticated as (or anonymous), and service health.

Use this first to confirm the connector can reach compose-api and whether a token is in effect.

Inputs: no named parameters. Returns: object

Tool Schema Changelog

Recent tool additions, removals, and schema changes observed during successful MCP inspections.

Loading tool schema changelog…

    TDQS

    B3.4/5.0

    Scored across 16 tools

    Disambiguation4/5

    Most tools target clearly distinct objects or lifecycle stages (run, poll, fetch, cancel, inspect events/trace). The one soft spot is the cluster of discovery tools — catalog, list_simulators, list_processes, list_steps, list_environments — whose boundaries overlap, though descriptions mostly differentiate them (catalog is authoritative, simulators are runnable targets, processes/steps are class catalogs).

    Naming Consistency3/5

    Action tools follow a clean verb_noun pattern (run_simulation, fetch_results, cancel_simulation, list_datasets), but the read/inspection tools use bare nouns (catalog, simulation_status, simulation_detail, simulation_trace, whoami). The two conventions are readable but mixed within the same set.

    Tool Count4/5

    16 tools is slightly on the heavy side but each maps to a real part of the simulation lifecycle: discovery, submission, polling, observability, and artifact retrieval. None feel clearly redundant, though consolidation of the discovery tools could trim the set.

    Completeness4/5

    The surface covers discovery, submission, status/detail, cancellation, listing, event/trace inspection, and dataset fetching — a full lifecycle. Minor gaps remain, such as validating or editing a document before submission and deleting/cleaning up simulations or datasets.

    Maintenance

    ActivityMaintained
    ResponsivenessNo recent community issues

    Related MCP Connectors

    Related MCP Servers

    • A
      license
      Not graded
      quality
      C
      maintenance
      Wraps any existing MCP server to reduce tool-description token usage by exposing a compact discovery interface with namespaced tools.
      MIT
    • A
      license
      A
      quality
      D
      maintenance
      Enables models to discover, inspect, and call tools from thousands of MCP servers on the fly through a single gateway, without pre-configuring each server.
      5
      70 npm
      3
      MIT
    • A
      license
      B
      quality
      D
      maintenance
      Enables controlling a local Scilab/Xcos installation to discover installed block libraries, create native block templates, read, write, and validate diagrams, and run simulations of arbitrary positive duration that return named numerical signal series. It exposes these capabilities as MCP tools over stdio or streamable HTTP, with model file access restricted to configured filesystem roots.
      11
      2
      GPL 3.0