Skip to content

docs(atlas): plan the @kolu/surface/mcp adapter scope (#982) - #1266

Merged
srid merged 4 commits into
masterfrom
atlas-surface-mcp
Jun 10, 2026
Merged

docs(atlas): plan the @kolu/surface/mcp adapter scope (#982)#1266
srid merged 4 commits into
masterfrom
atlas-surface-mcp

Conversation

@srid

@srid srid commented Jun 10, 2026

Copy link
Copy Markdown
Member

Plan-of-record Atlas note for #982 — the generic @kolu/surface/mcp adapter (expose any stdio-served surface as an MCP server).

The issue's framing is right: the framework is one adapter away from "every Kolu surface is also an MCP server." This note argues for scoping it to the part that's actually a framework primitive, because we already shipped the rest by hand (odu's odu mcp face, juspay/odu#3 / #1258) and learned exactly where the seam falls.

Thesis

  • The 1:1 map is the demo, not the product. Of odu's five MCP tools, exactly one (rerun_node) is a procedure mapped 1:1; the four useful ones (get_nodes, tail_log, wait_for_settle, run) are hand-authored projections/compositions — and the surface's other procedure (run.configure, dangerous) is deliberately not a tool. "Every procedure → tool" ships the dangerous verb and misses the good ones.
  • The hard part is lifecycle, not mapping. The bulk of odu's src/mcp/ (~1550 lines, not "one file") is ResourcePusher — the resources/subscribe teardown done right (the generation-token / detach-without-abort dance that dodges the ERR_STREAM_DESTROYED race). That, plus the missing zod→JSON-Schema bridge and composition with the already-shipped serveOverStdio stdout discipline, is the genuinely generic spine worth extracting.
  • Two shapes, named apart: serve a fresh spec (the notes-app demo) vs. bridge a live running surface (odu dials .ci/odu.sock). Pick bridge-a-live-surface as primary.
  • The authz boundary every adapter inherits: every exposed procedure is RCE for whoever connects — fine single-operator, load-bearing the moment it's multi-client. The selection gate must be default-deny.
  • Electricity test, applied honestly: the spine graduates (odu can delete it); the curation/guards stay hand-written. Scope @kolu/surface: expose any stdio-served surface as an MCP server (3rd example demo) #982 to the spine + gate, with the notes demo as falsifiability proof and odu's partial migration as the graduation receipt — not "every surface is an MCP server for free."

Files

  • docs/atlas/src/content/atlas/surface-mcp.mdx — the new plan note (kind: feature, status: proposed), with a D2 architecture diagram of the seam.
  • docs/atlas/src/content/atlas/mini-ci-vs-justci.mdx — forward-reference from odu's MCP-face section to the generic package (and dropped the now-inaccurate "~one file" claim).
  • docs/atlas/dist/ — rebuilt + staged (ci::atlas-sync green, host-independent).

Rendered preview: https://htmlpreview.github.io/?https://github.com/juspay/kolu/blob/atlas-surface-mcp/docs/atlas/dist/surface-mcp.html

Proposed plan — status: proposed, for review. Not merged.

🤖 Generated with Claude Code

srid added 4 commits June 10, 2026 14:27
A plan-of-record note for #982 — the generic surface→MCP
adapter. Argues for scoping it to the lifecycle spine (subscribe/teardown,
zod→JSON-Schema, stdout discipline) + a default-deny selection/authz gate,
not the auto-map; grounded in odu's hand-built mcp face as validated-but-
partial prior art. Cross-linked from the odu note.
…lo-world + 2nd-surface cut

- Diagram: grid-columns single-column stack (was scaled-down/unreadable when
  wide); vertical spine→gate flow, fixing the prose's 'above' claim.
- Package: recommend packages/surface-mcp/ (@kolu/surface-mcp) sibling over the
  issue's @kolu/surface/mcp subpath — keeps @modelcontextprotocol/sdk out of core.
- Worked example grounded in odu (not the notes demo): bridge the live coordinator
  via serveSurfaceAsMcp + an expose allowlist; ~1550 LoC → a projection surface.
- New section: curation as a second surface (oduAgentSurface) so the adapter
  subsumes the compositions/guards too; refined the electricity verdict.
- (zod→JSON-Schema paragraph still pending prior-art research workflow.)
…o tag in TS

- zod→JSON-Schema: rewrite to BUY zod 4's native z.toJSONSchema (empirically
  verified vs pinned zod@4.3.6; old zod-to-json-schema sunset Nov 2025), naming
  the thin glue the package still owns (io:input, unrepresentable override,
  the mandatory  dereference pass for cross-client compat, top-level object,
  one toInputSchema() + snapshot test for the zod-version-default seam).
- New '### How the developer tags it' subsection: three default-deny mechanisms
  (structural membership · typed expose allowlist · co-located wrapper helpers);
  notes that decorators don't fit plain-object specs. Answers the @mcp-tool ask.
…-tools escape hatch, total graduation

Per review: don't defer the framework work, and don't force everything through surface.

- Curation section rewritten: projectSurface is scoped INTO #982 (combinator +
  surfaceClientRef server-as-client enabler + a derive helper), grounded in the
  framework (sibling composition + handler source shapes already exist; the
  projected-stream teardown is the SAME lifecycle the spine builds — solved once).
  New topology diagram. Drops the '~90% / maybe later' hedge.
- Two paths, no gap: surface-mcp also takes bespoke 'tools' (hand-authored,
  compose over the live client, share the spine) for genuinely call-shaped
  capabilities — run is now a bespoke tool, not a forced primitive.
- Verdict ③ → total graduation; recommendation → one PR, three parts
  (adapter + projectSurface in core + odu's full migration).
- Intro reframed as 'right-scoping' (smaller on zod/stdio, bigger on projection).
@srid
srid marked this pull request as ready for review June 10, 2026 19:04
@srid
srid merged commit 68ef45a into master Jun 10, 2026
2 checks passed
@srid
srid deleted the atlas-surface-mcp branch June 10, 2026 19:05
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant