Repository navigation
refactor(examples/mcp-app): factory entry, src/mcp/<server-id>.ts convention, and the mcp run doc flow (RFC #50 Phase 2) - #56
Conversation
…ult-exported factory The self-connecting bootstrap (StdioServerTransport import + top-level server.connect) is deleted; the generated stdio shell from RFC #50 Phase 1 now owns the transport, console-to-stderr guard, signal handling, stdin-EOF exit, bounded shutdown, and heartbeat. This is the raw v2-SDK witness for the shell (audiobook-curator covers the RSC path).
…nvention src/mcp-server.ts moves to src/mcp/status.ts (the declared server id) and the config drops its entry: line — the framework discovers the entry because the status server declares no entry/command/url, and inspect now reports provenance kind 'conventional'. This is the only in-repo witness for the convention.
The self-executing try/catch envelope becomes an exported main returning 0/1; the generated process envelope owns argv, awaiting, and exit-code adoption. Stdout, stderr, and exit-code contracts are unchanged.
…un foreground flow The authored-files prose now names src/mcp/status.ts, the factory shape, and the generated lifecycle shell; Noninteractive checks gains the verified `agent-bundle mcp run --server status --target portable` flow (temp artifact when --artifact is absent, EOF exits 0, Ctrl-C exits 130).
|
Codex Review SummaryThis comment shows the latest Codex review activity on this pull request.
ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings. |
commit: |
Summary
Phase-2 migration of
examples/mcp-apponto the RFC #50 Phase-1 surface merged in #52. mcp-app is the raw v2-SDK witness for the generated stdio shell (audiobook-curator covers the RSC path), the only in-repo witness for thesrc/mcp/<server-id>.tsentry convention, and now the doc witness foragent-bundle mcp run.src/mcp-server.tsdrops its self-connecting bootstrap (StdioServerTransportimport + top-levelawait server.connect(...)) for a default-exported factory. The generated shell now owns the transport, console-to-stderr guard, SIGINT/SIGTERM (130/143), stdin-EOF exit 0, 5 s bounded shutdown, and heartbeat.src/mcp/status.ts(the declared server id) and the config drops itsentry:line.agent-bundle inspectnow reports the server withprovenance: { kind: 'conventional' };packageBuildstays absent so the defaultdistartifact output is untouched (no AB4706).src/scripts/check-service-fixture.tsrewrites its self-executing try/catch toexport const mainreturning 0/1; the generated process envelope owns argv and exit-code adoption. Stdout/stderr/exit contracts are byte-identical.agent-bundle mcp run --server status --target portableforeground flow (temp artifact when--artifactis absent,--artifact distreuse, EOF → 0, Ctrl-C → 130, state under.agent-bundle/mcp-run/portable/status).packages/agent-bundle/tests/examples-contract.test.tsneeded zero edits — all migrations are behavior-preserving.Verification
pnpm --filter @agent-bundle-example/mcp-app check— validate + build, zero diagnostics; all three targets emit the wrapped entry fromsrc/mcp/status.ts.agent-bundle eval --case status-is-healthy --trials 1— 1 passed.itblocks pass untouched, including listMcp/invokeMcp through the wrapped factory, the inspect shape,payments-apipresent in every compiled MCP entry, and both script contracts (exact stdout; stale fixture exits 1 with the pinned stderr).pnpm test:examples:browser— 4/4 pass in real Chrome, including the full MCP App workflow tour (App preview, protocol trace, session restart).pnpm typecheckandpnpm lint— clean.mcp runsmoked three ways: against--artifact dist(initialize handshake on stdout,[status]heartbeat on stderr), without--artifact(temp artifact built in-project and removed), and SIGINT (exit 130).Refs RFC #50 (Phase 2); builds on #52.