Skip to content

Commit c8e9a77

Browse files
committed
Merge remote-tracking branch 'theirs/main' into max/improved-oauth-callback
2 parents 3f9500f + cd28370 commit c8e9a77

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

54 files changed

+4578
-3014
lines changed

.gitignore

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,11 @@
11
.DS_Store
2-
node_modules
2+
.vscode
3+
.idea
4+
node_modules/
5+
*-workspace/
36
server/build
47
client/dist
58
client/tsconfig.app.tsbuildinfo
69
client/tsconfig.node.tsbuildinfo
7-
.vscode
10+
cli/build
11+
test-output

README.md

Lines changed: 95 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -18,16 +18,16 @@ You can pass both arguments and environment variables to your MCP server. Argume
1818

1919
```bash
2020
# Pass arguments only
21-
npx @modelcontextprotocol/inspector build/index.js arg1 arg2
21+
npx @modelcontextprotocol/inspector node build/index.js arg1 arg2
2222

2323
# Pass environment variables only
24-
npx @modelcontextprotocol/inspector -e KEY=value -e KEY2=$VALUE2 node build/index.js
24+
npx @modelcontextprotocol/inspector -e key=value -e key2=$VALUE2 node build/index.js
2525

2626
# Pass both environment variables and arguments
27-
npx @modelcontextprotocol/inspector -e KEY=value -e KEY2=$VALUE2 node build/index.js arg1 arg2
27+
npx @modelcontextprotocol/inspector -e key=value -e key2=$VALUE2 node build/index.js arg1 arg2
2828

2929
# Use -- to separate inspector flags from server arguments
30-
npx @modelcontextprotocol/inspector -e KEY=$VALUE -- node build/index.js -e server-flag
30+
npx @modelcontextprotocol/inspector -e key=$VALUE -- node build/index.js -e server-flag
3131
```
3232

3333
The inspector runs both an MCP Inspector (MCPI) client UI (default port 6274) and an MCP Proxy (MCPP) server (default port 6277). Open the MCPI client UI in your browser to use the inspector. (These ports are derived from the T9 dialpad mapping of MCPI and MCPP respectively, as a mnemonic). You can customize the ports if needed:
@@ -40,20 +40,54 @@ For more details on ways to use the inspector, see the [Inspector section of the
4040

4141
### Authentication
4242

43-
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.
43+
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.
4444

4545
### Security Considerations
4646

4747
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.
4848

4949
### Configuration
5050

51-
The MCP Inspector supports the following configuration settings. To change them click on the `Configuration` button in the MCP Inspector UI :
51+
The MCP Inspector supports the following configuration settings. To change them, click on the `Configuration` button in the MCP Inspector UI:
5252

53-
| Name | Purpose | Default Value |
54-
| -------------------------- | ----------------------------------------------------------------------------------------- | ------------- |
55-
| MCP_SERVER_REQUEST_TIMEOUT | Maximum time in milliseconds to wait for a response from the MCP server before timing out | 10000 |
56-
| MCP_PROXY_FULL_ADDRESS | The full URL of the MCP Inspector proxy server (e.g. `http://10.2.1.14:2277`) | `null` |
53+
| Setting | Description | Default |
54+
| --------------------------------------- | ------------------------------------------------------------------------------------------------------------ | ------- |
55+
| `MCP_SERVER_REQUEST_TIMEOUT` | Timeout for requests to the MCP server (ms) | 10000 |
56+
| `MCP_REQUEST_TIMEOUT_RESET_ON_PROGRESS` | Reset timeout on progress notifications | true |
57+
| `MCP_REQUEST_MAX_TOTAL_TIMEOUT` | Maximum total timeout for requests sent to the MCP server (ms) (Use with progress notifications) | 60000 |
58+
| `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 | "" |
59+
60+
These settings can be adjusted in real-time through the UI and will persist across sessions.
61+
62+
The inspector also supports configuration files to store settings for different MCP servers. This is useful when working with multiple servers or complex configurations:
63+
64+
```bash
65+
npx @modelcontextprotocol/inspector --config path/to/config.json --server everything
66+
```
67+
68+
Example server configuration file:
69+
70+
```json
71+
{
72+
"mcpServers": {
73+
"everything": {
74+
"command": "npx",
75+
"args": ["@modelcontextprotocol/server-everything"],
76+
"env": {
77+
"hello": "Hello MCP!"
78+
}
79+
},
80+
"my-server": {
81+
"command": "node",
82+
"args": ["build/index.js", "arg1", "arg2"],
83+
"env": {
84+
"key": "value",
85+
"key2": "value2"
86+
}
87+
}
88+
}
89+
}
90+
```
5791

5892
### From this repository
5993

@@ -79,6 +113,57 @@ npm run build
79113
npm start
80114
```
81115
116+
### CLI Mode
117+
118+
CLI mode enables programmatic interaction with MCP servers from the command line, ideal for scripting, automation, and integration with coding assistants. This creates an efficient feedback loop for MCP server development.
119+
120+
```bash
121+
npx @modelcontextprotocol/inspector --cli node build/index.js
122+
```
123+
124+
The CLI mode supports most operations across tools, resources, and prompts. A few examples:
125+
126+
```bash
127+
# Basic usage
128+
npx @modelcontextprotocol/inspector --cli node build/index.js
129+
130+
# With config file
131+
npx @modelcontextprotocol/inspector --cli --config path/to/config.json --server myserver
132+
133+
# List available tools
134+
npx @modelcontextprotocol/inspector --cli node build/index.js --method tools/list
135+
136+
# Call a specific tool
137+
npx @modelcontextprotocol/inspector --cli node build/index.js --method tools/call --tool-name mytool --tool-arg key=value --tool-arg another=value2
138+
139+
# List available resources
140+
npx @modelcontextprotocol/inspector --cli node build/index.js --method resources/list
141+
142+
# List available prompts
143+
npx @modelcontextprotocol/inspector --cli node build/index.js --method prompts/list
144+
145+
# Connect to a remote MCP server
146+
npx @modelcontextprotocol/inspector --cli https://my-mcp-server.example.com
147+
148+
# Call a tool on a remote server
149+
npx @modelcontextprotocol/inspector --cli https://my-mcp-server.example.com --method tools/call --tool-name remotetool --tool-arg param=value
150+
151+
# List resources from a remote server
152+
npx @modelcontextprotocol/inspector --cli https://my-mcp-server.example.com --method resources/list
153+
```
154+
155+
### UI Mode vs CLI Mode: When to Use Each
156+
157+
| Use Case | UI Mode | CLI Mode |
158+
| ------------------------ | ------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------------------------------------------- |
159+
| **Server Development** | Visual interface for interactive testing and debugging during development | Scriptable commands for quick testing and continuous integration; creates feedback loops with AI coding assistants like Cursor for rapid development |
160+
| **Resource Exploration** | Interactive browser with hierarchical navigation and JSON visualization | Programmatic listing and reading for automation and scripting |
161+
| **Tool Testing** | Form-based parameter input with real-time response visualization | Command-line tool execution with JSON output for scripting |
162+
| **Prompt Engineering** | Interactive sampling with streaming responses and visual comparison | Batch processing of prompts with machine-readable output |
163+
| **Debugging** | Request history, visualized errors, and real-time notifications | Direct JSON output for log analysis and integration with other tools |
164+
| **Automation** | N/A | Ideal for CI/CD pipelines, batch processing, and integration with coding assistants |
165+
| **Learning MCP** | Rich visual interface helps new users understand server capabilities | Simplified commands for focused learning of specific endpoints |
166+
82167
## License
83168

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

cli/package.json

Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,27 @@
1+
{
2+
"name": "@modelcontextprotocol/inspector-cli",
3+
"version": "0.9.0",
4+
"description": "CLI for the Model Context Protocol inspector",
5+
"license": "MIT",
6+
"author": "Anthropic, PBC (https://anthropic.com)",
7+
"homepage": "https://modelcontextprotocol.io",
8+
"bugs": "https://github.com/modelcontextprotocol/inspector/issues",
9+
"main": "build/cli.js",
10+
"type": "module",
11+
"bin": {
12+
"mcp-inspector-cli": "build/cli.js"
13+
},
14+
"files": [
15+
"build"
16+
],
17+
"scripts": {
18+
"build": "tsc",
19+
"postbuild": "node scripts/make-executable.js",
20+
"test": "node scripts/cli-tests.js"
21+
},
22+
"devDependencies": {},
23+
"dependencies": {
24+
"commander": "^13.1.0",
25+
"spawn-rx": "^5.1.2"
26+
}
27+
}

0 commit comments

Comments
 (0)