Skip to content

docs(plan): define Studio MCP inventory and draft insertion - #1997

Draft
samuv wants to merge 1 commit into
mainfrom
plan/studio-mcp-inventory-draft-insertion
Draft

samuv wants to merge 1 commit into
mainfrom
plan/studio-mcp-inventory-draft-insertion

Conversation

@samuv

@samuv samuv commented Sep 29, 2026

Copy link
Copy Markdown
Contributor

Tracking: #1851

Stage

Plan / Interface (draft) for a Bounded, Split Studio change. This PR targets main and contains only the acceptance plan and its index entry. It starts from the merged chat contract associated with #1847. The decision record is None: ADR 0351 already sets the one-origin browser/BFF boundary and published-SDK rule.

The plan stays draft until #1850's final shared-panel interface is merged and reconciled, and a published SDK contains the separate tool-list prerequisite. Human review and merge of this Plan / Interface PR establish the implementation baseline; no implementation is included here.

Contract and behavior

  • Add one connection-scoped, read-only GET /api/v1/mcp/inventory BFF projection through the published SDK. The source Zod schema, OpenAPI document, and generated browser client define servers, catalog-admitted tools, prompts, resources, and source revision/stale/reconciling status. The BFF calls only list operations; it never expands prompts, reads resource content, or executes tools.
  • Keep the route behind Studio's existing session gate and per-request SDK credential context. Capability and online-state gates run before inventory reads. Fixed problem responses distinguish invalid request, expired session, disconnected runtime, unsupported MCP, and projection failure. A path-specific no-store middleware covers early 401/503 responses too. Transport URLs, structured credentials, diagnostics, tool schemas, prompt messages, and resource bodies stay out of the projection.
  • Omit resources with malformed URIs, userinfo, query or fragment components, or a data: URI. Eligible resource identities remain exact. Fail projection on duplicate model-facing tool names, and require the separate tool-list release to expose only catalog-admitted tools so a shadowed name cannot produce a misleading insertion.
  • Show a searchable server-first inventory in Studio chat: minimap, side panels, and session inspection #1850's shared panel on signed-in draft, editable chat, and inspect-only views. Server rows browse. Leaf rows insert only where a composer is editable; inspect-only views browse without insertion. Loading, empty, error with Retry, disconnected, unsupported, and online stale/reconciling states have distinct behavior.
  • Add an Insert from MCP menu only to editable composers. Choosing a tool, prompt, or resource inserts an exact, type-labelled plain-text reference at the saved caret or selection through the existing draft model. It does not send a prompt or call a tool. The plan covers keyboard, IME, touch, Escape, focus, session switching, and desktop/mobile layout.

Sequencing and in-flight work

Review and verification

  • The acceptance-plan checker passed: all 12 ACs have verification lines and all seven interface categories are populated. Its named-Go-test warning is advisory for this TypeScript-focused plan.
  • The acceptance-plan regression fixture suite passed.
  • CGO_ENABLED=0 task docs passed, including generated-reference checks and strict links: 590 documents and 5,761 references, with no broken links, anchors, or orphans. Plain task docs hit this host's macOS CGO linker; the successful run used CGO disabled. git diff --check passed.
  • One devil's-advocate pass and one security spot-check were folded into the error mapping, mobile-sheet expectation, tool collision rule, resource-URI policy, and early no-store coverage. Runtime and UI acceptance proofs are specified for the later implementation PR.

Implementation and merge remain separate human-reviewed steps.

Co-Authored-By: Mecatl <noreply@mecatl.dev>

Signed-off-by: Samuele Verzi <samu@stacklok.com>

This branch has not been deployed

No deployments
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.

2 participants