-
Notifications
You must be signed in to change notification settings - Fork 0
feat(mcp): MPP-gated deploy flow — agents pay to host persistent services #28
Copy link
Copy link
Open
Labels
enhancementNew feature or requestNew feature or request
Description
Summary
Part 2 of MPP compute on Jack Cloud. Part 1 (execute_code, PR #27) ships instant sandboxed code execution. This issue covers persistent hosting: an agent pays via MPP and gets a live URL that stays up.
Context
- PR feat(mcp): MPP payment sessions + execute_code tool #27 adds
execute_codeMCP tool with MPP payments (live, verified) - gakonst tweet: "desperately need MPP-enabled compute & hosting"
/executehandles the "compute" half. This issue handles the "hosting" half.- Design docs:
~/.gstack/projects/getjack-org-jack/hellno-machine-payments-design-*.md
What this enables
Agent calls deploy_project MCP tool without a human account. Jack returns an MPP session challenge. Agent opens a Tempo payment channel ($5 min deposit). Agent deploys code, gets a live URL. Subsequent deploys (redeploys, iterations) deduct from session balance. Services suspend when balance hits zero.
Architecture
Agent → MCP Worker → deploy_project tool
├── chargeSession() → ComputeSession DO
│ ├── No session → 402 MPP challenge (session intent)
│ └── Valid voucher → deduct $0.05 per deploy
├── bundleCode(files) → esbuild-wasm
├── Create project via control plane API (ephemeral org)
├── Upload deployment via FormData
└── Return { url, deployment_id, expires_at }
Key decisions needed
- Bundler location: Extract
apps/mcp-worker/src/bundler.tstopackages/bundler/so template and MCP worker share one implementation? Or duplicate? - Ephemeral orgs: MPP sessions need a control plane org to own projects. Create ephemeral orgs with no human owner? Or reuse existing org model with a machine flag?
- Deploy TTL: 24h auto-expire? Or keep alive until session balance exhausted? (Design doc says "until balance exhausted with 7-day inactivity timeout")
- Runtime metering: Free deploys, metered runtime (requests + CPU). Requires dispatch worker changes. How much latency does DO balance checking add? (Design doc targets <5ms p50)
- Cleanup: Cron to garbage-collect expired/abandoned deployments from dispatch namespace
Implementation pieces
-
deploy_projectMCP tool with MPP session gating - Ephemeral org creation in control plane for MPP sessions
- Session-to-project cardinality tracking in ComputeSession DO
- Extract bundler to shared package (DRY with MCP worker)
- Dispatch worker metering integration (Phase 2)
- Auto-suspend on zero balance (Phase 2)
- Cleanup cron for expired deployments (Phase 2)
Pricing model (from design doc)
| Resource | Rate |
|---|---|
| Deploy / redeploy | $0.05 per deploy |
| Worker requests | $0.50 / million |
| CPU time | $12.50 / million ms |
| D1 reads/writes | $0.25-1.00 / million |
Deploys have a small fixed cost. Runtime is metered. Session minimum $5 USDC.
Dependencies
- PR feat(mcp): MPP payment sessions + execute_code tool #27 merged (execute_code + ComputeSession DO + MPP auth)
- Control plane support for ephemeral orgs
- Bundler extraction (or accept duplication for V1)
References
- gakonst tweet
- MPP spec
- Design doc #1 — compute sessions
- Design doc #2 — mpp-compute template (superseded by platform approach)
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
enhancementNew feature or requestNew feature or request