feat: add Streamable HTTP transport#20
Open
pen-pal wants to merge 4 commits into
Open
Conversation
Owner
|
Hey @pen-pal — this looks great! Merge conflict with main (likely from the --version flag in #18 which landed first). Could you rebase on main? Also: if you're interested, we have a sister project keda-gpu-scaler — same NVML stack but focused on Kubernetes autoscaling with KEDA. Open issues there too if you want to contribute. |
Introduce server.Handler.HTTPHandler() serving the MCP endpoint over the Go SDK Streamable HTTP transport, with a /healthz health check. Add RunHTTP() to run an http.Server that shuts down gracefully on context cancellation. Signed-off-by: penpal <unameme@proton.me>
Select the transport at startup: stdio (default, unchanged behavior) or http. In http mode the server listens on --port (default 8080) via the Streamable HTTP transport. Signed-off-by: penpal <unameme@proton.me>
Cover the /healthz endpoint, that the MCP handler is mounted at the root, and that RunHTTP shuts down cleanly on context cancellation. Signed-off-by: penpal <unameme@proton.me>
Drive a real mcp.Client over the Streamable HTTP transport: connect, list tools, and call list_gpus, asserting the structured result matches the mock fixture. Exercises the full request/response path, not just routing. Signed-off-by: penpal <unameme@proton.me>
3db92ac to
0503332
Compare
Contributor
Author
conflict resolved |
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.
What does this PR do?
Adds Streamable HTTP transport so the server can run as a network service instead of only stdio.
--transportflag:stdio(default) orhttp--portflag for http mode (default8080)httpmode serves the MCP endpoint via the Go SDK Streamable HTTP transport (mcp.NewStreamableHTTPHandler)/healthzhealth check endpointstdiostays the default — fully backward compatiblesetup-goto 1.24 to match thegodirective in go.mod (thepinned 1.23 fails to build under
GOTOOLCHAIN=local)Built up over five commits: transport handler → CLI flags → handler/health/ shutdown tests → end-to-end MCP-over-HTTP test → CI Go version bump.
Related issues
Fixes #6
Checklist
make testpassesmake lintpasses