Skip to content

Commit a4e6daa

Browse files
Merge branch 'main' into sampling-form
2 parents 5696c19 + f7272d8 commit a4e6daa

31 files changed

+7012
-3047
lines changed

.gitignore

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,11 @@
11
.DS_Store
2-
node_modules
2+
node_modules/
3+
*-workspace/
34
server/build
45
client/dist
56
client/tsconfig.app.tsbuildinfo
67
client/tsconfig.node.tsbuildinfo
78
.vscode
9+
bin/build
10+
cli/build
11+
test-output

README.md

Lines changed: 85 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -21,13 +21,13 @@ You can pass both arguments and environment variables to your MCP server. Argume
2121
npx @modelcontextprotocol/inspector 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,7 +40,7 @@ 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

@@ -59,6 +59,36 @@ The MCP Inspector supports the following configuration settings. To change them,
5959

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

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+
```
91+
6292
### From this repository
6393

6494
If you're working on the inspector itself:
@@ -83,6 +113,57 @@ npm run build
83113
npm start
84114
```
85115
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+
86167
## License
87168

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

0 commit comments

Comments
 (0)