-
Notifications
You must be signed in to change notification settings - Fork 1k
Description
MCP Inspector Bug Report: URL Scheme Error in Web UI
Summary
The MCP Inspector web UI fails to connect to the proxy server due to a malformed URL in the checkProxyHealth function. The function attempts to fetch from localhost:6277/health instead of http://localhost:6277/health, resulting in the error: URL scheme "localhost" is not supported.
Environment
- MCP Inspector Version: Latest (installed via
npm install -g @modelcontextprotocol/inspector@latest) - Node Version: v24.9.0
- npm Version: 11.6.0
- OS: macOS 26.1 (Build 25B78)
- Browser: Chrome/Safari (multiple browsers tested, issue persists in all)
Steps to Reproduce
-
Install and start MCP Inspector:
npm install -g @modelcontextprotocol/inspector@latest npx @modelcontextprotocol/inspector python3 -m your_mcp_server
-
Open the provided URL in a browser:
http://localhost:6274/?MCP_PROXY_AUTH_TOKEN=<token> -
Observe the error in browser console
Expected Behavior
The web UI should successfully connect to the proxy server at http://localhost:6277 and display the MCP server interface.
Actual Behavior
The connection fails with the following error:
Fetch API cannot load localhost:6277/health. URL scheme "localhost" is not supported.
TypeError: Failed to fetch. URL scheme "localhost" is not supported.
at checkProxyHealth (index-Bl2jgoAl.js:25174:41)
at connect (index-Bl2jgoAl.js:25241:15)
Root Cause
The checkProxyHealth function in the web UI's JavaScript code (file: index-Bl2jgoAl.js:25174) is missing the http:// protocol prefix when constructing the proxy server URL.
Additional Context
Error Details
- File:
index-Bl2jgoAl.js - Function:
checkProxyHealth(line 25174) - Issue: URL is constructed as
localhost:6277/healthinstead ofhttp://localhost:6277/health
Tested Configurations
This issue persists across multiple configurations:
- ✅ stdio transport with default proxy
- ✅ SSE transport with custom server URL
- ✅ Config file-based setup
- ✅ Command-line arguments
- ✅ Multiple browser types (Chrome, Safari)
- ✅ Incognito/private browsing mode
- ✅ Latest Inspector version
Workarounds Attempted
- Updated to latest Inspector version - Failed
- Cleared browser cache - Failed
- Used different browsers - Failed
- Tried SSE/HTTP transport instead of stdio - Still has proxy URL issue
- Modified configuration files - Failed
Impact
- Severity: High - Completely blocks use of MCP Inspector web UI
- Workaround: None available for web UI
- Alternative: Use Claude Desktop or direct API testing
Proposed Fix
The checkProxyHealth function should ensure the URL includes the protocol:
// Current (broken)
const url = `localhost:${port}/health`;
// Should be
const url = `http://localhost:${port}/health`;Or use the URL constructor:
const url = new URL('/health', `http://localhost:${port}`).href;Related Files
- Web UI JavaScript:
index-Bl2jgoAl.js(minified/bundled code) - Likely source: Inspector client code handling proxy connections
Additional Information
The proxy server itself starts successfully and is listening on the correct port. The issue is solely in the web UI's connection logic.
✅ Proxy server listening on localhost:6277
✅ Session token generated correctly
❌ Web UI cannot connect due to URL formatting bug
Repository
https://github.com/modelcontextprotocol/inspector
Note: This issue is reproducible 100% of the time across all tested configurations and browser types.
This bug report was researched, debugged, and documented with assistance from Claude Code - Anthropic's AI coding assistant.