Skip to content

Add HTTPS support for secure local development #482

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

Open
wants to merge 3 commits into
base: main
Choose a base branch
from

Conversation

bbn
Copy link

@bbn bbn commented Jun 2, 2025

Summary

• Add HTTPS server support for both client UI and proxy server to enable secure local development
• Implement environment variable configuration with INSPECTOR_SSL_CERT_PATH and INSPECTOR_SSL_KEY_PATH
• Include automatic fallback to HTTP when SSL certificates are missing or invalid
• Add cross-platform SSL certificate generation script supporting macOS, Linux, and Windows

Motivation

OAuth flow testing requires digest security libraries that are restricted to HTTPS-only scenarios for security reasons. This enhancement enables proper OAuth testing in the MCP Inspector by providing secure HTTPS endpoints.

Test plan

  • Generate SSL certificates using ./generate-ssl.sh
  • Set environment variables and verify HTTPS endpoints work
  • Test fallback behavior with missing/invalid certificates
  • Verify HTTP mode still works without environment variables
  • Test certificate generation script on different platforms
- Implement HTTPS server support for both client and proxy server - Add INSPECTOR_SSL_CERT_PATH and INSPECTOR_SSL_KEY_PATH environment variables - Include fallback to HTTP when SSL certificates are missing or invalid - Add cross-platform SSL certificate generation script - Update documentation with HTTPS configuration instructions
@olaservo
Copy link
Member

olaservo commented Jun 5, 2025

Hi, I see that you have a test plan listed, did you actually test this yet or should it still be in draft mode?

@bbn
Copy link
Author

bbn commented Jun 6, 2025

Hi, I see that you have a test plan listed, did you actually test this yet or should it still be in draft mode?

I've tested everything except the multi-platform aspects.

@cliffhall
Copy link
Contributor

cliffhall commented Jul 2, 2025

Hi @bbn! This looks exciting, but needs conflicts resolved. There have been a bunch of changes with regard to the URL and the MCP_AUTH_TOKEN passed on the URL.

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

bbn commented Jul 4, 2025

Hi @cliffhall ! I brought everything up to date.

- Fix URL generation to use https:// protocol when SSL certificates are configured - Add HTTPS support to Vite dev server configuration - Pass SSL environment variables to client and server processes - Update MCP SDK to v1.13.1 to fix missing OAuth export
@cliffhall
Copy link
Contributor

cliffhall commented Jul 4, 2025

It looks like you merged main, but there are changes in your PR that do not align with the current impl on main. I don't think your code is fully taking into account the MCP_PROXY_AUTH_TOKEN changes

From your changes
Screenshot 2025-07-04 at 12 43 16 PM

What is currently being shown
Screenshot 2025-07-04 at 12 44 46 PM

Comment on lines +137 to +138
INSPECTOR_SSL_CERT_PATH: process.env.INSPECTOR_SSL_CERT_PATH,
INSPECTOR_SSL_KEY_PATH: process.env.INSPECTOR_SSL_KEY_PATH
Copy link
Contributor

Choose a reason for hiding this comment

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

If you have just spread process.env above, does it make any sense to explicitly spread these two variables? Will they not be included as part of ...process.env?

server = http.createServer(requestHandler);
server.on("listening", () => {
console.log(
`🔍 MCP Inspector is up and running at http://127.0.0.1:${port} 🚀`,
Copy link
Contributor

Choose a reason for hiding this comment

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

This isn't right. Please merge main into your branch and resolve conflicts before proceeding.

Run the current version on main to see how this should be displayed. It should be localhost and it should contain the variables including MCP_PROXY_AUTH_KEY and MCP_PROXY_PORT if SERVER_PORT was set in env.

Screenshot 2025-07-04 at 2 28 19 PM
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
3 participants