Skip to content

Commit eb190b6

Browse files
authored
Merge branch 'main' into fix-port-numbers
2 parents 62f57e3 + c6fad3f commit eb190b6

31 files changed

+4913
-442
lines changed

.github/workflows/main.yml

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -58,8 +58,6 @@ jobs:
5858
# - run: npm ci
5959
- run: npm install --no-package-lock
6060

61-
- run: npm run build
62-
6361
# TODO: Add --provenance once the repo is public
6462
- run: npm run publish-all
6563
env:

README.md

Lines changed: 93 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -42,6 +42,74 @@ CLIENT_PORT=8080 SERVER_PORT=9000 npx @modelcontextprotocol/inspector node build
4242

4343
For more details on ways to use the inspector, see the [Inspector section of the MCP docs site](https://modelcontextprotocol.io/docs/tools/inspector). For help with debugging, see the [Debugging guide](https://modelcontextprotocol.io/docs/tools/debugging).
4444

45+
### Servers File Export
46+
47+
The MCP Inspector provides convenient buttons to export server launch configurations for use in clients such as Cursor, Claude Code, or the Inspector's CLI. The file is usually called `mcp.json`.
48+
49+
- **Server Entry** - Copies a single server configuration entry to your clipboard. This can be added to your `mcp.json` file inside the `mcpServers` object with your preferred server name.
50+
51+
**STDIO transport example:**
52+
53+
```json
54+
{
55+
"command": "node",
56+
"args": ["build/index.js", "--debug"],
57+
"env": {
58+
"API_KEY": "your-api-key",
59+
"DEBUG": "true"
60+
}
61+
}
62+
```
63+
64+
**SSE transport example:**
65+
66+
```json
67+
{
68+
"type": "sse",
69+
"url": "http://localhost:3000/events",
70+
"note": "For SSE connections, add this URL directly in Client"
71+
}
72+
```
73+
74+
- **Servers File** - Copies a complete MCP configuration file structure to your clipboard, with your current server configuration added as `default-server`. This can be saved directly as `mcp.json`.
75+
76+
**STDIO transport example:**
77+
78+
```json
79+
{
80+
"mcpServers": {
81+
"default-server": {
82+
"command": "node",
83+
"args": ["build/index.js", "--debug"],
84+
"env": {
85+
"API_KEY": "your-api-key",
86+
"DEBUG": "true"
87+
}
88+
}
89+
}
90+
}
91+
```
92+
93+
**SSE transport example:**
94+
95+
```json
96+
{
97+
"mcpServers": {
98+
"default-server": {
99+
"type": "sse",
100+
"url": "http://localhost:3000/events",
101+
"note": "For SSE connections, add this URL directly in Client"
102+
}
103+
}
104+
}
105+
```
106+
107+
These buttons appear in the Inspector UI after you've configured your server settings, making it easy to save and reuse your configurations.
108+
109+
For SSE transport connections, the Inspector provides similar functionality for both buttons. The "Server Entry" button copies the SSE URL configuration that can be added to your existing configuration file, while the "Servers File" button creates a complete configuration file containing the SSE URL for direct use in clients.
110+
111+
You can paste the Server Entry into your existing `mcp.json` file under your chosen server name, or use the complete Servers File payload to create a new configuration file.
112+
45113
### Authentication
46114

47115
The inspector supports bearer token authentication for SSE connections. Enter your token in the UI when connecting to an MCP server, and it will be sent in the Authorization header. You can override the header name using the input field in the sidebar.
@@ -54,12 +122,13 @@ The MCP Inspector includes a proxy server that can run and communicate with loca
54122

55123
The MCP Inspector supports the following configuration settings. To change them, click on the `Configuration` button in the MCP Inspector UI:
56124

57-
| Setting | Description | Default |
58-
| --------------------------------------- | ------------------------------------------------------------------------------------------------------------ | ------- |
59-
| `MCP_SERVER_REQUEST_TIMEOUT` | Timeout for requests to the MCP server (ms) | 10000 |
60-
| `MCP_REQUEST_TIMEOUT_RESET_ON_PROGRESS` | Reset timeout on progress notifications | true |
61-
| `MCP_REQUEST_MAX_TOTAL_TIMEOUT` | Maximum total timeout for requests sent to the MCP server (ms) (Use with progress notifications) | 60000 |
62-
| `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 | "" |
125+
| Setting | Description | Default |
126+
| --------------------------------------- | ------------------------------------------------------------------------------------------------------------- | ------- |
127+
| `MCP_SERVER_REQUEST_TIMEOUT` | Timeout for requests to the MCP server (ms) | 10000 |
128+
| `MCP_REQUEST_TIMEOUT_RESET_ON_PROGRESS` | Reset timeout on progress notifications | true |
129+
| `MCP_REQUEST_MAX_TOTAL_TIMEOUT` | Maximum total timeout for requests sent to the MCP server (ms) (Use with progress notifications) | 60000 |
130+
| `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 | "" |
131+
| `MCP_AUTO_OPEN_ENABLED` | Enable automatic browser opening when inspector starts. Only as environment var, not configurable in browser. | true |
63132

64133
These settings can be adjusted in real-time through the UI and will persist across sessions.
65134

@@ -93,6 +162,24 @@ Example server configuration file:
93162
}
94163
```
95164

165+
> **Tip:** You can easily generate this configuration format using the **Server Entry** and **Servers File** buttons in the Inspector UI, as described in the Servers File Export section above.
166+
167+
You can also set the initial `transport` type, `serverUrl`, `serverCommand`, and `serverArgs` via query params, for example:
168+
169+
```
170+
http://localhost:6274/?transport=sse&serverUrl=http://localhost:8787/sse
171+
http://localhost:6274/?transport=streamable-http&serverUrl=http://localhost:8787/mcp
172+
http://localhost:6274/?transport=stdio&serverCommand=npx&serverArgs=arg1%20arg2
173+
```
174+
175+
You can also set initial config settings via query params, for example:
176+
177+
```
178+
http://localhost:6274/?MCP_SERVER_REQUEST_TIMEOUT=10000&MCP_REQUEST_TIMEOUT_RESET_ON_PROGRESS=false&MCP_PROXY_FULL_ADDRESS=http://10.1.1.22:5577
179+
```
180+
181+
Note that if both the query param and the corresponding localStorage item are set, the query param will take precedence.
182+
96183
### From this repository
97184

98185
If you're working on the inspector itself:

cli/package.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "@modelcontextprotocol/inspector-cli",
3-
"version": "0.10.2",
3+
"version": "0.12.0",
44
"description": "CLI for the Model Context Protocol inspector",
55
"license": "MIT",
66
"author": "Anthropic, PBC (https://anthropic.com)",
@@ -21,7 +21,7 @@
2121
},
2222
"devDependencies": {},
2323
"dependencies": {
24-
"@modelcontextprotocol/sdk": "^1.10.0",
24+
"@modelcontextprotocol/sdk": "^1.11.0",
2525
"commander": "^13.1.0",
2626
"spawn-rx": "^5.1.2"
2727
}

client/bin/client.js

Lines changed: 26 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -9,10 +9,34 @@ const __dirname = dirname(fileURLToPath(import.meta.url));
99
const distPath = join(__dirname, "../dist");
1010

1111
const server = http.createServer((request, response) => {
12-
return handler(request, response, {
12+
const handlerOptions = {
1313
public: distPath,
1414
rewrites: [{ source: "/**", destination: "/index.html" }],
15-
});
15+
headers: [
16+
{
17+
// Ensure index.html is never cached
18+
source: "index.html",
19+
headers: [
20+
{
21+
key: "Cache-Control",
22+
value: "no-cache, no-store, max-age=0",
23+
},
24+
],
25+
},
26+
{
27+
// Allow long-term caching for hashed assets
28+
source: "assets/**",
29+
headers: [
30+
{
31+
key: "Cache-Control",
32+
value: "public, max-age=31536000, immutable",
33+
},
34+
],
35+
},
36+
],
37+
};
38+
39+
return handler(request, response, handlerOptions);
1640
});
1741

1842
const port = process.env.PORT || 6274;

client/bin/start.js

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
#!/usr/bin/env node
22

3+
import open from "open";
34
import { resolve, dirname } from "path";
45
import { spawnPromise } from "spawn-rx";
56
import { fileURLToPath } from "url";
@@ -99,6 +100,9 @@ async function main() {
99100

100101
if (serverOk) {
101102
try {
103+
if (process.env.MCP_AUTO_OPEN_ENABLED !== "false") {
104+
open(`http://127.0.0.1:${CLIENT_PORT}`);
105+
}
102106
await spawnPromise("node", [inspectorClientPath], {
103107
env: { ...process.env, PORT: CLIENT_PORT },
104108
signal: abort.signal,

client/package.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "@modelcontextprotocol/inspector-client",
3-
"version": "0.10.2",
3+
"version": "0.12.0",
44
"description": "Client-side application for the Model Context Protocol inspector",
55
"license": "MIT",
66
"author": "Anthropic, PBC (https://anthropic.com)",
@@ -23,7 +23,7 @@
2323
"test:watch": "jest --config jest.config.cjs --watch"
2424
},
2525
"dependencies": {
26-
"@modelcontextprotocol/sdk": "^1.10.0",
26+
"@modelcontextprotocol/sdk": "^1.11.0",
2727
"@radix-ui/react-checkbox": "^1.1.4",
2828
"@radix-ui/react-dialog": "^1.1.3",
2929
"@radix-ui/react-icons": "^1.3.0",

0 commit comments

Comments
 (0)