Skip to content

Conversation

@kentcdodds
Copy link
Contributor

Motivation and Context

I run MCP workshops. To keep exercises isolated and setup easy, I programmatically run the inspector with a bunch of things prefilled via the URL and use environment variables to control things like ports etc. With the session token changes, I now have to parse out the generated session token from the output so I can kick off the inspector with the auth token in the search params.

This is possible, but I don't like parsing output as it could easily change. I would much rather just be responsible for generating the token.

How Has This Been Tested?

I made this change in node_modules locally and it worked great.

Breaking Changes

None

Types of changes

  • Bug fix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)
  • Breaking change (fix or feature that would cause existing functionality to change)
  • Documentation update

Checklist

  • I have read the MCP Documentation
  • My code follows the repository's style guidelines
  • New and existing tests pass locally
  • I have added appropriate error handling
  • I have added or updated documentation as needed

@kentcdodds
Copy link
Contributor Author

I have now published this change under @kentcdodds/[email protected] if anyone wants to try it out.

@kentcdodds
Copy link
Contributor Author

This was handled by #513, so feel free to close. But this does document the feature so maybe merge for that?

@kentcdodds
Copy link
Contributor Author

(Though I'll just add a note that I think it is odd that the env var is called MCP_PROXY_TOKEN and the search param is called MCP_PROXY_AUTH_TOKEN 🤔).

@cliffhall
Copy link
Member

This was handled by #513, so feel free to close. But this does document the feature so maybe merge for that?

(Though I'll just add a note that I think it is odd that the env var is called MCP_PROXY_TOKEN and the search param is called MCP_PROXY_AUTH_TOKEN 🤔).

@kentcdodds I actually am not seeing that it works to startup using MCP_PROXY_TOKEN or MCP_PROXY_AUTH_TOKEN. I don't remember testing it that way when @felixweinberger was working on it.

The proxy server seems to allow for overriding MCP_PROXY_AUTH_TOKEN with the malformed MCP_PROXY_TOKEN value from the environment if present.

However, the start.js script for the client doesn't read either, and instead creates a sessionToken unconditionally.

Screenshot 2025-07-07 at 4 05 23 PM

I think it would be good for this PR to correct all that. Use MCP_PROXY_AUTH_TOKEN everywhere and make sure the server and client can start using that from the environment.

@cliffhall cliffhall added the waiting on submitter Waiting for the submitter to provide more info label Jul 7, 2025
@kentcdodds
Copy link
Contributor Author

Let me know if that's what you're looking for! Thanks!

Copy link
Member

@cliffhall cliffhall left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM! 👍

Tested locally...

Via the npm package entry point (node cli/build/cli.js)

Screenshot 2025-07-11 at 4 57 51 PM Screenshot 2025-07-11 at 5 01 38 PM

Via the local dev entry point (npm run start)

Screenshot 2025-07-11 at 5 00 04 PM Screenshot 2025-07-11 at 5 02 23 PM

Without setting environment var

Screenshot 2025-07-11 at 5 04 14 PM Screenshot 2025-07-11 at 5 04 28 PM

@cliffhall cliffhall merged commit 5028496 into modelcontextprotocol:main Jul 11, 2025
5 checks passed
@kentcdodds kentcdodds deleted the patch-1 branch July 11, 2025 21:13
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

waiting on submitter Waiting for the submitter to provide more info

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants