feat: HTTP transport + Docker (ADR-0010 Stage 1)#41
Merged
Conversation
Assisted-By: Claude <noreply@anthropic.com>
Assisted-By: Claude <noreply@anthropic.com>
Assisted-By: Claude <noreply@anthropic.com>
Assisted-By: Claude <noreply@anthropic.com>
Assisted-By: Claude <noreply@anthropic.com>
Assisted-By: Claude <noreply@anthropic.com>
Assisted-By: Claude <noreply@anthropic.com>
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
Implements ADR-0010 Stage 1 — the shared institutional HTTP service (Model B). The server now runs over stdio by default (individual
uvxuse, unchanged) or as one shared HTTP service viaMCP_TRANSPORT=http, packaged as a non-root Docker container behind a Caddy TLS edge.Scope is Stage 1 (internal/院內) only — no auth, no cache, no Stage 2 external exposure. The in-memory insert cache (ADR-0011) and Redis/HA remain separate, deferred work.
What changed
config.py—MCP_TRANSPORT(Literal["stdio","http"]→ fail-fast at settings load),MCP_HTTP_HOST/MCP_HTTP_PORT(8765) /MCP_HTTP_PATH(/mcp/).mcp_server.py—main()branches stdio vsmcp.run(transport="http", …); stdio stays the default. Adds a/healthroute (PlainTextResponse("OK")) and an@asynccontextmanagerlifespan that cancels the background refresh task on shutdown.tools.py—shutdown()cancels the in-flight SWR_REFRESH_TASK(graceful SIGTERM).Dockerfile(non-rootappuser) +docker-compose.yml(app internal-only, no published port; Caddy publishes 443 only) +Caddyfile(TLS terminates at the edge — the app holds no certificate)..env.exampleactivated, README "Deployment" section, CLAUDE.md quick-ref row, CHANGELOG, ADR-0010 → Accepted (Stage 1).Key design (per ADR-0010)
Verification
docker buildOK; container runs asappuser,/health→ OK;docker compose up→ HTTPS via Caddy/health→ OK,mcp(healthy)with no host port,proxyonly on 443; a realfastmcp.Clientover HTTP listed all 3 tools.run(transport="http", host/port/path),custom_route, lifespan) verified against the installed version before coding.Assisted-By: Claude noreply@anthropic.com