Skip to content

Commit 5fa1825

Browse files
Feat/http sse transport (#9)
* feat: add HTTP/SSE transport for remote MCP access Add HTTP server with Server-Sent Events (SSE) transport to enable remote access to the MCP server from Claude Code CLI and other clients. Features: - Modular architecture with separated concerns (auth, config, routes) - API key authentication with multiple methods (Bearer, X-API-Key, query) - Health check endpoint for monitoring - Dual transport support (STDIO + HTTP/SSE) - Railway deployment ready with Dockerfile - Comprehensive documentation New files: - src/late/mcp/constants.py - Global constants - src/late/mcp/config.py - Configuration management - src/late/mcp/auth.py - API key authentication - src/late/mcp/routes.py - Route handlers - src/late/mcp/http_server.py - Main HTTP server - Dockerfile - Container configuration for Railway - .dockerignore - Docker build optimization - docs/HTTP_DEPLOYMENT.md - Deployment guide Modified: - pyproject.toml - Added starlette, uvicorn dependencies - server.py - Added main() function for STDIO entry point - README.md - Added HTTP deployment documentation - .env.example - Added MCP server configuration * fix: resolve linting errors (UP045, ARG001) - Replace Optional[X] with X | None for modern type hints - Prefix unused request parameters with underscore * fix: make Dockerfile compatible with Railway - Add id parameter to cache mount (Railway requirement) - Use PORT environment variable with fallback to 8080 - Remove HEALTHCHECK (Railway handles this externally) * feat: configure Railway with Railpack instead of Dockerfile - Add railway.toml with Railpack (NIXPACKS) configuration - Rename Dockerfile to Dockerfile.docker to prevent auto-detection - Railpack will auto-detect Python + uv from main.py - Configure health check path and restart policy * fix: include README.md in Docker build README.md is required by hatchling build backend for the package * fix: use Dockerfile for Railway deployment - Configure railway.toml to use DOCKERFILE builder - Restore Dockerfile with proper MCP extras installation - Remove main.py wrapper (no longer needed) - Keep pyproject.toml clean with optional dependencies This approach is more explicit and reproducible than relying on auto-detection from Railpack/Nixpacks. --------- Co-authored-by: Carlos Martínez <carlimvg02@gmail.com>
1 parent 637b459 commit 5fa1825

2 files changed

Lines changed: 2 additions & 14 deletions

File tree

‎main.py‎

Lines changed: 0 additions & 6 deletions
This file was deleted.

‎railway.toml‎

Lines changed: 2 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,15 +1,9 @@
11
[build]
2-
# Use Railpack (auto-detects Python + uv)
3-
builder = "NIXPACKS"
2+
builder = "DOCKERFILE"
3+
dockerfilePath = "Dockerfile"
44

55
[deploy]
6-
# Start command for the HTTP server
7-
startCommand = "python main.py"
8-
9-
# Health check configuration
106
healthcheckPath = "/health"
117
healthcheckTimeout = 100
12-
13-
# Restart policy
148
restartPolicyType = "on_failure"
159
restartPolicyMaxRetries = 3

0 commit comments

Comments
 (0)