Skip to content

Commit 5b22143

Browse files
committed
CLI and config file support
1 parent a63de62 commit 5b22143

File tree

10 files changed

+453
-249
lines changed

10 files changed

+453
-249
lines changed

.gitignore

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +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
8+
.vscode
79
bin/build
8-
cli/build
10+
cli/build
11+
test-output

README.md

Lines changed: 60 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -36,15 +36,31 @@ The inspector runs both a client UI (default port 5173) and an MCP proxy server
3636
CLIENT_PORT=8080 SERVER_PORT=9000 npx @modelcontextprotocol/inspector node build/index.js
3737
```
3838

39-
### Using a Configuration File
39+
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).
4040

41-
The inspector supports configuration files to store settings for different MCP servers. This is useful when working with multiple servers or complex configurations:
41+
### Authentication
42+
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.
44+
45+
### Security Considerations
46+
47+
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.
48+
49+
### Configuration
50+
51+
The MCP Inspector supports the following configuration settings. To change them click on the `Configuration` button in the MCP Inspector UI:
52+
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+
57+
The inspector also supports configuration files to store settings for different MCP servers. This is useful when working with multiple servers or complex configurations:
4258

4359
```bash
4460
npx @modelcontextprotocol/inspector --config path/to/config.json --server everything
4561
```
4662

47-
Example configuration file:
63+
Example server configuration file:
4864

4965
```json
5066
{
@@ -68,6 +84,30 @@ Example configuration file:
6884
}
6985
```
7086

87+
### From this repository
88+
89+
If you're working on the inspector itself:
90+
91+
Development mode:
92+
93+
```bash
94+
npm run dev
95+
```
96+
97+
> **Note for Windows users:**
98+
> On Windows, use the following command instead:
99+
>
100+
> ```bash
101+
> npm run dev:windows
102+
> ```
103+
104+
Production mode:
105+
106+
```bash
107+
npm run build
108+
npm start
109+
```
110+
71111
### CLI Mode
72112

73113
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.
@@ -105,4 +145,20 @@ npx @modelcontextprotocol/inspector --cli https://my-mcp-server.example.com --me
105145

106146
# List resources from a remote server
107147
npx @modelcontextprotocol/inspector --cli https://my-mcp-server.example.com --method resources/list
108-
```
148+
```
149+
150+
### UI Mode vs CLI Mode: When to Use Each
151+
152+
| Use Case | UI Mode | CLI Mode |
153+
|----------|---------|----------|
154+
| **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 |
155+
| **Resource Exploration** | Interactive browser with hierarchical navigation and JSON visualization | Programmatic listing and reading for automation and scripting |
156+
| **Tool Testing** | Form-based parameter input with real-time response visualization | Command-line tool execution with JSON output for scripting |
157+
| **Prompt Engineering** | Interactive sampling with streaming responses and visual comparison | Batch processing of prompts with machine-readable output |
158+
| **Debugging** | Request history, visualized errors, and real-time notifications | Direct JSON output for log analysis and integration with other tools |
159+
| **Automation** | N/A | Ideal for CI/CD pipelines, batch processing, and integration with coding assistants |
160+
| **Learning MCP** | Rich visual interface helps new users understand server capabilities | Simplified commands for focused learning of specific endpoints |
161+
162+
## License
163+
164+
This project is licensed under the MIT License—see the [LICENSE](LICENSE) file for details.

bin/cli.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -57,7 +57,7 @@ async function runWebClient(args) {
5757
// Make sure our server/client didn't immediately fail
5858
await Promise.any([server, client, delay(2 * 1000)]);
5959
const portParam = SERVER_PORT === "3000" ? "" : `?proxyPort=${SERVER_PORT}`;
60-
console.log(`\n🔍 MCP Inspector is up and running at http://localhost:${CLIENT_PORT}${portParam} 🚀`);
60+
console.log(`\n🔍 MCP Inspector is up and running at http://127.0.0.1:${CLIENT_PORT}${portParam} 🚀`);
6161
try {
6262
await Promise.any([server, client]);
6363
}

bin/package.json

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "@modelcontextprotocol/inspector-bin",
3-
"version": "0.5.1",
3+
"version": "0.7.0",
44
"description": "Model Context Protocol inspector",
55
"license": "MIT",
66
"author": "Anthropic, PBC (https://anthropic.com)",
@@ -15,8 +15,8 @@
1515
],
1616
"scripts": {
1717
"build": "tsc",
18-
"postbuild": "chmod +x build/index.js && cp build/index.js cli.js",
19-
"test": "./tests/cli-tests.sh"
18+
"postbuild": "node scripts/make-executable.js && node scripts/copy-cli.js",
19+
"test": "node scripts/cli-tests.js"
2020
},
2121
"dependencies": {},
2222
"devDependencies": {}

0 commit comments

Comments
 (0)