Skip to content

A read-only Frames MCP forwarder - #85

Open
dcmcand wants to merge 1 commit into
slice/frames-20-config-capsfrom
slice/frames-21-forwarder
Open

dcmcand wants to merge 1 commit into
slice/frames-20-config-capsfrom
slice/frames-21-forwarder

Conversation

@dcmcand

@dcmcand dcmcand commented Dec 3, 2026

Copy link
Copy Markdown
Contributor

Slice 21: The Frames MCP forwarder

A stateless MCP handler offers exactly list_frames and get_frame, forwards them to Frames with the token a source gives, refuses writes without calling Frames, and turns every failure into a clear tool error within the timeout.

Spec: nebari-dev/tapas/docs/superpowers/specs/2026-11-30-frames-integration-design.md
Plan: nebari-dev/tapas/docs/superpowers/plans/2026-12-01-agent-tokens-and-frames.md (Slice 21)
Contracts touched: Log events frames.ready, frames.unreachable, frames.token_refused, Agent-facing texts of Frames tool errors, The local build imports no go-sdk
Depends on: #84

  • internal/frames: route, tools, refused write tools, token source, start probe; no go-sdk import.
  • framesmcp.NewHandler: stateless, exact schema mirror, writes refused with no call to Frames, token only to Frames' own host, timeout on the Frames call only, 1 MiB cap.
  • A context bug fixed: the agent's MCP protocol version leaked into the call to Frames.
  • Integration test (tag frames) against Frames' real handler at pin ae0718e, in a temp repo and a loopback-only namespace; CI vets the tag.
  • Not mounted yet; Slice 22 does that.

Validation

Step Command / action Expected Result
unit go test -count=1 -race ./internal/frames/... ok ok
vet tag go vet -tags frames ./internal/frames/framesmcp/ clean clean
integration NEBARI_FRAMES_DIR=../nebari-frames bash scripts/test/frames-integration.sh ends ok .../internal/frames/framesmcp ok
local make test-local ok exit 0

internal/frames holds what the gateway and helper share about Frames:
the route, the tools offered (list_frames, get_frame), the write tools
refused, the token source seam, and a start probe that logs
frames.ready or frames.unreachable without holding start. Six reason
codes give agents plain texts for each failure.

framesmcp.NewHandler is a stateless MCP server that offers exactly the
two read tools with Frames' own input schemas, refuses the write tools
without calling Frames, and forwards each call with a new go-sdk client.
The person's token goes only to Frames' own scheme and host, the
timeout bounds the Frames call alone, and an answer over 1 MiB is
refused. A refused token logs frames.token_refused with Frames' reason
and never the token. The call to Frames runs on a context of its own,
because the agent's negotiated protocol version otherwise leaked into
it and Frames refused the request.

A frames-tagged integration test runs the forwarder against Frames' real
handler at a pinned commit, built in a temporary repository and run in
a loopback-only network namespace; CI vets that tag. contracts.md gains
the log events, the tool error texts and the Frames tools, and the plan's
evidence, checkpoint review and deviations are updated.
@dcmcand
dcmcand added this pull request to stack #40 December 3, 2026 08:18

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.

1 participant