Overview
Add opt-in Starlark script execution ("code mode") to vMCP, allowing agents to batch multi-tool workflows into a single server-side call — reducing round-trips, context bloat, and inference cycles. Based on the prototype in PR #4714.
Background
Agents today make sequential tool calls with model inference between each one. For multi-service workflows (e.g., incident triage across PagerDuty, Datadog, Slack, Jira), this means 10+ round-trips and significant token spend. Scripting is possible today only through CLI/shell access, which is less safe and unavailable for knowledge worker use cases where agents lack a shell environment. The prototype demonstrates ~15s improvement by executing a Starlark script server-side that calls tools directly, with parallel() fan-out — without requiring shell access.
This epic production-hardens the prototype and ships it as an opt-in feature. It does NOT implement the full RFC THV-0060 session initialization model.
User Story Breakdown
| Story ID |
Title |
Description |
Persona |
Goal |
Acceptance Criteria |
GitHub Issue # |
| STORY-001 |
Ship opt-in code mode for vMCP |
As a platform engineer, I want my agents to be able to execute scripts on tools without shell access so that they can safely reduce context bloat and inference cycles |
Platform engineer |
Enable server-side script execution for agents |
Config toggle, proper dispatch, configurable limits, timeouts, optimizer compat |
|
| STORY-002 |
Add observability for script execution |
As a cluster operator, I want logging and metrics for script execution so that I can monitor and diagnose issues |
Cluster operator |
Operational visibility |
Structured logs, execution metrics, telemetry integration |
|
| STORY-003 |
Track code mode adoption and usage |
As a ToolHive developer, I want to know how many people are opting in to code mode and how many tool calls come through it so that I can gauge adoption and prioritize investment |
ToolHive developer |
Understand adoption |
Opt-in counts, call volume comparison, telemetry pipeline |
|
Acceptance Criteria
References
Overview
Add opt-in Starlark script execution ("code mode") to vMCP, allowing agents to batch multi-tool workflows into a single server-side call — reducing round-trips, context bloat, and inference cycles. Based on the prototype in PR #4714.
Background
Agents today make sequential tool calls with model inference between each one. For multi-service workflows (e.g., incident triage across PagerDuty, Datadog, Slack, Jira), this means 10+ round-trips and significant token spend. Scripting is possible today only through CLI/shell access, which is less safe and unavailable for knowledge worker use cases where agents lack a shell environment. The prototype demonstrates ~15s improvement by executing a Starlark script server-side that calls tools directly, with
parallel()fan-out — without requiring shell access.This epic production-hardens the prototype and ships it as an opt-in feature. It does NOT implement the full RFC THV-0060 session initialization model.
User Story Breakdown
Acceptance Criteria
parallel()References