npx, making it easy to quickly inspect and debug MCP servers without installing anything globally.
Quick Start
Run the inspector with a single command:- Start the inspector server on an available port (default: 8080)
- Automatically open your browser to the inspector interface
- Display the URL in the terminal
Command Options
--url <url>
Auto-connect to an MCP server when the inspector starts.
- Local server:
http://localhost:3000/mcp - Remote server:
https://mcp.linear.app/mcp - WebSocket:
ws://localhost:8080/mcp
The URL must start with
http://, https://, ws://, or wss://. The inspector will validate the URL format before starting.--port <port>
Specify the starting port number. The inspector will find the next available port if the specified port is already in use.
8080
Port Range: Must be between 1 and 65535
--help, -h
Display help information and available options.
Environment Variables
MCP_INSPECTOR_FRAME_ANCESTORS
Configure which origins can embed the inspector widget in iframes. This is useful when embedding the inspector into your own application or when testing widgets from different domains.
Default behavior:
- Development mode:
*(allows all origins for easier development) - Production mode:
'self'(same-origin only for security)
* for all origins
Examples:
In production deployments, it’s recommended to explicitly list allowed origins rather than using
* to prevent unauthorized embedding.MCP_URL
Set the external base URL for your MCP server. This is useful when running behind a reverse proxy (ngrok, E2B sandboxes, Cloudflare tunnels) where the public URL differs from localhost.
When set, the CLI will use this URL for widget asset URLs and Vite HMR WebSocket connections, ensuring everything works correctly through the proxy.
Default behavior:
- If not set, the CLI generates a
localhostURL automatically - If set, the CLI preserves your value and does not overwrite it
Automatic Port Selection
If the specified port (or default 8080) is already in use, the inspector will automatically try the next available port. The terminal output will show the actual port being used:Troubleshooting
Port Already in Use
If you see an error about the port being in use:Invalid URL Format
Ensure your URL starts with a valid protocol:Browser Doesn’t Open
If the browser doesn’t open automatically, check the terminal output for the inspector URL and open it manually.Related Documentation
- Getting Started - Overview of the inspector
- Connection Settings - Advanced connection configuration
- Self-Hosting - Deploy your own inspector instance