feat(docker): add Streamable HTTP transport deployment with TDD unit tests#37
Open
gthieleb wants to merge 2 commits into
Open
feat(docker): add Streamable HTTP transport deployment with TDD unit tests#37gthieleb wants to merge 2 commits into
gthieleb wants to merge 2 commits into
Conversation
Extract HTTP handler from main.ts into testable module (src/http-handler.ts) Add 8 TDD unit tests for HTTP transport layer (src/http-handler.test.ts) Update both Dockerfiles: EXPOSE 8080, Node-based HEALTHCHECK, suppress lefthook Rewrite docker-compose.yml with stdio/http profiles, fix stdin_open and volume path bugs Add streamable-http transport entry to server.json Update README with HTTP Docker deployment documentation
- Replace profiles with docker-compose.override.yml pattern - Default is stdio (docker compose up just works) - HTTP via: cp docker-compose.override.example.yml docker-compose.override.yml - Bind HTTP to 127.0.0.1 only (not 0.0.0.0) - Extract healthcheck into docker-healthcheck.js (readable, no oneliner) - Update README: document HTTP mode, override pattern - Add docker-compose.override.yml to .gitignore
Author
|
Reopened this PR against the more actively maintained fork: wgs4/email-mcp#16 No changes to the implementation — just rebased onto |
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.
Summary
Enables Docker deployment of the Streamable HTTP transport with proper health checks, optional compose override pattern, and TDD unit tests for the HTTP handler.
What's New
HTTP Handler Extraction (
src/http-handler.ts)main.tsintocreateHttpHandler(deps)factory function/health(GET),/mcp(POST) routing, and session managementTDD Unit Tests (
src/http-handler.test.ts)vi.hoisted()+vi.mock()for clean SDK mockingDocker Improvements
DockerfileandDockerfile.alpinenowEXPOSE 8080withHEALTHCHECKdocker-healthcheck.js— readable health check script (replaces cryptic oneliner)node docker-healthcheck.js 8080Docker Compose: Optional HTTP Override Pattern
docker-compose.yml→ stdio only (default, unchanged behavior)docker-compose.override.example.yml→ template for HTTP modecp docker-compose.override.example.yml docker-compose.override.ymlDocumentation
Files Changed (12 files, +580 / -109)
src/http-handler.tscreateHttpHandler()factorysrc/http-handler.test.tssrc/main.tssrc/services/hooks.service.tsDockerfiledocker-healthcheck.jsDockerfile.alpinedocker-healthcheck.jsdocker-compose.ymldocker-compose.override.example.ymlserver.jsonREADME.md.gitignore.sisyphus/anddocker-compose.override.ymlTesting
pnpm test→ 166 tests pass (158 existing + 8 new)/healthreturns 200, MCP handshake verifiedinitialize→notifications/initialized→tools/listreturns 47+ tools100.108.41.111:15002)Breaking Changes
None. Default behavior (stdio transport) is unchanged.
Notes
docker-compose.override.ymlis gitignored by design (user-specific)