Skip to content

Commit 7fbe86a

Browse files
committed
Merge branch 'main' into feat/cli-http
2 parents daa863d + bf85ceb commit 7fbe86a

32 files changed

+3095
-210
lines changed

README.md

Lines changed: 89 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,12 +4,31 @@ The MCP inspector is a developer tool for testing and debugging MCP servers.
44

55
![MCP Inspector Screenshot](https://raw.githubusercontent.com/modelcontextprotocol/inspector/main/mcp-inspector.png)
66

7+
## Architecture Overview
8+
9+
The MCP Inspector consists of two main components that work together:
10+
11+
- **MCP Inspector Client (MCPI)**: A React-based web UI that provides an interactive interface for testing and debugging MCP servers
12+
- **MCP Proxy (MCPP)**: A Node.js server that acts as a protocol bridge, connecting the web UI to MCP servers via various transport methods (stdio, SSE, streamable-http)
13+
14+
Note that the proxy is not a network proxy for intercepting traffic. Instead, it functions as both an MCP client (connecting to your MCP server) and an HTTP server (serving the web UI), enabling browser-based interaction with MCP servers that use different transport protocols.
15+
716
## Running the Inspector
817

918
### Requirements
1019

1120
- Node.js: ^22.7.5
1221

22+
### Quick Start (UI mode)
23+
24+
To get up and running right away with the UI, just execute the following:
25+
26+
```bash
27+
npx @modelcontextprotocol/inspector
28+
```
29+
30+
The server will start up and the UI will be accessible at `http://localhost:6274`.
31+
1332
### From an MCP server repository
1433

1534
To inspect an MCP server implementation, there's no need to clone this repo. Instead, use `npx`. For example, if your server is built at `build/index.js`:
@@ -42,6 +61,74 @@ CLIENT_PORT=8080 SERVER_PORT=9000 npx @modelcontextprotocol/inspector node build
4261

4362
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).
4463

64+
### Servers File Export
65+
66+
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`.
67+
68+
- **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.
69+
70+
**STDIO transport example:**
71+
72+
```json
73+
{
74+
"command": "node",
75+
"args": ["build/index.js", "--debug"],
76+
"env": {
77+
"API_KEY": "your-api-key",
78+
"DEBUG": "true"
79+
}
80+
}
81+
```
82+
83+
**SSE transport example:**
84+
85+
```json
86+
{
87+
"type": "sse",
88+
"url": "http://localhost:3000/events",
89+
"note": "For SSE connections, add this URL directly in Client"
90+
}
91+
```
92+
93+
- **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`.
94+
95+
**STDIO transport example:**
96+
97+
```json
98+
{
99+
"mcpServers": {
100+
"default-server": {
101+
"command": "node",
102+
"args": ["build/index.js", "--debug"],
103+
"env": {
104+
"API_KEY": "your-api-key",
105+
"DEBUG": "true"
106+
}
107+
}
108+
}
109+
}
110+
```
111+
112+
**SSE transport example:**
113+
114+
```json
115+
{
116+
"mcpServers": {
117+
"default-server": {
118+
"type": "sse",
119+
"url": "http://localhost:3000/events",
120+
"note": "For SSE connections, add this URL directly in Client"
121+
}
122+
}
123+
}
124+
```
125+
126+
These buttons appear in the Inspector UI after you've configured your server settings, making it easy to save and reuse your configurations.
127+
128+
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.
129+
130+
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.
131+
45132
### Authentication
46133

47134
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.
@@ -94,6 +181,8 @@ Example server configuration file:
94181
}
95182
```
96183

184+
> **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.
185+
97186
You can also set the initial `transport` type, `serverUrl`, `serverCommand`, and `serverArgs` via query params, for example:
98187

99188
```

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.12.0",
3+
"version": "0.13.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.11.0",
24+
"@modelcontextprotocol/sdk": "^1.11.5",
2525
"commander": "^13.1.0",
2626
"spawn-rx": "^5.1.2"
2727
}

client/package.json

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

0 commit comments

Comments
 (0)