Skip to content

Commit 119922b

Browse files
authored
Merge branch 'main' into fix/validate-json-on-tool-execution
2 parents ad10912 + 42aa95b commit 119922b

60 files changed

Lines changed: 6549 additions & 1285 deletions

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.
Lines changed: 36 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,36 @@
1+
---
2+
name: Bug report
3+
about: Create a report to help us improve
4+
title: ""
5+
labels: ""
6+
assignees: ""
7+
---
8+
9+
**Inspector Version**
10+
11+
- [e.g. 0.16.5)
12+
13+
**Describe the bug**
14+
A clear and concise description of what the bug is.
15+
16+
**To Reproduce**
17+
Steps to reproduce the behavior:
18+
19+
1. Go to '...'
20+
2. Click on '....'
21+
3. Scroll down to '....'
22+
4. See error
23+
24+
**Expected behavior**
25+
A clear and concise description of what you expected to happen.
26+
27+
**Screenshots**
28+
If applicable, add screenshots to help explain your problem.
29+
30+
**Environment (please complete the following information):**
31+
32+
- OS: [e.g. iOS]
33+
- Browser [e.g. chrome, safari]
34+
35+
**Additional context**
36+
Add any other context about the problem here.

.github/workflows/claude.yml

Lines changed: 11 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -18,17 +18,14 @@ jobs:
1818
(github.event_name == 'pull_request_review_comment' && contains(github.event.comment.body, '@claude')) ||
1919
(github.event_name == 'pull_request_review' && contains(github.event.review.body, '@claude')) ||
2020
(github.event_name == 'issues' && (contains(github.event.issue.body, '@claude') || contains(github.event.issue.title, '@claude')))
21-
) &&
22-
(
23-
github.actor == 'ihrpr' ||
24-
github.actor == 'olaservo'
2521
)
2622
runs-on: ubuntu-latest
2723
permissions:
2824
contents: read
2925
pull-requests: read
3026
issues: read
3127
id-token: write
28+
actions: read
3229
steps:
3330
- name: Checkout repository
3431
uses: actions/checkout@v4
@@ -41,24 +38,16 @@ jobs:
4138
with:
4239
anthropic_api_key: ${{ secrets.ANTHROPIC_API_KEY }}
4340

44-
# Optional: Specify model (defaults to Claude Sonnet 4, uncomment for Claude Opus 4)
45-
# model: "claude-opus-4-20250514"
46-
47-
# Optional: Customize the trigger phrase (default: @claude)
48-
# trigger_phrase: "/claude"
49-
50-
# Optional: Trigger when specific user is assigned to an issue
51-
# assignee_trigger: "claude-bot"
41+
# Allow Claude to read CI results on PRs
42+
additional_permissions: |
43+
actions: read
5244
53-
# Optional: Allow Claude to run specific commands
54-
# allowed_tools: "Bash(npm install),Bash(npm run build),Bash(npm run test:*),Bash(npm run lint:*)"
45+
# Trigger when assigned to an issue
46+
assignee_trigger: "claude"
5547

56-
# Optional: Add custom instructions for Claude to customize its behavior for your project
57-
# custom_instructions: |
58-
# Follow our coding standards
59-
# Ensure all new code has tests
60-
# Use TypeScript for new files
48+
# Allow Claude to run bash
49+
# This should be safe given the repo is already public
50+
allowed_tools: "Bash"
6151

62-
# Optional: Custom environment variables for Claude
63-
# claude_env: |
64-
# NODE_ENV: test
52+
custom_instructions: |
53+
If posting a comment to GitHub, give a concise summary of the comment at the top and put all the details in a <details> block.

.gitignore

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,8 +9,12 @@ client/tsconfig.app.tsbuildinfo
99
client/tsconfig.node.tsbuildinfo
1010
cli/build
1111
test-output
12+
tool-test-output
1213
# symlinked by `npm run link:sdk`:
1314
sdk
1415
client/playwright-report/
1516
client/results.json
1617
client/test-results/
18+
client/e2e/test-results/
19+
mcp.json
20+
.claude/settings.local.json

.husky/pre-commit

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
npx lint-staged
2+
git update-index --again

.prettierignore

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,3 +2,5 @@ packages
22
server/build
33
CODE_OF_CONDUCT.md
44
SECURITY.md
5+
mcp.json
6+
.claude/settings.local.json

Dockerfile

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
# Build stage
2-
FROM node:24-slim AS builder
2+
FROM node:current-alpine3.22 AS builder
33

44
# Set working directory
55
WORKDIR /app
@@ -49,4 +49,4 @@ ENV SERVER_PORT=6277
4949
EXPOSE ${CLIENT_PORT} ${SERVER_PORT}
5050

5151
# Use ENTRYPOINT with CMD for arguments
52-
ENTRYPOINT ["npm", "start"]
52+
ENTRYPOINT ["npm", "start"]

README.md

Lines changed: 121 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29,6 +29,14 @@ npx @modelcontextprotocol/inspector
2929

3030
The server will start up and the UI will be accessible at `http://localhost:6274`.
3131

32+
### Docker Container
33+
34+
You can also start it in a Docker container with the following command:
35+
36+
```bash
37+
docker run --rm --network host -p 6274:6274 -p 6277:6277 ghcr.io/modelcontextprotocol/inspector:latest
38+
```
39+
3240
### From an MCP server repository
3341

3442
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`:
@@ -90,6 +98,16 @@ The MCP Inspector provides convenient buttons to export server launch configurat
9098
}
9199
```
92100

101+
**Streamable HTTP transport example:**
102+
103+
```json
104+
{
105+
"type": "streamable-http",
106+
"url": "http://localhost:3000/mcp",
107+
"note": "For Streamable HTTP connections, add this URL directly in your MCP Client"
108+
}
109+
```
110+
93111
- **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`.
94112

95113
**STDIO transport example:**
@@ -123,9 +141,23 @@ The MCP Inspector provides convenient buttons to export server launch configurat
123141
}
124142
```
125143

144+
**Streamable HTTP transport example:**
145+
146+
```json
147+
{
148+
"mcpServers": {
149+
"default-server": {
150+
"type": "streamable-http",
151+
"url": "http://localhost:3000/mcp",
152+
"note": "For Streamable HTTP connections, add this URL directly in your MCP Client"
153+
}
154+
}
155+
}
156+
```
157+
126158
These buttons appear in the Inspector UI after you've configured your server settings, making it easy to save and reuse your configurations.
127159

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.
160+
For SSE and Streamable HTTP transport connections, the Inspector provides similar functionality for both buttons. The "Server Entry" button copies the configuration that can be added to your existing configuration file, while the "Servers File" button creates a complete configuration file containing the URL for direct use in clients.
129161

130162
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.
131163

@@ -166,6 +198,16 @@ If you need to disable authentication (NOT RECOMMENDED), you can set the `DANGER
166198
DANGEROUSLY_OMIT_AUTH=true npm start
167199
```
168200

201+
---
202+
203+
**🚨 WARNING 🚨**
204+
205+
Disabling authentication with `DANGEROUSLY_OMIT_AUTH` is incredibly dangerous! Disabling auth leaves your machine open to attack not just when exposed to the public internet, but also **via your web browser**. Meaning, visiting a malicious website OR viewing a malicious advertizement could allow an attacker to remotely compromise your computer. Do not disable this feature unless you truly understand the risks.
206+
207+
Read more about the risks of this vulnerability on Oligo's blog: [Critical RCE Vulnerability in Anthropic MCP Inspector - CVE-2025-49596](https://www.oligo.security/blog/critical-rce-vulnerability-in-anthropic-mcp-inspector-cve-2025-49596)
208+
209+
---
210+
169211
You can also set the token via the `MCP_PROXY_AUTH_TOKEN` environment variable when starting the server:
170212

171213
```bash
@@ -234,6 +276,78 @@ Example server configuration file:
234276
}
235277
```
236278

279+
#### Transport Types in Config Files
280+
281+
The inspector automatically detects the transport type from your config file. You can specify different transport types:
282+
283+
**STDIO (default):**
284+
285+
```json
286+
{
287+
"mcpServers": {
288+
"my-stdio-server": {
289+
"type": "stdio",
290+
"command": "npx",
291+
"args": ["@modelcontextprotocol/server-everything"]
292+
}
293+
}
294+
}
295+
```
296+
297+
**SSE (Server-Sent Events):**
298+
299+
```json
300+
{
301+
"mcpServers": {
302+
"my-sse-server": {
303+
"type": "sse",
304+
"url": "http://localhost:3000/sse"
305+
}
306+
}
307+
}
308+
```
309+
310+
**Streamable HTTP:**
311+
312+
```json
313+
{
314+
"mcpServers": {
315+
"my-http-server": {
316+
"type": "streamable-http",
317+
"url": "http://localhost:3000/mcp"
318+
}
319+
}
320+
}
321+
```
322+
323+
#### Default Server Selection
324+
325+
You can launch the inspector without specifying a server name if your config has:
326+
327+
1. **A single server** - automatically selected:
328+
329+
```bash
330+
# Automatically uses "my-server" if it's the only one
331+
npx @modelcontextprotocol/inspector --config mcp.json
332+
```
333+
334+
2. **A server named "default-server"** - automatically selected:
335+
336+
```json
337+
{
338+
"mcpServers": {
339+
"default-server": {
340+
"command": "npx",
341+
"args": ["@modelcontextprotocol/server-everything"]
342+
},
343+
"other-server": {
344+
"command": "node",
345+
"args": ["other.js"]
346+
}
347+
}
348+
}
349+
```
350+
237351
> **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.
238352
239353
You can also set the initial `transport` type, `serverUrl`, `serverCommand`, and `serverArgs` via query params, for example:
@@ -305,6 +419,9 @@ npx @modelcontextprotocol/inspector --cli node build/index.js --method tools/lis
305419
# Call a specific tool
306420
npx @modelcontextprotocol/inspector --cli node build/index.js --method tools/call --tool-name mytool --tool-arg key=value --tool-arg another=value2
307421

422+
# Call a tool with JSON arguments
423+
npx @modelcontextprotocol/inspector --cli node build/index.js --method tools/call --tool-name mytool --tool-arg 'options={"format": "json", "max_tokens": 100}'
424+
308425
# List available resources
309426
npx @modelcontextprotocol/inspector --cli node build/index.js --method resources/list
310427

@@ -317,6 +434,9 @@ npx @modelcontextprotocol/inspector --cli https://my-mcp-server.example.com
317434
# Connect to a remote MCP server (with Streamable HTTP transport)
318435
npx @modelcontextprotocol/inspector --cli https://my-mcp-server.example.com --transport http --method tools/list
319436

437+
# Connect to a remote MCP server (with custom headers)
438+
npx @modelcontextprotocol/inspector --cli https://my-mcp-server.example.com --transport http --method tools/list --header "X-API-Key: your-api-key"
439+
320440
# Call a tool on a remote server
321441
npx @modelcontextprotocol/inspector --cli https://my-mcp-server.example.com --method tools/call --tool-name remotetool --tool-arg param=value
322442

cli/package.json

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "@modelcontextprotocol/inspector-cli",
3-
"version": "0.16.2",
3+
"version": "0.16.8",
44
"description": "CLI for the Model Context Protocol inspector",
55
"license": "MIT",
66
"author": "Anthropic, PBC (https://anthropic.com)",
@@ -17,11 +17,14 @@
1717
"scripts": {
1818
"build": "tsc",
1919
"postbuild": "node scripts/make-executable.js",
20-
"test": "node scripts/cli-tests.js"
20+
"test": "node scripts/cli-tests.js && node scripts/cli-tool-tests.js && node scripts/cli-header-tests.js",
21+
"test:cli": "node scripts/cli-tests.js",
22+
"test:cli-tools": "node scripts/cli-tool-tests.js",
23+
"test:cli-headers": "node scripts/cli-header-tests.js"
2124
},
2225
"devDependencies": {},
2326
"dependencies": {
24-
"@modelcontextprotocol/sdk": "^1.17.0",
27+
"@modelcontextprotocol/sdk": "^1.18.0",
2528
"commander": "^13.1.0",
2629
"spawn-rx": "^5.1.2"
2730
}

0 commit comments

Comments
 (0)