feat: add multi-transport support (stdio, streamable-http, sse)#9
feat: add multi-transport support (stdio, streamable-http, sse)#9
Conversation
- Update Dockerfile for multi-transport with proper defaults - Add docker-compose services for all transport modes - Fix pyproject.toml structure and add build-system config - Improve server.py CLI with better help and transport handling - Bump version to 0.7.0
There was a problem hiding this comment.
Pull request overview
This PR adds multi-transport support to the MCP Trino server, enabling it to communicate via stdio (standard I/O), streamable-http, or SSE (Server-Sent Events). The changes include improved CLI argument handling, Docker configuration updates for different transport modes, and version bump to 0.7.0.
Key Changes:
- Enhanced CLI with better help text and explicit transport mode handling
- Added optional HTTP dependencies for streamable-http and SSE transports
- Updated Docker configurations to support all three transport modes with proper defaults
- Added build system configuration to pyproject.toml
Reviewed changes
Copilot reviewed 4 out of 5 changed files in this pull request and generated 2 comments.
Show a summary per file
| File | Description |
|---|---|
| src/server.py | Enhanced CLI argument parser with detailed help text and explicit transport mode handling logic |
| pyproject.toml | Version bump to 0.7.0, restructured dependencies, added optional HTTP dependencies and script entry point |
| docker-compose.yml | Added separate services for each transport mode with health checks and appropriate configurations |
| Dockerfile | Improved build process with better layer caching and configurable transport defaults |
| uv.lock | Updated lock file with new dependency versions including mcp 1.22.0, cffi 2.0.0, and new dependencies |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
| http = ["uvicorn>=0.32.0", "starlette>=0.41.0"] | ||
|
|
||
| [project.scripts] | ||
| mcp-trino = "server:main" |
There was a problem hiding this comment.
The script entry point path is incorrect. It should be "server:main" → "src.server:main" since the server.py file is in the src/ directory, not at the root.
| mcp-trino = "server:main" | |
| mcp-trino = "src.server:main" |
| def main(): | ||
| """Entry point for the MCP Trino server.""" | ||
| import sys | ||
|
|
||
| sys.argv = sys.argv[:1] # Reset args for mcp.run | ||
| mcp.run(transport="stdio") |
There was a problem hiding this comment.
The main() function resets sys.argv which will break command-line argument parsing. This function appears to be intended as an entry point but doesn't handle the transport argument properly - it always uses "stdio" regardless of CLI arguments. Consider removing the sys.argv = sys.argv[:1] line or redesigning the entry point to properly handle arguments.
Pull Request Title
Description
A clear and concise description of what this pull request does.
Related Issues
Link any related issues or pull requests.
Description
A clear and concise description of what this pull request does.
Related Issues
Link any related issues or pull requests.
Checklist