Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@ client/tsconfig.node.tsbuildinfo
cli/build
test-output
tool-test-output
pkgInfo.json
# symlinked by `npm run link:sdk`:
sdk
client/playwright-report/
Expand Down
30 changes: 30 additions & 0 deletions cli/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
# MCP Inspector CLI

CLI for the Model Context Protocol inspector.

## Development

For development and testing purposes, you can run the CLI locally after building:

```bash
# Build the CLI
npm run build

# Connect to a remote MCP server (with Streamable HTTP transport)
npm run dev -- --cli https://my-mcp-server.example.com --transport http --method tools/list

# Connect to a remote MCP server (with custom headers)
npm run dev -- --cli https://my-mcp-server.example.com --transport http --method tools/list --header "X-API-Key: your-api-key"

# Call a tool on a remote server
npm run dev -- --cli https://my-mcp-server.example.com --method tools/call --tool-name remotetool --tool-arg param=value

# List resources from a remote server
npm run dev -- --cli https://my-mcp-server.example.com --method resources/list
```

**Note:** The `npm run dev` command is only for development and testing. For production use, install the package globally or use `npx @modelcontextprotocol/inspector`.

## Production Usage

See the main [Inspector README](../README.md) for production usage instructions.
4 changes: 3 additions & 1 deletion cli/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -15,12 +15,14 @@
"build"
],
"scripts": {
"prebuild": "jq '{version, name, description}' package.json > ./src/pkgInfo.json",
"build": "tsc",
"postbuild": "node scripts/make-executable.js",
"test": "node scripts/cli-tests.js && node scripts/cli-tool-tests.js && node scripts/cli-header-tests.js",
"test:cli": "node scripts/cli-tests.js",
"test:cli-tools": "node scripts/cli-tool-tests.js",
"test:cli-headers": "node scripts/cli-header-tests.js"
"test:cli-headers": "node scripts/cli-header-tests.js",
"dev": "node build/cli.js"
},
"devDependencies": {},
"dependencies": {
Expand Down
2 changes: 1 addition & 1 deletion cli/src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ type JsonValue =
| JsonValue[]
| { [key: string]: JsonValue };

import packageJson from "../package.json" with { type: "json" };
import packageJson from "./pkgInfo.json" with { type: "json" };

type Args = {
target: string[];
Expand Down