-
Notifications
You must be signed in to change notification settings - Fork 577
Fix proxy port configuration for non-default SERVER_PORT #555
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
Conversation
🎭 Playwright E2E Test Results✅ 12 passed Details12 tests across 1 suite 📊 View Detailed HTML Report (download artifacts) |
0df3ce3
to
f7cbeab
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
One little refactor request.
6424232
to
554a922
Compare
- Update client to read MCP_PROXY_PORT from URL parameters - Update server to include port in displayed URL when non-default - Update start scripts to pass SERVER_PORT to client - Use DEFAULT_MCP_PROXY_LISTEN_PORT constant instead of magic numbers This fixes the issue where the client couldn't connect to the proxy when SERVER_PORT was set to a non-default value.
Address PR feedback by restructuring getClientUrl to always include MCP_PROXY_PORT parameter when using non-default port, regardless of auth status. Also improved code clarity by using params.size check.
554a922
to
9e9419b
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Non-default server port is working great, and if combined withDANGEROUSLY_OMIT_AUTH
, also does the right thing.


There is one more wrinkle. If the user also has MCP_AUTO_OPEN_ENABLED set to false, then they are left with the situation of having no link that will actually open a working inspector. The MCP Inspector is up and running at http://localhost:6274
message isn't enough, it would also need to have ?MCP_PROXY_PORT=7777
appended.

Pass proxy port via URL parameters when using non-default SERVER_PORT
Motivation and Context
Fixes the issue raised by @cliffhall in #529 where the client cannot connect to the proxy server when
SERVER_PORT
is set to a non-default value.When the proxy server runs on a non-default port (not 6277), the client doesn't know about it and tries to connect to the default port. This creates a chicken-and-egg problem:
/config
Changes:
getClientUrl()
in start scripts to includeMCP_PROXY_PORT
parameter when non-defaultMCP_PROXY_PORT
from URL parameters and use it for proxy connectionDEFAULT_MCP_PROXY_LISTEN_PORT
constantHow Has This Been Tested?
npm run dev
- worksSERVER_PORT=8888 npm run dev
- works, client connects to port 8888npm run build && SERVER_PORT=9090 npm start
- worksBreaking Changes
None.
Types of changes
Checklist
Additional context