Transport Selection Hardening for MCP Runtime#3
Open
ak15 wants to merge 1 commit intoWebexSamples:mainfrom
Open
Transport Selection Hardening for MCP Runtime#3ak15 wants to merge 1 commit intoWebexSamples:mainfrom
ak15 wants to merge 1 commit intoWebexSamples:mainfrom
Conversation
46b96f6 to
34b19c6
Compare
…iling when the server was expected to run over `stdio` but actually started in `http` mode.
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.
Problem
MCP stdio clients were intermittently failing handshake because runtime transport selection was ambiguous across environment variables and container defaults.
Observed failure mode:
Root Cause
Transport resolution had multiple overlapping knobs over time (
TRANSPORT,MCP_MODE,MODE, CLI flags), and historical Docker defaults previously forced HTTP unexpectedly.Even after documentation updates, multiple env aliases still left room for drift and operator confusion.
Decision
Standardize on a single environment variable for transport:
TRANSPORTstdio,http,sse(sseremains deprecated)CLI args > TRANSPORT > default(stdio)Removed runtime dependence on
MCP_MODEandMODEto eliminate ambiguity.Code Changes
Added dedicated resolver:
lib/transport-mode.jsUpdated startup integration:
mcpServer.jsnow consumes resolver output.cli,TRANSPORT,default).sseremains deprecated but is routed through HTTP server path for compatibility.Container and config alignment:
Dockerfile: removed hidden transport default; runtime no longer silently forces HTTP.docker-compose.yml: standardized onTRANSPORT..env.example: onlyTRANSPORTdocumented.Metadata/docs alignment:
README.md: updated precedence and examples to single-env model.tools-manifest.json: optional env vars aligned with code.Regression tests:
tests/transport-mode.test.jscovers default behavior, CLI precedence, canonical env behavior, and legacy-ignore expectation.Why this scope is enterprise-appropriate
Validation
tests/transport-mode.test.jspasses.node_modulesnot installed), which is environment-related.