Skip to content

Commit caa1a2e

Browse files
committed
Merge remote-tracking branch 'origin2/main' into meta_properies_in_tools
2 parents f82530f + c7683b4 commit caa1a2e

30 files changed

+1559
-776
lines changed

AGENTS.md

Lines changed: 33 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,33 @@
1+
# MCP Inspector Development Guide
2+
3+
## Build Commands
4+
5+
- Build all: `npm run build`
6+
- Build client: `npm run build-client`
7+
- Build server: `npm run build-server`
8+
- Development mode: `npm run dev` (use `npm run dev:windows` on Windows)
9+
- Format code: `npm run prettier-fix`
10+
- Client lint: `cd client && npm run lint`
11+
12+
## Code Style Guidelines
13+
14+
- Use TypeScript with proper type annotations
15+
- Follow React functional component patterns with hooks
16+
- Use ES modules (import/export) not CommonJS
17+
- Use Prettier for formatting (auto-formatted on commit)
18+
- Follow existing naming conventions:
19+
- camelCase for variables and functions
20+
- PascalCase for component names and types
21+
- kebab-case for file names
22+
- Use async/await for asynchronous operations
23+
- Implement proper error handling with try/catch blocks
24+
- Use Tailwind CSS for styling in the client
25+
- Keep components small and focused on a single responsibility
26+
27+
## Project Organization
28+
29+
The project is organized as a monorepo with workspaces:
30+
31+
- `client/`: React frontend with Vite, TypeScript and Tailwind
32+
- `server/`: Express backend with TypeScript
33+
- `cli/`: Command-line interface for testing and invoking MCP server methods directly

CLAUDE.md

Lines changed: 1 addition & 33 deletions
Original file line numberDiff line numberDiff line change
@@ -1,33 +1 @@
1-
# MCP Inspector Development Guide
2-
3-
## Build Commands
4-
5-
- Build all: `npm run build`
6-
- Build client: `npm run build-client`
7-
- Build server: `npm run build-server`
8-
- Development mode: `npm run dev` (use `npm run dev:windows` on Windows)
9-
- Format code: `npm run prettier-fix`
10-
- Client lint: `cd client && npm run lint`
11-
12-
## Code Style Guidelines
13-
14-
- Use TypeScript with proper type annotations
15-
- Follow React functional component patterns with hooks
16-
- Use ES modules (import/export) not CommonJS
17-
- Use Prettier for formatting (auto-formatted on commit)
18-
- Follow existing naming conventions:
19-
- camelCase for variables and functions
20-
- PascalCase for component names and types
21-
- kebab-case for file names
22-
- Use async/await for asynchronous operations
23-
- Implement proper error handling with try/catch blocks
24-
- Use Tailwind CSS for styling in the client
25-
- Keep components small and focused on a single responsibility
26-
27-
## Project Organization
28-
29-
The project is organized as a monorepo with workspaces:
30-
31-
- `client/`: React frontend with Vite, TypeScript and Tailwind
32-
- `server/`: Express backend with TypeScript
33-
- `cli/`: Command-line interface for testing and invoking MCP server methods directly
1+
@./AGENTS.md

README.md

Lines changed: 21 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -236,13 +236,15 @@ ALLOWED_ORIGINS=http://localhost:6274,http://localhost:8000 npm start
236236

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

239-
| Setting | Description | Default |
240-
| --------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------- | ------- |
241-
| `MCP_SERVER_REQUEST_TIMEOUT` | Timeout for requests to the MCP server (ms) | 10000 |
242-
| `MCP_REQUEST_TIMEOUT_RESET_ON_PROGRESS` | Reset timeout on progress notifications | true |
243-
| `MCP_REQUEST_MAX_TOTAL_TIMEOUT` | Maximum total timeout for requests sent to the MCP server (ms) (Use with progress notifications) | 60000 |
244-
| `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 | "" |
245-
| `MCP_AUTO_OPEN_ENABLED` | Enable automatic browser opening when inspector starts (works with authentication enabled). Only as environment var, not configurable in browser. | true |
239+
| Setting | Description | Default |
240+
| --------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------- | ------- |
241+
| `MCP_SERVER_REQUEST_TIMEOUT` | Client-side timeout (ms) - Inspector will cancel the request if no response is received within this time. Note: servers may have their own timeouts | 300000 |
242+
| `MCP_REQUEST_TIMEOUT_RESET_ON_PROGRESS` | Reset timeout on progress notifications | true |
243+
| `MCP_REQUEST_MAX_TOTAL_TIMEOUT` | Maximum total timeout for requests sent to the MCP server (ms) (Use with progress notifications) | 60000 |
244+
| `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 | "" |
245+
| `MCP_AUTO_OPEN_ENABLED` | Enable automatic browser opening when inspector starts (works with authentication enabled). Only as environment var, not configurable in browser. | true |
246+
247+
**Note on Timeouts:** The timeout settings above control when the Inspector (as an MCP client) will cancel requests. These are independent of any server-side timeouts. For example, if a server tool has a 10-minute timeout but the Inspector's timeout is set to 30 seconds, the Inspector will cancel the request after 30 seconds. Conversely, if the Inspector's timeout is 10 minutes but the server times out after 30 seconds, you'll receive the server's timeout error. For tools that require user interaction (like elicitation) or long-running operations, ensure the Inspector's timeout is set appropriately.
246248

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

@@ -361,7 +363,7 @@ http://localhost:6274/?transport=stdio&serverCommand=npx&serverArgs=arg1%20arg2
361363
You can also set initial config settings via query params, for example:
362364

363365
```
364-
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
366+
http://localhost:6274/?MCP_SERVER_REQUEST_TIMEOUT=60000&MCP_REQUEST_TIMEOUT_RESET_ON_PROGRESS=false&MCP_PROXY_FULL_ADDRESS=http://10.1.1.22:5577
365367
```
366368

367369
Note that if both the query param and the corresponding localStorage item are set, the query param will take precedence.
@@ -456,6 +458,17 @@ npx @modelcontextprotocol/inspector --cli https://my-mcp-server.example.com --me
456458
| **Automation** | N/A | Ideal for CI/CD pipelines, batch processing, and integration with coding assistants |
457459
| **Learning MCP** | Rich visual interface helps new users understand server capabilities | Simplified commands for focused learning of specific endpoints |
458460

461+
## Tool Input Validation Guidelines
462+
463+
When implementing or modifying tool input parameter handling in the Inspector:
464+
465+
- **Omit optional fields with empty values** - When processing form inputs, omit empty strings or null values for optional parameters, UNLESS the field has an explicit default value in the schema that matches the current value
466+
- **Preserve explicit default values** - If a field schema contains an explicit default (e.g., `default: null`), and the current value matches that default, include it in the request. This is a meaningful value the tool expects
467+
- **Always include required fields** - Preserve required field values even when empty, allowing the MCP server to validate and return appropriate error messages
468+
- **Defer deep validation to the server** - Implement basic field presence checking in the Inspector client, but rely on the MCP server for parameter validation according to its schema
469+
470+
These guidelines maintain clean parameter passing and proper separation of concerns between the Inspector client and MCP servers.
471+
459472
## License
460473

461474
This project is licensed under the MIT License—see the [LICENSE](LICENSE) file for details.

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.17.0",
3+
"version": "0.17.2",
44
"description": "CLI for the Model Context Protocol inspector",
55
"license": "MIT",
66
"author": "Anthropic, PBC (https://anthropic.com)",
@@ -24,7 +24,7 @@
2424
},
2525
"devDependencies": {},
2626
"dependencies": {
27-
"@modelcontextprotocol/sdk": "^1.18.0",
27+
"@modelcontextprotocol/sdk": "^1.20.1",
2828
"commander": "^13.1.0",
2929
"spawn-rx": "^5.1.2"
3030
}

cli/src/index.ts

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

3+
import * as fs from "fs";
34
import { Client } from "@modelcontextprotocol/sdk/client/index.js";
45
import { Command } from "commander";
56
import {
@@ -31,8 +32,6 @@ type JsonValue =
3132
| JsonValue[]
3233
| { [key: string]: JsonValue };
3334

34-
import packageJson from "../package.json" with { type: "json" };
35-
3635
type Args = {
3736
target: string[];
3837
method?: string;
@@ -103,6 +102,15 @@ function createTransportOptions(
103102
}
104103

105104
async function callMethod(args: Args): Promise<void> {
105+
// Read package.json to get name and version for client identity
106+
const pathA = "../package.json"; // We're in package @modelcontextprotocol/inspector-cli
107+
const pathB = "../../package.json"; // We're in package @modelcontextprotocol/inspector
108+
let packageJson: { name: string; version: string };
109+
let packageJsonData = await import(fs.existsSync(pathA) ? pathA : pathB, {
110+
with: { type: "json" },
111+
});
112+
packageJson = packageJsonData.default;
113+
106114
const transportOptions = createTransportOptions(
107115
args.target,
108116
args.transport,

client/package.json

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "@modelcontextprotocol/inspector-client",
3-
"version": "0.17.0",
3+
"version": "0.17.2",
44
"description": "Client-side application for the Model Context Protocol inspector",
55
"license": "MIT",
66
"author": "Anthropic, PBC (https://anthropic.com)",
@@ -25,7 +25,7 @@
2525
"cleanup:e2e": "node e2e/global-teardown.js"
2626
},
2727
"dependencies": {
28-
"@modelcontextprotocol/sdk": "^1.18.0",
28+
"@modelcontextprotocol/sdk": "^1.20.1",
2929
"@radix-ui/react-checkbox": "^1.1.4",
3030
"@radix-ui/react-dialog": "^1.1.3",
3131
"@radix-ui/react-icons": "^1.3.0",
@@ -61,7 +61,7 @@
6161
"@types/react": "^18.3.23",
6262
"@types/react-dom": "^18.3.0",
6363
"@types/serve-handler": "^6.1.4",
64-
"@vitejs/plugin-react": "^4.7.0",
64+
"@vitejs/plugin-react": "^5.0.4",
6565
"autoprefixer": "^10.4.20",
6666
"co": "^4.6.0",
6767
"eslint": "^9.11.1",
@@ -77,6 +77,6 @@
7777
"ts-jest": "^29.4.0",
7878
"typescript": "^5.5.3",
7979
"typescript-eslint": "^8.38.0",
80-
"vite": "^6.3.5"
80+
"vite": "^7.1.11"
8181
}
8282
}

client/src/App.tsx

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -143,6 +143,10 @@ const App = () => {
143143
return localStorage.getItem("lastOauthScope") || "";
144144
});
145145

146+
const [oauthClientSecret, setOauthClientSecret] = useState<string>(() => {
147+
return localStorage.getItem("lastOauthClientSecret") || "";
148+
});
149+
146150
// Custom headers state with migration from legacy auth
147151
const [customHeaders, setCustomHeaders] = useState<CustomHeaders>(() => {
148152
const savedHeaders = localStorage.getItem("lastCustomHeaders");
@@ -282,6 +286,7 @@ const App = () => {
282286
env,
283287
customHeaders,
284288
oauthClientId,
289+
oauthClientSecret,
285290
oauthScope,
286291
config,
287292
connectionType,
@@ -415,6 +420,10 @@ const App = () => {
415420
localStorage.setItem("lastOauthScope", oauthScope);
416421
}, [oauthScope]);
417422

423+
useEffect(() => {
424+
localStorage.setItem("lastOauthClientSecret", oauthClientSecret);
425+
}, [oauthClientSecret]);
426+
418427
useEffect(() => {
419428
saveInspectorConfig(CONFIG_LOCAL_STORAGE_KEY, config);
420429
}, [config]);
@@ -931,6 +940,8 @@ const App = () => {
931940
setCustomHeaders={setCustomHeaders}
932941
oauthClientId={oauthClientId}
933942
setOauthClientId={setOauthClientId}
943+
oauthClientSecret={oauthClientSecret}
944+
setOauthClientSecret={setOauthClientSecret}
934945
oauthScope={oauthScope}
935946
setOauthScope={setOauthScope}
936947
onConnect={connectMcpServer}

0 commit comments

Comments
 (0)