fix(trace-server): default MCP port to --port + 1 to avoid conflicts#92831
Merged
Conversation
…nt --port values don't conflict. Co-Authored-By: Claude <noreply@anthropic.com>
mischnic
approved these changes
Apr 15, 2026
Contributor
Tests Passed |
Contributor
Stats from current PR✅ No significant changes detected📊 All Metrics📖 Metrics GlossaryDev Server Metrics:
Build Metrics:
Change Thresholds:
⚡ Dev Server
📦 Dev Server (Webpack) (Legacy)📦 Dev Server (Webpack)
⚡ Production Builds
📦 Production Builds (Webpack) (Legacy)📦 Production Builds (Webpack)
📦 Bundle SizesBundle Sizes⚡ TurbopackClient Main Bundles
Server Middleware
Build DetailsBuild Manifests
📦 WebpackClient Main Bundles
Polyfills
Pages
Server Edge SSR
Middleware
Build DetailsBuild Manifests
Build Cache
🔄 Shared (bundler-independent)Runtimes
📎 Tarball URL |
This was referenced Apr 23, 2026
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 subscribe to this conversation on GitHub.
Already have an account?
Sign in.
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.

What?
When
--mcp-portis not explicitly provided tonext internal trace, the MCP HTTP server now defaults to--port + 1(the WebSocket port plus one) instead of the hardcoded value5748.The
DEFAULT_WS_PORTremains5747, so when neither flag is passed the behavior is unchanged: WS=5747, MCP=5748.Why?
Starting the trace server twice with different
--portvalues (e.g. to analyze two trace files simultaneously) caused both instances to attempt to bind the same hardcoded MCP port5748:Making the MCP port default relative to the WS port means each invocation with a unique
--portautomatically gets a unique--mcp-portwithout any extra flags.How?
In
startTurboTraceServerCli, changed:to:
The now-unused
DEFAULT_MCP_PORTconstant inturbo-trace-server.tswas removed. The identical constant inquery-trace.tsis kept — it is the client-side default for connecting to an MCP server and5748remains a sensible default there.The
--mcp-porthelp text was updated to reflect the dynamic default.