ai newsMi., 25. Nov.
EilmeldungYale’s Sonnenfeld: Nvidia is a ‘detriment’ to U.S. industrial might — not a champion

Stateful Comic-Studio über Streamable HTTP MCP für AI-Coding-Agents

Zustandslose Text-to-Image-APIs scheitern, wenn zwei aufeinanderfolgende Comicseiten dieselbe Figur zeigen sollen. Ein neuer Ansatz nutzt eine Zustandsmaschine über Streamable HTTP MCP, damit Claude Code, Cursor und Antigravity konsistente Comics erzeugen können.

dev.toDienstag 05:31 · 24.11.DE3 Min. Lesezeit
Bild: dev.to

Veröffentlicht am 24. Nov. • Ursprünglich veröffentlicht auf starveilai.com

TL;DR: Der Aufruf zustandsloser Text-zu-Bild-APIs aus einem KI-Coding-Agent bricht zusammen, sobald man zwei aufeinanderfolgende Comic-Seiten mit derselben Figur und lesbaren Sprechblasen benötigt. Dieser Beitrag führt durch die 4-Stufen-Comic-State-Machine für Agenten, die wir über Streamable HTTP MCP ( https://starveilai.com/api/mcp ) ausgeliefert haben, die 3-Zonen-Bounding-Box-Geometrie, die Tippfehler ohne vollständiges Neugenerieren behebt, sowie ein echtes Cloudflare Workers OAuth 2.1 JWKS-Problem, auf das wir während der Glama-Zertifizierung gestoßen sind.

KI-Coding-Agenten (Claude Code, Antigravity, Cursor, Codex, OpenClaw) sind hervorragend in mehrstufigen Tool-Schleifen, aber völlig ungeeignet, um mit rohen Bildgeneratoren fortlaufende Comics zu zeichnen. Der Engpass ist nicht die Ästhetik, sondern der fehlende Zustand:

In Anlehnung an die offene Model Context Protocol-Spezifikation und IETF RFC 9728 OAuth 2.0 Protected Resource Metadata unterteilt StarVeil AI 2.0 die Comic-Generierung in vier explizite Zustandsübergänge über 18 vom Agenten aufrufbare MCP-Tools (plus einem eingebetteten MCP-App-Seitenbereich):

# Claude Code (OAuth 2.1 — einmalige Freigabe im Browser, keine Secrets im Chat) claude mcp add --transport http starveil https://starveilai.com/api/mcp # Antigravity / Cursor / Codex / CLI (installiert Plugin, starveil-cli und SKILL.md) curl -fsSL https://starveilai.com/install.sh | bash Vollbildmodus öffnen Vollbildmodus beenden Für Headless-Automatisierung ( OpenClaw, n8n, GitHub Actions, Cron-Jobs) erzeugen Sie einen widerrufbaren persönlichen API-Key vom Typ sv_live_ unter https://starveilai.com/app/agents und senden Sie Authorization: Bearer sv_live_... an exakt denselben Endpunkt.

{ "tool": "create_character", "arguments": { "name": "Mochi the Tabby", "description": "Warm orange tabby kitten wearing an indigo developer hoodie", "referenceImageUrl": "https://example.com/mochi-photo.jpg" } } 2. Seite 1 rendern, dann Seite 2 über previousTaskId verketten { "tool": "create_comic_page", "arguments": { "title": "The Yarn Ball Incident - Page 2", "characterIds": [ "chr_mochi_01" ], "previousTaskId": "task_page1_id", "artStyle": "warm watercolor healing storybook comic", "language": "en", "prompt": "Direct continuation after Page 1. Panel 1: Sleepy engineer enters with coffee staring at the red yarn web.

Panel 2: Mochi peeks out: \"Good news: zero merge conflicts.\" Panel 3: Warm sunrise wide shot as the engineer laughs." } } Vollbildmodus öffnen Vollbildmodus beenden

Informed by masked diffusion inpainting ( RePaint, arXiv:2201.09865 ), mask geometry matters as much as the prompt. Leave a 2%–3% halo buffer outside the black balloon stroke so old letters don't leave artifacts while everything outside the box stays anchored:

{ "tool": "edit_comic_page", "arguments": { "taskId": "task_noir_page1", "instruction": "Text-only edit inside the boxed white speech bubble: replace text with exact words \"He left at midnight.\" Keep face, rain lighting, and surrounding panels unchanged.", "region": { "x": 0.54, "y": 0.06, "width": 0.40, "height": 0.16 } } } Vollbildmodus öffnen Vollbildmodus beenden Production War Story: OAuth 2.1 JWKS Self-Fetch auf Cloudflare Workers Als wir StarVeil MCP bei Glamas Connector-Verzeichnis einreichten, verlief die OAuth-Autorisierung im Browser erfolgreich, doch die stündlichen tools/list-Health-Checks gaben HTTP 500 zurück.

Die Ursache: Better Auths mcpHandler({ jwksUrl }) ruft https://starveilai.com/api/auth/jwks während der Token-Verifizierung über HTTP ab, was auf Cloudflare Workers einen Same-Zone-Self-Fetch zurück auf dieselbe Worker-Route auslöst und unter Edge-Proxy-Regeln fehlschlägt.

Die Lösung bestand darin, den Remote-JWKS-HTTP-Abruf durch eine lokale JWKS-Suche im selben Prozess direkt gegen Cloudflare D1 zu ersetzen ( jose.createLocalJWKSet + jwtVerify mit exakter Issuer- und Audience-Verifizierung). Die Latenz sank, der HTTP-500-Fehler verschwand dauerhaft, und Glamas stündliche Introspektion meldet nun Healthy mit OAuth: Works in Glama.

Neue verifizierte Konten erhalten 1 kostenlose Vollfarb-Seite im Format 3:4, 1 kostenloses Box-Edit sowie Foto-OC-Uploads ohne Credit-Abzug ( trial_v1 ). Nicht ablaufende Credit-Pakete beginnen bei 6 US-Dollar im Mini-Format (1.000 Credits, ca. 40 Seiten) und schalten sofort 100 % wasserzeichenfreie kommerzielle PNG-Downloads über Web, MCP, CLI und API frei.

Automatisch übersetzt. Das Original auf Englisch ist unten aufklappbar.

Original (Englisch) anzeigen

Posted on Nov 24 • Originally published at starveilai.com

TL;DR: Calling stateless text-to-image APIs from an AI coding agent breaks down as soon as you need two consecutive comic pages with the same character and legible speech bubbles. This post walks through the 4-Stage Agent Comic State Machine we shipped over Streamable HTTP MCP ( https://starveilai.com/api/mcp ), the 3-Zone Bounding-Box geometry that fixes typos without full rerolls, and a real Cloudflare Workers OAuth 2.1 JWKS gotcha we hit during Glama certification.

AI coding agents (Claude Code, Antigravity, Cursor, Codex, OpenClaw) are great at multi-step tool loops, yet terrible at drawing sequential comics with raw image generators. The bottleneck isn't aesthetics — it's missing state:

Following the open Model Context Protocol specification and IETF RFC 9728 OAuth 2.0 Protected Resource Metadata, StarVeil AI 2.0 splits comic generation into four explicit state transitions across 18 agent-callable MCP tools (plus an embedded MCP App side-pane):

# Claude Code (OAuth 2.1 — one-click browser approval, no secrets in chat) claude mcp add --transport http starveil https://starveilai.com/api/mcp # Antigravity / Cursor / Codex / CLI (installs plugin, starveil-cli, and SKILL.md) curl -fsSL https://starveilai.com/install.sh | bash Enter fullscreen mode Exit fullscreen mode For headless automation ( OpenClaw, n8n, GitHub Actions, cron jobs), generate a revocable sv_live_ Personal API Key at https://starveilai.com/app/agents and send Authorization: Bearer sv_live_... to the exact same endpoint.

{ "tool": "create_character", "arguments": { "name": "Mochi the Tabby", "description": "Warm orange tabby kitten wearing an indigo developer hoodie", "referenceImageUrl": "https://example.com/mochi-photo.jpg" } } Enter fullscreen mode Exit fullscreen mode 2. Render Page 1, Then Chain Page 2 via previousTaskId { "tool": "create_comic_page", "arguments": { "title": "The Yarn Ball Incident - Page 2", "characterIds": [ "chr_mochi_01" ], "previousTaskId": "task_page1_id", "artStyle": "warm watercolor healing storybook comic", "language": "en", "prompt": "Direct continuation after Page 1. Panel 1: Sleepy engineer enters with coffee staring at the red yarn web.

Panel 2: Mochi peeks out: \"Good news: zero merge conflicts.\" Panel 3: Warm sunrise wide shot as the engineer laughs." } } Enter fullscreen mode Exit fullscreen mode

Informed by masked diffusion inpainting ( RePaint, arXiv:2201.09865 ), mask geometry matters as much as the prompt. Leave a 2%–3% halo buffer outside the black balloon stroke so old letters don't leave artifacts while everything outside the box stays anchored:

{ "tool": "edit_comic_page", "arguments": { "taskId": "task_noir_page1", "instruction": "Text-only edit inside the boxed white speech bubble: replace text with exact words \"He left at midnight.\" Keep face, rain lighting, and surrounding panels unchanged.", "region": { "x": 0.54, "y": 0.06, "width": 0.40, "height": 0.16 } } } Enter fullscreen mode Exit fullscreen mode Production War Story: OAuth 2.1 JWKS Self-Fetch on Cloudflare Workers When we submitted StarVeil MCP to Glama's connector directory, OAuth authorization succeeded in the browser, yet hourly tools/list health checks returned HTTP 500.

The culprit: Better Auth's mcpHandler({ jwksUrl }) fetches https://starveilai.com/api/auth/jwks over HTTP during token verification — which on Cloudflare Workers triggers a same-zone self-fetch back to the same Worker route and fails under edge proxy rules.

The fix was replacing the remote JWKS HTTP fetch with an in-process local JWKS lookup directly against Cloudflare D1 ( jose.createLocalJWKSet + jwtVerify with exact issuer / audience verification). Latency dropped, the HTTP 500 disappeared permanently, and Glama's hourly introspection now reports Healthy with OAuth: Works in Glama.

New verified accounts receive 1 free full-color 3:4 page + 1 free box-edit + 0-credit photo OC uploads ( trial_v1 ). Never-expiring credit packs start at $6 Mini (1,000 credits, ~40 pages) and immediately unlock 100% watermark-free commercial PNG downloads across Web, MCP, CLI, and API.

Originaltitel: Building a Stateful AI Comic Studio Over Streamable HTTP MCP (for Claude Code, Cursor & Antigravity)Quelle: dev.to (dev.to). Original öffnen