Skip to content

Commit f274a52

Browse files
authored
Merge branch 'main' into feature/completion-context
2 parents b53edca + cfc17e5 commit f274a52

26 files changed

+2005
-149
lines changed

.github/workflows/cli_tests.yml

Lines changed: 41 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,41 @@
1+
name: CLI Tests
2+
3+
on:
4+
push:
5+
paths:
6+
- "cli/**"
7+
pull_request:
8+
paths:
9+
- "cli/**"
10+
11+
jobs:
12+
test:
13+
runs-on: ubuntu-latest
14+
defaults:
15+
run:
16+
working-directory: ./cli
17+
steps:
18+
- uses: actions/checkout@v4
19+
20+
- name: Set up Node.js
21+
uses: actions/setup-node@v4
22+
with:
23+
node-version-file: package.json
24+
cache: npm
25+
26+
- name: Install dependencies
27+
run: |
28+
cd ..
29+
npm ci --ignore-scripts
30+
31+
- name: Build CLI
32+
run: npm run build
33+
34+
- name: Explicitly pre-install test dependencies
35+
run: npx -y @modelcontextprotocol/server-everything --help || true
36+
37+
- name: Run tests
38+
run: npm test
39+
env:
40+
NPM_CONFIG_YES: true
41+
CI: true

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.16.1",
3+
"version": "0.16.2",
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.13.1",
24+
"@modelcontextprotocol/sdk": "^1.17.0",
2525
"commander": "^13.1.0",
2626
"spawn-rx": "^5.1.2"
2727
}

cli/scripts/cli-tests.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ const colors = {
1212

1313
import fs from "fs";
1414
import path from "path";
15-
import { execSync, spawn } from "child_process";
15+
import { spawn } from "child_process";
1616
import os from "os";
1717
import { fileURLToPath } from "url";
1818

cli/src/cli.ts

Lines changed: 15 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -66,8 +66,21 @@ async function runWebClient(args: Args): Promise<void> {
6666
abort.abort();
6767
});
6868

69+
// Build arguments to pass to start.js
70+
const startArgs: string[] = [];
71+
72+
// Pass environment variables
73+
for (const [key, value] of Object.entries(args.envArgs)) {
74+
startArgs.push("-e", `${key}=${value}`);
75+
}
76+
77+
// Pass command and args (using -- to separate them)
78+
if (args.command) {
79+
startArgs.push("--", args.command, ...args.args);
80+
}
81+
6982
try {
70-
await spawnPromise("node", [inspectorClientPath], {
83+
await spawnPromise("node", [inspectorClientPath, ...startArgs], {
7184
signal: abort.signal,
7285
echoOutput: true,
7386
});
@@ -233,7 +246,7 @@ async function main(): Promise<void> {
233246
const args = parseArgs();
234247

235248
if (args.cli) {
236-
runCli(args);
249+
await runCli(args);
237250
} else {
238251
await runWebClient(args);
239252
}

cli/src/index.ts

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -287,6 +287,8 @@ async function main(): Promise<void> {
287287
try {
288288
const args = parseArgs();
289289
await callMethod(args);
290+
// Explicitly exit to ensure process terminates in CI
291+
process.exit(0);
290292
} catch (error) {
291293
handleError(error);
292294
}

client/bin/start.js

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -91,8 +91,10 @@ async function startProdServer(serverOptions) {
9191
"node",
9292
[
9393
inspectorServerPath,
94-
...(command ? [`--env`, command] : []),
95-
...(mcpServerArgs ? [`--args=${mcpServerArgs.join(" ")}`] : []),
94+
...(command ? [`--command`, command] : []),
95+
...(mcpServerArgs && mcpServerArgs.length > 0
96+
? [`--args`, mcpServerArgs.join(" ")]
97+
: []),
9698
],
9799
{
98100
env: {

client/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-client",
3-
"version": "0.16.1",
3+
"version": "0.16.2",
44
"description": "Client-side application for the Model Context Protocol inspector",
55
"license": "MIT",
66
"author": "Anthropic, PBC (https://anthropic.com)",
@@ -25,9 +25,8 @@
2525
"cleanup:e2e": "node e2e/global-teardown.js"
2626
},
2727
"dependencies": {
28-
"@modelcontextprotocol/sdk": "^1.13.1",
28+
"@modelcontextprotocol/sdk": "^1.17.0",
2929
"@radix-ui/react-checkbox": "^1.1.4",
30-
"ajv": "^6.12.6",
3130
"@radix-ui/react-dialog": "^1.1.3",
3231
"@radix-ui/react-icons": "^1.3.0",
3332
"@radix-ui/react-label": "^2.1.0",
@@ -37,6 +36,7 @@
3736
"@radix-ui/react-tabs": "^1.1.1",
3837
"@radix-ui/react-toast": "^1.2.6",
3938
"@radix-ui/react-tooltip": "^1.1.8",
39+
"ajv": "^6.12.6",
4040
"class-variance-authority": "^0.7.0",
4141
"clsx": "^2.1.1",
4242
"cmdk": "^1.0.4",

0 commit comments

Comments
 (0)