### What? When `--mcp-port` is not explicitly provided to `next internal trace`, the MCP HTTP server now defaults to `--port + 1` (the WebSocket port plus one) instead of the hardcoded value `5748`. The `DEFAULT_WS_PORT` remains `5747`, so when neither flag is passed the behavior is unchanged: WS=5747, MCP=5748. ### Why? Starting the trace server twice with different `--port` values (e.g. to analyze two trace files simultaneously) caused both instances to attempt to bind the same hardcoded MCP port `5748`: ``` Error: MCP port 5748 is already in use. Use --mcp-port to specify a different port. ``` Making the MCP port default relative to the WS port means each invocation with a unique `--port` automatically gets a unique `--mcp-port` without any extra flags. ### How? In `startTurboTraceServerCli`, changed: ```ts const httpPort = mcpPort ?? DEFAULT_MCP_PORT // always 5748 ``` to: ```ts const httpPort = mcpPort ?? wsPort + 1 // e.g. 5748, 6001, 7001, … ``` The now-unused `DEFAULT_MCP_PORT` constant in `turbo-trace-server.ts` was removed. The identical constant in `query-trace.ts` is kept — it is the client-side default for *connecting* to an MCP server and `5748` remains a sensible default there. The `--mcp-port` help text was updated to reflect the dynamic default. <!-- NEXT_JS_LLM_PR --> Co-authored-by: Tobias Koppers <[email protected]> Co-authored-by: Claude <[email protected]>
Getting Started
Used by some of the world's largest companies, Next.js enables you to create full-stack web applications by extending the latest React features, and integrating powerful Rust-based JavaScript tooling for the fastest builds.
- Visit our Learn Next.js course to get started with Next.js.
- Visit the Next.js Showcase to see more sites built with Next.js.
Documentation
Visit https://nextjs.org/docs to view the full documentation.
Community
The Next.js community can be found on GitHub Discussions where you can ask questions, voice ideas, and share your projects with other people.
To chat with other community members you can join the Next.js Discord server.
Do note that our Code of Conduct applies to all Next.js community channels. Users are highly encouraged to read and adhere to it to avoid repercussions.
Contributing
Contributions to Next.js are welcome and highly appreciated. However, before you jump right into it, we would like you to review our Contribution Guidelines to make sure you have a smooth experience contributing to Next.js.
Good First Issues:
We have a list of good first issues that contain bugs that have a relatively limited scope. This is a great place for newcomers and beginners alike to get started, gain experience, and get familiar with our contribution process.
Security
If you believe you have found a security vulnerability in Next.js, we encourage you to responsibly disclose this and NOT open a public issue.
To participate in our Open Source Software Bug Bounty program, please email [email protected]. We will add you to the program and provide further instructions for submitting your report.