Inspector CLI
Run the MCP Inspector locally with full control over configuration and auto-connect features.Installation
No installation required! Usenpx to run the inspector:
Basic Usage
Start the inspector with default settings:- Start the inspector server on port 8080 (or next available)
- Automatically open your browser to
http://localhost:8080 - Display the dashboard ready for connections
Command-Line Options
--url <url>
Auto-connect to a specific MCP server on startup:
- HTTP/HTTPS:
http://localhost:3000/mcp - WebSocket:
ws://localhost:3000/mcporwss://example.com/mcp - Public servers:
https://mcp.linear.app/mcp
--port <port>
Specify the starting port for the inspector server:
- If specified port is available, uses it
- If port is in use, finds next available port
- Valid range: 1-65535
--help, -h
Display help information:
Usage Examples
Development Workflow
Local MCP Server Testing
When developing an MCP server locally:Multiple Server Testing
Test multiple MCP servers simultaneously:Package.json Scripts
Add inspector to your projectβs scripts:package.json
Environment Variables
The inspector respects these environment variables:PORT
Default port for the inspector server:
MCP_SERVER_URL
Default MCP server URL (alternative to --url flag):
NODE_ENV
Environment mode:
Docker Usage
Run inspector in a Docker container:Use
host.docker.internal to connect to services running on your host machine from Docker.Troubleshooting
Port Already in Use
Port Already in Use
Error:Solutions:
-
Use a different port:
-
Find and kill the process using the port:
Browser Doesn't Open
Browser Doesn't Open
Possible causes:
- Browser not found in PATH
- Headless environment
- Permission issues
Auto-Connect Fails
Auto-Connect Fails
Error:Checklist:
- β MCP server is running
- β URL is correct (check protocol and path)
- β Server is accessible from inspector
- β CORS is properly configured on server
Invalid URL Format
Invalid URL Format
Error:Solution:URLs must include protocol:
Advanced Usage
Custom CORS Configuration
The inspector includes built-in CORS middleware for proxying requests:Health Check Endpoint
The inspector exposes a health check endpoint:- Load balancer health checks
- Monitoring scripts
- CI/CD pipelines
Proxy API
The inspector includes a proxy API for CORS-restricted servers:Next Steps
Features
Explore all inspector testing capabilities
Self-Hosting
Deploy your own inspector instance