Skip to content

Commit e04c2b5

Browse files
committed
Fixed hardcoded client name/version to pull from package.json
1 parent 55c9f17 commit e04c2b5

3 files changed

Lines changed: 6 additions & 4 deletions

File tree

core/mcp/inspectorClient.ts

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,7 @@ import type {
1919
ToolCallInvocation,
2020
} from "./types.js";
2121
import { getServerType as getServerTypeFromConfig } from "./config.js";
22+
import corePackageJson from "../package.json" with { type: "json" };
2223
import type {
2324
CreateTransport,
2425
CreateTransportOptions,
@@ -523,8 +524,8 @@ export class InspectorClient extends InspectorClientEventTarget {
523524
this.appRendererClientProxy = null;
524525
this.client = new Client(
525526
options.clientIdentity ?? {
526-
name: "@modelcontextprotocol/inspector",
527-
version: "0.18.0",
527+
name: corePackageJson.name.split("/")[1] ?? corePackageJson.name,
528+
version: corePackageJson.version,
528529
},
529530
Object.keys(clientOptions).length > 0 ? clientOptions : undefined,
530531
);

core/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@
2929
"build"
3030
],
3131
"scripts": {
32-
"build": "tsc",
32+
"build": "tsc && cp package.json build/package.json",
3333
"test": "vitest run",
3434
"test:watch": "vitest"
3535
},

core/tsconfig.json

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,8 @@
2323
"json/**/*.ts",
2424
"auth/**/*.ts",
2525
"storage/**/*.ts",
26-
"logging/**/*.ts"
26+
"logging/**/*.ts",
27+
"package.json"
2728
],
2829
"exclude": ["node_modules", "build"]
2930
}

0 commit comments

Comments
 (0)