API Reference

FastMCP server factory, run registry, event models, and configuration types used by the MCP tools and resources.

Server

rampa.mcp.server.build_mcp_server()
function
function
rampa.mcp.server.build_mcp_server()

Build and configure the rampa MCP server.

Returns:

  • FastMCP – Configured MCP server with tools and resources registered.

  • >>> server = build_mcp_server()

  • >>> server.name

  • ’rampa’

Return type:

FastMCP

rampa.mcp.server.main()
function
function
rampa.mcp.server.main()

Entry point for the rampa MCP server.

Return type:

None

Registry

class rampa.mcp.registry.RunRecord
class
class
class rampa.mcp.registry.RunRecord

Bases: object

Per-run state in the registry.

Examples

>>> r = RunRecord(run_id="abc", script_path="test.py", started_at=0.0)
>>> r.is_complete
False
class rampa.mcp.registry.RuntimeRun
class
class
class rampa.mcp.registry.RuntimeRun

Bases: object

Non-serializable async state for an active run.

Held only while the run is in flight; the registry drops it on completion so the metric engine threads and client sessions behind it are released.

Examples

>>> import rampa.mcp.registry
class rampa.mcp.registry.RunRegistry
class
class
class rampa.mcp.registry.RunRegistry

Bases: object

Process-local registry of active and completed runs.

>>> reg = RunRegistry()
>>> reg.list_all()
[]

Events

The tools and resources hand back rampa’s own event types, which the library API Reference documents: a finished run arrives as a RunResult carrying a RunStatus, and a live run streams PhaseEvent, SnapshotEvent, and ThresholdEvent.

Configuration

You describe a run with the same Config the CLI loads, built from ScenarioConfig entries and their Stage ramps.

Metrics

Metric and threshold queries answer with a MetricSnapshot, a ThresholdResult per threshold, and the ThresholdExpression each one was parsed from.