Add MCP sessions, SSE streaming, and interactive passthrough - #15
Merged
Conversation
Catch up with the real gateway's May-2026 protocol capabilities. - Serving mode: the default is now stateful sessions + SSE streaming (Mcp-Session-Id issued on initialize, responses as event streams) -- the modern faithful behavior. server.stateless: true restores the previous buffered stateless mode. BREAKING DEFAULT (0.x), called out in README/docs. - Progress + logging passthrough: an MCP target's mid-call progress and logging notifications re-emit to the calling client as they arrive (progressToken keyed by the SDK; log levels preserved). Outside a gateway request they drop silently. - Elicitation + sampling passthrough: a downstream server's elicitation (form mode) and sampling requests relay to OUR caller via the SDK ServerSession (raw requestedSchema forwarded 1:1; sampling carries system prompt, temperature, stop sequences, model preferences), the answer travelling back down. Requires sessions; stateless mode returns a clear error. URL-mode elicitation is a documented limitation. - Concurrent calls through one MCP target route upstream-initiated traffic to the most recent in-flight caller (documented; the real gateway scopes per user session, we have no inbound identity). Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Merged
tawAsh1
added a commit
that referenced
this pull request
Jul 5, 2026
The extension arc since 0.2.1, one feature pack per PR:
- MCP-passthrough targets (streamable HTTP + local stdio) and ${VAR}
config expansion (#6)
- lcgw sync + lcgw tail: local admin surface, target re-sync without
restart, live invocation feed (#8)
- Hybrid debugging: aws-gateway targets (proxy a deployed AgentCore
Gateway, SigV4) and lambda backend: aws, behind the optional [aws]
extra (#9)
- Mock targets, contract checks (off/warn/error), and the public
localcore_gateway.testing module (#11)
- lcgw schema (config JSON Schema for editors) and lcgw preflight
(real-AgentCore deploy-constraint validation) (#12)
- Prompts and resources passthrough for MCP targets, with
resourcePriority routing (#14)
- MCP sessions + SSE streaming by default (server.stateless: true for
the old buffered mode -- BREAKING default) and progress/logging/
elicitation/sampling passthrough (#15)
- Smithy model targets, completing the real gateway's target-type
matrix (#16)
- Dependency security bumps clearing all Dependabot alerts (#13),
Japanese README (#7, #10)
Co-authored-by: Claude Fable 5 <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
The big fidelity pack: catches the local gateway up with the real gateway's May-2026 protocol capabilities (sessions, progress, logging, elicitation, sampling). Nothing punted.
The gateway now serves stateful MCP sessions with SSE streaming by default (
Mcp-Session-Idon initialize,text/event-streamresponses) — matching the modern real gateway instead of its pre-May-2026 buffered behavior.server.stateless: truerestores the old mode. All integration behavior is tested in both modes (parametrized matrix), including the contract-checks SDK-bypass pin.Progress + logging passthrough
An MCP target's mid-call
progressandloggingnotifications now re-emit live to the calling client (previously they died at our upstream client). Progress is keyed to the caller's progressToken by the SDK; log levels/logger names are preserved. Outside a gateway request (lcgw invoke, direct target calls) they drop silently.Elicitation + sampling passthrough
A downstream server can now ask OUR caller mid-tool-execution:
requestedSchemais forwarded 1:1 via the SDK ServerSession (no Python re-typing), the answer travels back down. URL mode is a documented limitation (clear error).Documented caveats
Concurrent calls through one MCP target route upstream-initiated traffic to the most recent in-flight caller (the real gateway scopes per user session; we have no inbound identity). No per-user scoping or 1-hour timeout emulation. Prompt/resource reads don't carry the interactive relay (tools only, like invocation history).
Test plan
ruff check/ruff format --checkclean.🤖 Generated with Claude Code