implement MCP Transport via HTTP as alternative - #75
Conversation
There was a problem hiding this comment.
Pull request overview
Adds an HTTP-based MCP transport option so the server can be hosted centrally and accessed remotely, while keeping stdio as the default transport for subprocess-based MCP clients.
Changes:
- Introduces transport selection (
stdiovshttp) with flag/env precedence and parsing helpers. - Adds HTTP server startup path using MCP Streamable HTTP transport, including
--http-addr/IONOS_MCP_HTTP_ADDR. - Documents the new transport mode in the README and updates CLI help text.
Reviewed changes
Copilot reviewed 4 out of 4 changed files in this pull request and generated 2 comments.
| File | Description |
|---|---|
server_config.go |
Adds transport types plus resolveTransport/parseTransport to mirror load-mode precedence behavior. |
server_config_test.go |
Adds unit tests for transport resolution precedence, normalization, and fallback behavior. |
README.md |
Documents the new “Wire transport” section and provides usage examples for HTTP mode. |
main.go |
Adds CLI parsing for transport/address and runs either stdio transport or Streamable HTTP server based on selection. |
Suppressed comments (1)
main.go:276
- The help text says the HTTP default is ":8080" but doesn’t make explicit that this binds on all interfaces; combined with the lack of built-in TLS/auth in HTTP mode, this can lead to accidental exposure. Consider clarifying the binding behavior and suggesting a localhost bind for local-only use.
--http-addr <addr> listen address for --transport http (overrides
IONOS_MCP_HTTP_ADDR). Default ":8080".
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
|
Thanks a lot for taking the time to put this together and contribute! We'll review the PR and get back to you soon. |
cavramoniu-ionos
left a comment
There was a problem hiding this comment.
Thanks for putting this together, the transport work looks good. I have also added some suggestions 👍
Co-authored-by: Avramoniu Calin-Stefan <calin-stefan.avramoniu@ionos.com>
change default listener to localhost for HTTP transport Co-authored-by: Avramoniu Calin-Stefan <calin-stefan.avramoniu@ionos.com>
|
Thanks for the review, I applied the changes proposed. |
|
@jonasled Thanks for the PR, and for turning around the dev team's feedback so quickly. I'm the PM for the MCP Server and other product areas at IONOS Cloud. Beyond this change, we'd love your feedback on the MCP Server more broadly, anything that feels missing or rough. It would also really help us to hear about your use case: what you're building with it, and the kinds of requests you typically run through the MCP. |
We want to host in our environment the MCP server at a central location for automated tasks to run against it. Due the only STDIO transport currently implemented it's required for the MCP Server to run on the same system as the agent. With HTTP transport we can host the agent on a central cluster and connect to it from multiple agents.