GameFoundry

Updates

Async jobs for long-running MCP generations

September 15, 2026 MCPReliability

Async jobs for long-running MCP generations

Music tracks and 3D models take 60 to 180 seconds, longer than most MCP clients wait before timing out. We switched both tools to a submit-and-poll pattern with a new get_generation_job endpoint. Long generations finish reliably now.

The Vercel serverless function ceiling is 300 seconds. Some MCP clients have a shorter request timeout (Cowork bailed at about 60 seconds in our testing). A 90-second music generation held synchronously would complete on our side, but the agent's client had already given up. The user saw "connector not responding", credits were debited, no result came back.

The fix

generate_music and generate_3d_model now return immediately with a job_id (which is the Replicate prediction id, doubled as our ownership token). Your agent polls the new get_generation_job tool every few seconds until it returns status:"succeeded" with the R2 URL and metadata.

  • Submit charges credits up front and returns { job_id, status, eta_seconds }
  • Polling is free (get_generation_job costs nothing)
  • The first successful poll persists to R2 and writes the Generation row
  • Subsequent polls with the same job_id are no-ops that return the cached result (idempotent)
  • Terminal failures fire an idempotent refund on the first poll that observes them

The sync path is gone for these two tools; every other Phase 2 tool stays sync because it completes within any reasonable client timeout. If we add a new long-running tool in the future it slots into this same pipeline.