Skip to content

Commit f7208fb

Browse files
committed
Major docs refactor (updated all README files, cleanup up some design docs)
1 parent d696735 commit f7208fb

17 files changed

Lines changed: 523 additions & 5097 deletions

AGENTS.md

Lines changed: 12 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@
88
- Build web: `npm run build-web`
99
- Development mode: `npm run dev` (use `npm run dev:windows` on Windows)
1010
- Format code: `npm run prettier-fix`
11-
- Web lint: `cd web && npm run lint`
11+
- Web lint: `cd clients/web && npm run lint`
1212

1313
## Code Style Guidelines
1414

@@ -25,6 +25,17 @@
2525
- Use Tailwind CSS for styling in the web app
2626
- Keep components small and focused on a single responsibility
2727

28+
## Tool Input Parameter Handling
29+
30+
When implementing or modifying tool input parameter handling in the Inspector:
31+
32+
- **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
33+
- **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
34+
- **Always include required fields** - Preserve required field values even when empty, allowing the MCP server to validate and return appropriate error messages
35+
- **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
36+
37+
These guidelines maintain clean parameter passing and proper separation of concerns between the Inspector client and MCP servers.
38+
2839
## Project Organization
2940

3041
The project is organized as a monorepo with workspaces:

README.md

Lines changed: 34 additions & 439 deletions
Large diffs are not rendered by default.

clients/cli/README.md

Lines changed: 107 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,107 @@
1+
# MCP Inspector CLI Client
2+
3+
The CLI mode enables programmatic interaction with MCP servers from the command line. It is ideal for scripting, automation, continuous integration, and establishing an efficient feedback loop with AI coding assistants.
4+
5+
## Running the CLI
6+
7+
You can run the CLI client directly via `npx`:
8+
9+
```bash
10+
npx @modelcontextprotocol/inspector --cli node build/index.js
11+
```
12+
13+
The CLI mode supports operations across tools, resources, and prompts, returning structured JSON output.
14+
15+
### Examples
16+
17+
**Basic usage**
18+
19+
```bash
20+
npx @modelcontextprotocol/inspector --cli node build/index.js
21+
```
22+
23+
**With a configuration file**
24+
25+
```bash
26+
npx @modelcontextprotocol/inspector --cli --config path/to/config.json --server myserver
27+
```
28+
29+
**List available tools**
30+
31+
```bash
32+
npx @modelcontextprotocol/inspector --cli node build/index.js --method tools/list
33+
```
34+
35+
**Call a specific tool**
36+
37+
```bash
38+
npx @modelcontextprotocol/inspector --cli node build/index.js --method tools/call --tool-name mytool --tool-arg key=value --tool-arg another=value2
39+
```
40+
41+
**Call a tool with JSON arguments**
42+
43+
```bash
44+
npx @modelcontextprotocol/inspector --cli node build/index.js --method tools/call --tool-name mytool --tool-arg 'options={"format": "json", "max_tokens": 100}'
45+
```
46+
47+
**List available resources**
48+
49+
```bash
50+
npx @modelcontextprotocol/inspector --cli node build/index.js --method resources/list
51+
```
52+
53+
**List available prompts**
54+
55+
```bash
56+
npx @modelcontextprotocol/inspector --cli node build/index.js --method prompts/list
57+
```
58+
59+
### Remote Servers
60+
61+
You can also connect to remote MCP servers using HTTP or SSE transports.
62+
63+
**Connect to a remote MCP server (default is SSE)**
64+
65+
```bash
66+
npx @modelcontextprotocol/inspector --cli https://my-mcp-server.example.com
67+
```
68+
69+
**Connect with Streamable HTTP transport**
70+
71+
```bash
72+
npx @modelcontextprotocol/inspector --cli https://my-mcp-server.example.com --transport http --method tools/list
73+
```
74+
75+
**Pass custom headers**
76+
77+
```bash
78+
npx @modelcontextprotocol/inspector --cli https://my-mcp-server.example.com --transport http --method tools/list --header "X-API-Key: your-api-key"
79+
```
80+
81+
## Options
82+
83+
### MCP server (which server to connect to)
84+
85+
Options that specify the MCP server (config file, ad-hoc command/URL, env vars, headers) are shared by the Web, CLI, and TUI and are documented in [MCP server configuration](../../docs/mcp-server-configuration.md): `--config`, `--server`, `-e`, `--cwd`, `--header`, `--transport`, `--server-url`, and the positional `[target...]`.
86+
87+
### CLI-specific (what to invoke)
88+
89+
| Option | Description |
90+
| ----------------------------- | ----------------------------------------------------------------------------------------- |
91+
| `--method <method>` | MCP method to invoke (e.g. `tools/list`, `tools/call`, `resources/list`, `prompts/list`). |
92+
| `--tool-name <name>` | Tool name (for `tools/call`). |
93+
| `--tool-arg <key=value>` | Tool argument; repeat for multiple. Use `key='{"json":true}'` for JSON. |
94+
| `--uri <uri>` | Resource URI (for `resources/read`). |
95+
| `--prompt-name <name>` | Prompt name (for `prompts/get`). |
96+
| `--prompt-args <key=value>` | Prompt arguments; repeat for multiple. |
97+
| `--log-level <level>` | Logging level for `logging/setLevel` (e.g. `debug`, `info`). |
98+
| `--metadata <key=value>` | General metadata (key=value); applied to all methods. |
99+
| `--tool-metadata <key=value>` | Tool-specific metadata for `tools/call`. |
100+
101+
## Why use the CLI?
102+
103+
While the Web Client provides a rich visual interface, the CLI is designed for:
104+
105+
- **Automation**: Ideal for CI/CD pipelines and batch processing.
106+
- **AI Coding Assistants**: Provides a direct, machine-readable interface (JSON) for tools like Cursor or Claude to verify changes immediately.
107+
- **Log Analysis**: Easier integration with command-line utilities (like `jq`) to process and analyze MCP server output.

clients/launcher/README.md

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
# MCP Inspector Launcher
2+
3+
The launcher is the package that provides the global `mcp-inspector` binary (e.g. when users run `npx @modelcontextprotocol/inspector`). It is not a separate user-facing app—it is the single entrypoint that selects and runs one of the clients (web, CLI, or TUI).
4+
5+
## Responsibility
6+
7+
- Parse the mode flag: `--web` (default), `--cli`, or `--tui`.
8+
- Forward the rest of `process.argv` to the chosen app.
9+
- Dynamically import that app’s runner and call it **in-process** (no `spawn()`).
10+
11+
All configuration parsing, config-file loading, and server setup are handled by the app runners and by **core**; the launcher does not interpret config or env vars.
12+
13+
## Architecture
14+
15+
For how the launcher fits with the shared config processor and app runners, see the [Launcher and config consolidation](../../docs/launcher-config-consolidation-plan.md) document in the repo root `docs/` folder.

clients/tui/README.md

Lines changed: 55 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,55 @@
1+
# MCP Inspector TUI Client
2+
3+
The Terminal User Interface (TUI) client brings the interactive exploration capabilities of the Web Client directly to your terminal. It is built using [Ink](https://github.com/vadimdemedes/ink) to provide a rich, React-like component experience in a command-line environment.
4+
5+
## Running the TUI
6+
7+
You can run the TUI client via `npx`:
8+
9+
```bash
10+
npx @modelcontextprotocol/inspector --tui node build/index.js
11+
```
12+
13+
### With Configuration Files
14+
15+
The TUI can load all servers from an MCP config file:
16+
17+
```bash
18+
npx @modelcontextprotocol/inspector --tui --config mcp.json
19+
```
20+
21+
(It does not use `--server`; all servers in the file are available in the TUI.)
22+
23+
## Options
24+
25+
### MCP server (which server(s) to connect to)
26+
27+
Options that specify the MCP server(s) (config file, ad-hoc command/URL, env vars, headers) are shared by the Web, CLI, and TUI and are documented in [MCP server configuration](../../docs/mcp-server-configuration.md): `--config`, `-e`, `--cwd`, `--header`, `--transport`, `--server-url`, and the positional `[target...]`.
28+
29+
### TUI-specific (OAuth for HTTP servers)
30+
31+
When connecting to SSE or Streamable HTTP servers that use OAuth, you can pass:
32+
33+
| Option | Description |
34+
| ----------------------------- | ------------------------------------------------------------------------------------ |
35+
| `--client-id <id>` | OAuth client ID (static client). |
36+
| `--client-secret <secret>` | OAuth client secret (confidential clients). |
37+
| `--client-metadata-url <url>` | OAuth Client ID Metadata Document URL (CIMD). |
38+
| `--callback-url <url>` | OAuth redirect/callback listener URL (default: `http://127.0.0.1:0/oauth/callback`). |
39+
40+
## Features
41+
42+
The TUI provides terminal-native tabs and panes for interacting with your MCP server:
43+
44+
- **Resources**: Browse and read resources exposed by the server.
45+
- **Prompts**: List and test prompts.
46+
- **Tools**: View available tools and execute them with form-like inputs.
47+
- **History**: View the request and response history of your interactions.
48+
- **Console**: View the direct stdout/stderr and diagnostic logging of the connected server.
49+
50+
## Navigation
51+
52+
- Use the **Arrow Keys** (Left/Right) or **Tab** to switch between the main tabs (Resources, Tools, Prompts, etc.).
53+
- Use the **Arrow Keys** (Up/Down) to scroll through lists of items.
54+
- Press **Enter** to select an item, execute a tool, or fetch a resource.
55+
- Press **Escape** or `Ctrl+C` to exit the application.

0 commit comments

Comments
 (0)