Use InstantML with agents

Expose InstantML runs, metrics, comparisons, exports, and reports to MCP-compatible agents.

Open .md

Connect an MCP-compatible agent to InstantML so it can inspect runs, fetch bounded metric series, compare selected runs, export evidence, and draft reports through the same API your SDK and dashboard use.

Tool summary

The MCP server exposes two groups of tools. Run tools read run, metric, and artifact data; report tools create and manage reports.

Run tools

ToolUse it for
tracker.list_projectsDiscover projects visible to the API key before choosing a run-search scope.
tracker.list_runsSearch and page run summaries by project, query, status, metric sort, and cursor.
tracker.compare_matching_runsRank matching runs server-side and return candidate evidence plus optional side-by-side difference rows.
tracker.get_runFetch one run summary by UUID.
tracker.list_metricsDiscover metric keys and latest/min/max/mean summary values for a run.
tracker.query_metricsFetch bounded metric points for one run and one metric key.
tracker.get_metric_series_batchFetch one metric across many run IDs through the batched series endpoint.
tracker.compare_runsCompare up to 50 already selected runs by config, metadata, tags, attributes, and metric summaries.
tracker.get_run_lineageInspect direct parent/fork lineage for a run.
tracker.list_run_artifactsList raw artifact metadata attached to a run.
tracker.list_run_artifact_edgesList versioned artifact input/output edges for a run.
tracker.list_artifact_collectionsDiscover versioned artifact collections, including checkpoint collections via type: "checkpoint".
tracker.get_artifact_versionFetch one versioned artifact by UUID.
tracker.list_artifact_versionsList available versions in a collection.
tracker.resolve_artifact_versionResolve references such as policy:latest or checkpoint/policy:best.
tracker.list_artifact_manifestPage manifest entries for a versioned artifact.
tracker.get_artifact_lineageInspect runs that produced or consumed a versioned artifact.
tracker.export_runsExport selected or filtered runs as bounded JSON or CSV.
tracker.workspace_view_dataResolve a portable dashboard view plus explicit run IDs into bounded panel data.

Report tools

ToolUse it for
tracker.list_reportsList reports in the workspace.
tracker.get_reportRead one report, including its ordered block body.
tracker.create_reportCreate a block-based report.
tracker.update_reportPatch a report title, description, visibility, or blocks.
tracker.delete_reportDelete a report.
tracker.export_report_markdownExport a report as Markdown text, optionally using a share token.
tracker.share_reportGenerate a public share token for a report.
tracker.report_block_schemaFetch the canonical block and panel schema example.
tracker.list_org_panelsDiscover existing report panel specs to reuse.
tracker.add_panel_to_reportAppend a panel to an existing report panel grid.

Prerequisites

  • An InstantML API key with export:read for run-analysis tools.
  • A workspace-scoped key when the agent should create or update reports across the workspace.
  • Node.js only when your client needs the mcp-remote bridge shown below.

Connect to the hosted server

Use the hosted MCP server for the fastest setup:

text
https://mcp.instantml.ai/mcp

You do not need to deploy your own InstantML backend, clone the InstantML repository, or keep a local MCP process running. Your agent connects over Streamable HTTP and sends an InstantML API key in the Authorization header.

Set up from the dashboard

  1. Open the InstantML dashboard and go to Agent in the nav rail.
  2. In the Connect panel, pick Browser sign-in (default, read-only) or API key. For a key, create an Agent MCP key in Workspace settings β†’ API first β€” the snippet fills it in for you.
  3. Copy the setup snippet for Claude Code, Codex, Cursor, VS Code, or a local bridge.
  4. Restart or reconnect the client, then ask it to list your latest InstantML runs. The panel's activity line confirms the first request.

Use the manual snippets below when setting up an agent before opening the dashboard. See the Agent tab for the dashboard walkthrough.

Browser sign-in (OAuth)

OAuth-capable clients can connect by URL alone and sign in through the browser instead of pasting a key. In the Agent tab's Connect panel, choose Browser sign-in and copy the tokenless snippet, for example:

bash
claude mcp add --transport http instantml "https://mcp.instantml.ai/mcp?org_id=<workspace-id>"

On first connect the client discovers the InstantML authorization server, opens a browser for you to approve access for your workspace, and receives a short-lived token β€” there is no key to copy, rotate, or commit. Clients without OAuth support keep using the API-key snippets below.

Browser sign-in is scoped to the workspace selected in the dashboard when you copy the snippet. If you belong to multiple workspaces, add one MCP server per workspace rather than using one connection for all of them.

Connect Claude Code

Register the hosted MCP server from your terminal:

bash
claude mcp add --transport http instantml https://mcp.instantml.ai/mcp \
  --header "Authorization: Bearer instantml_..."

Add --scope user to make the server available across all Claude Code projects. After adding the server, run /mcp inside Claude Code to confirm the server is connected.

Connect Codex

Export your InstantML API key:

bash
export INSTANTML_API_KEY=instantml_...

Then add the hosted server to ~/.codex/config.toml:

toml
[mcp_servers.instantml]
url = "https://mcp.instantml.ai/mcp"
bearer_token_env_var = "INSTANTML_API_KEY"

Connect Cursor

Open Cursor Settings, go to Tools and MCP, then add a custom MCP server:

json
{
  "mcpServers": {
    "instantml": {
      "transport": "http",
      "url": "https://mcp.instantml.ai/mcp",
      "headers": {
        "Authorization": "Bearer instantml_...",
        "Accept": "application/json, text/event-stream"
      }
    }
  }
}

Restart Cursor after saving the config.

Connect VS Code

Create or update .vscode/mcp.json in your workspace:

json
{
  "servers": {
    "instantml": {
      "type": "http",
      "url": "https://mcp.instantml.ai/mcp",
      "headers": {
        "Authorization": "Bearer instantml_..."
      }
    }
  }
}

Open the Command Palette and run MCP: List Servers, then start the InstantML server.

Bridge Claude Desktop and local-only clients

Some clients launch local stdio servers but do not yet support authenticated remote MCP headers. Use mcp-remote as a local bridge:

json
{
  "mcpServers": {
    "instantml": {
      "command": "npx",
      "args": [
        "-y",
        "mcp-remote",
        "https://mcp.instantml.ai/mcp",
        "--header",
        "Authorization:${INSTANTML_MCP_AUTH_HEADER}"
      ],
      "env": {
        "INSTANTML_MCP_AUTH_HEADER": "Bearer instantml_..."
      }
    }
  }
}

Restart the client after saving the config. The bridge runs locally and forwards requests to the hosted MCP server with your bearer token.

Configure other MCP clients

Use these connection settings:

FieldValue
TransportStreamable HTTP
URLhttps://mcp.instantml.ai/mcp
HeaderAuthorization: Bearer instantml_...
Accept header, if requiredapplication/json, text/event-stream

If your client only accepts a command, use:

bash
INSTANTML_MCP_AUTH_HEADER="Bearer instantml_..." \
npx -y mcp-remote https://mcp.instantml.ai/mcp \
  --header "Authorization:${INSTANTML_MCP_AUTH_HEADER}"

Verify the connection

Ask your agent:

text
List my InstantML projects and show the latest five runs.

The agent should discover the InstantML tools, call tracker.list_projects if it needs to choose a project, and then call tracker.list_runs.

Guide the agent's workflow

Ask the agent to narrow candidates before fetching detailed data:

text
Find the best finished cartpole runs tagged baseline, compare the top five by
eval/return_mean, and summarize the config differences.

The agent should usually call:

  1. tracker.list_projects if the project name is unknown.
  2. tracker.list_runs with project, query, sort_by: "metric-best", and metric_key.
  3. tracker.list_metrics if the metric key is unknown.
  4. tracker.get_metric_series_batch for bounded curves across the selected run IDs.
  5. tracker.compare_runs after narrowing to at most 50 run IDs.
  6. tracker.export_runs when you need portable evidence for a notebook or spreadsheet.

Search with run queries

tracker.list_runs uses the same run search language as the dashboard:

text
tag:baseline status:finished
notes:"reward stability" -tag:debug
(tag:baseline OR tag:candidate) config:lr
re:/seed-(13|14)/

Bare text, such as seed 13 reward, searches name, tags, notes, config, metadata, status, project, and ID as implicit AND terms.

Stay inside MCP limits

InstantML keeps MCP reads bounded:

  • Run summary pages are capped at 1,000 rows.
  • Batched metric series accepts up to 2,000 run IDs and caps total returned points.
  • Selected-run comparison accepts up to 50 run IDs and 5,000 compare rows.
  • Workspace-view data accepts up to 100 run IDs, 50 panels, 500 points per series, and 50,000 total metric points.
  • Selected export accepts up to 100 exact run IDs.

If an agent needs broad project analysis, ask it to start with summaries and metric aggregates, then fetch detailed series only for the candidate runs it selects.

Troubleshoot the connection

SymptomFix
The server is not listedRestart the client and check that the MCP config file is in the right location.
401 or authentication errorsCheck that the Authorization header starts with Bearer and uses a valid InstantML API key.
The server connects but run tools failUse a key with export:read; use a workspace-scoped key for cross-workspace report actions.
The client cannot connect to a remote URLUse the mcp-remote bridge or the local preview fallback below.
Tools return too much dataAsk the agent to start with summaries, then fetch bounded series only for selected runs.

Run the server locally (preview fallback)

During internal development, you can run the MCP server from a repository checkout instead of using the hosted endpoint:

json
{
  "mcpServers": {
    "instantml": {
      "command": "node",
      "args": ["/path/to/instantml/tools/mcp-server.mjs"],
      "env": {
        "INSTANTML_API_URL": "https://api.instantml.ai",
        "INSTANTML_WEB_URL": "https://instantml.ai",
        "INSTANTML_API_KEY": "instantml_..."
      }
    }
  }
}

The local fallback runs next to the agent over stdio. INSTANTML_API_URL defaults to https://api.instantml.ai, and INSTANTML_WEB_URL defaults to https://instantml.ai for report share links, so consumers normally only need to set INSTANTML_API_KEY.

Next steps