Skip to content

feat: add Streamable HTTP transport#20

Open
pen-pal wants to merge 4 commits into
pmady:mainfrom
pen-pal:feature/http-transport
Open

feat: add Streamable HTTP transport#20
pen-pal wants to merge 4 commits into
pmady:mainfrom
pen-pal:feature/http-transport

Conversation

@pen-pal

@pen-pal pen-pal commented Jun 27, 2026

Copy link
Copy Markdown
Contributor

What does this PR do?

Adds Streamable HTTP transport so the server can run as a network service instead of only stdio.

  • New --transport flag: stdio (default) or http
  • New --port flag for http mode (default 8080)
  • http mode serves the MCP endpoint via the Go SDK Streamable HTTP transport (mcp.NewStreamableHTTPHandler)
  • /healthz health check endpoint
  • stdio stays the default — fully backward compatible
  • Graceful shutdown on context cancellation (SIGINT)
  • CI: bump setup-go to 1.24 to match the go directive in go.mod (the
    pinned 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

  • Tests added/updated
  • make test passes
  • make lint passes
  • Commits signed off (DCO)

Note for maintainers: this branch touches .github/workflows/ci.yml

@pmady

pmady commented Jun 27, 2026

Copy link
Copy Markdown
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.

pen-pal added 4 commits June 29, 2026 20:06
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>
@pen-pal pen-pal force-pushed the feature/http-transport branch from 3db92ac to 0503332 Compare June 29, 2026 15:54
@pen-pal

pen-pal commented Jun 30, 2026

Copy link
Copy Markdown
Contributor Author

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.

conflict resolved

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.

Streamable HTTP transport support

2 participants