You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
The MCP Inspector consists of two main components that work together:
10
+
11
+
-**MCP Inspector Client (MCPI)**: A React-based web UI that provides an interactive interface for testing and debugging MCP servers
12
+
-**MCP Proxy (MCPP)**: A Node.js server that acts as a protocol bridge, connecting the web UI to MCP servers via various transport methods (stdio, SSE, streamable-http)
13
+
14
+
Note that the proxy is not a network proxy for intercepting traffic. Instead, it functions as both an MCP client (connecting to your MCP server) and an HTTP server (serving the web UI), enabling browser-based interaction with MCP servers that use different transport protocols.
15
+
7
16
## Running the Inspector
8
17
9
18
### Requirements
10
19
11
20
- Node.js: ^22.7.5
12
21
22
+
### Quick Start (UI mode)
23
+
24
+
To get up and running right away with the UI, just execute the following:
25
+
26
+
```bash
27
+
npx @modelcontextprotocol/inspector
28
+
```
29
+
30
+
The server will start up and the UI will be accessible at `http://localhost:6274`.
31
+
13
32
### From an MCP server repository
14
33
15
34
To inspect an MCP server implementation, there's no need to clone this repo. Instead, use `npx`. For example, if your server is built at `build/index.js`:
@@ -118,17 +137,64 @@ The inspector supports bearer token authentication for SSE connections. Enter yo
118
137
119
138
The MCP Inspector includes a proxy server that can run and communicate with local MCP processes. The proxy server should not be exposed to untrusted networks as it has permissions to spawn local processes and can connect to any specified MCP server.
120
139
140
+
#### Authentication
141
+
142
+
The MCP Inspector proxy server requires authentication by default. When starting the server, a random session token is generated and printed to the console:
This token must be included as a Bearer token in the Authorization header for all requests to the server. The inspector will automatically open your browser with the token pre-filled in the URL.
152
+
153
+
**Automatic browser opening** - The inspector now automatically opens your browser with the token pre-filled in the URL when authentication is enabled.
154
+
155
+
**Alternative: Manual configuration** - If you already have the inspector open:
156
+
157
+
1. Click the "Configuration" button in the sidebar
158
+
2. Find "Proxy Session Token" and enter the token displayed in the proxy console
159
+
3. Click "Save" to apply the configuration
160
+
161
+
The token will be saved in your browser's local storage for future use.
162
+
163
+
If you need to disable authentication (NOT RECOMMENDED), you can set the `DANGEROUSLY_OMIT_AUTH` environment variable:
164
+
165
+
```bash
166
+
DANGEROUSLY_OMIT_AUTH=true npm start
167
+
```
168
+
169
+
#### Local-only Binding
170
+
171
+
By default, both the MCP Inspector proxy server and client bind only to `localhost` to prevent network access. This ensures they are not accessible from other devices on the network. If you need to bind to all interfaces for development purposes, you can override this with the `HOST` environment variable:
172
+
173
+
```bash
174
+
HOST=0.0.0.0 npm start
175
+
```
176
+
177
+
**Warning:** Only bind to all interfaces in trusted network environments, as this exposes the proxy server's ability to execute local processes and both services to network access.
178
+
179
+
#### DNS Rebinding Protection
180
+
181
+
To prevent DNS rebinding attacks, the MCP Inspector validates the `Origin` header on incoming requests. By default, only requests from the client origin are allowed (respects `CLIENT_PORT` if set, defaulting to port 6274). You can configure additional allowed origins by setting the `ALLOWED_ORIGINS` environment variable (comma-separated list):
|`MCP_SERVER_REQUEST_TIMEOUT`| Timeout for requests to the MCP server (ms) | 10000 |
194
+
|`MCP_REQUEST_TIMEOUT_RESET_ON_PROGRESS`| Reset timeout on progress notifications | true |
195
+
|`MCP_REQUEST_MAX_TOTAL_TIMEOUT`| Maximum total timeout for requests sent to the MCP server (ms) (Use with progress notifications) | 60000 |
196
+
|`MCP_PROXY_FULL_ADDRESS`| Set this if you are running the MCP Inspector Proxy on a non-default address. Example: http://10.1.1.22:5577| "" |
197
+
|`MCP_AUTO_OPEN_ENABLED`| Enable automatic browser opening when inspector starts (works with authentication enabled). Only as environment var, not configurable in browser. | true |
132
198
133
199
These settings can be adjusted in real-time through the UI and will persist across sessions.
0 commit comments