feat: add opt-in stateless mode for streamable-http transport#73
Merged
feat: add opt-in stateless mode for streamable-http transport#73
Conversation
Contributor
There was a problem hiding this comment.
Pull request overview
Adds an opt-in “stateless” mode for the streamable-http transport to support single-shot HTTP invocation environments (e.g., AWS Bedrock AgentCore), controlled via SYSDIG_MCP_STATELESS.
Changes:
- Add
Statelessboolean to configuration loaded fromSYSDIG_MCP_STATELESS(defaultfalse). - Thread stateless flag into
streamable-httpserver construction viamcp-gostreamable HTTP options. - Extend handler tests to cover
tools/listwithout priorinitializein stateless mode, and document the env var in README.
Reviewed changes
Copilot reviewed 6 out of 6 changed files in this pull request and generated 2 comments.
Show a summary per file
| File | Description |
|---|---|
internal/infra/mcp/mcp_handler.go |
Adds a stateless parameter and passes the corresponding option to the streamable HTTP server. |
cmd/server/main.go |
Wires cfg.Stateless into server startup for the streamable-http transport and logs the flag. |
internal/config/config.go |
Introduces Config.Stateless and loads it from SYSDIG_MCP_STATELESS. |
internal/config/config_test.go |
Adds assertions for default/override behavior of the new config flag. |
internal/infra/mcp/mcp_handler_test.go |
Updates existing streamable-http setup for new signature and adds a stateless test case. |
README.md |
Documents SYSDIG_MCP_STATELESS and its purpose. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
You can also share your feedback on Copilot code review. Take the survey.
tembleking
previously approved these changes
Mar 20, 2026
tembleking
previously approved these changes
Mar 20, 2026
3c9fde4 to
c1cc528
Compare
c1cc528 to
c0e16a1
Compare
tembleking
approved these changes
Mar 20, 2026
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
SYSDIG_MCP_STATELESSenv var (defaultfalse) to enable stateless mode for thestreamable-httptransportinitializehandshake orMcp-Session-Idtracking requiredinvoke-agent-runtimeis a single-shot HTTP POST with no session continuityAgentCore deployment config
Test plan
just checkpasses (fmt, lint, 142/142 specs)tools/listsucceeds without priorinitializewhen statelessMcp-Session-Idheader returned in stateless modemcp-remoteconnects and proxies through stateless serverSYSDIG_MCP_STATELESS=false) unchanged — not a breaking change