@modelcontextprotocol/inspector-cli 0.16.7 → 0.17.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/build/index.js +5 -4
- package/package.json +1 -1
package/build/index.js
CHANGED
|
@@ -5,6 +5,7 @@ import { callTool, connect, disconnect, getPrompt, listPrompts, listResources, l
|
|
|
5
5
|
import { handleError } from "./error-handler.js";
|
|
6
6
|
import { createTransport } from "./transport.js";
|
|
7
7
|
import { awaitableLog } from "./utils/awaitable-log.js";
|
|
8
|
+
import packageJson from "../package.json" with { type: "json" };
|
|
8
9
|
function createTransportOptions(target, transport, headers) {
|
|
9
10
|
if (target.length === 0) {
|
|
10
11
|
throw new Error("Target is required. Specify a URL or a command to execute.");
|
|
@@ -53,10 +54,10 @@ function createTransportOptions(target, transport, headers) {
|
|
|
53
54
|
async function callMethod(args) {
|
|
54
55
|
const transportOptions = createTransportOptions(args.target, args.transport, args.headers);
|
|
55
56
|
const transport = createTransport(transportOptions);
|
|
56
|
-
const
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
57
|
+
const [, name = packageJson.name] = packageJson.name.split("/");
|
|
58
|
+
const version = packageJson.version;
|
|
59
|
+
const clientIdentity = { name, version };
|
|
60
|
+
const client = new Client(clientIdentity);
|
|
60
61
|
try {
|
|
61
62
|
await connect(client, transport);
|
|
62
63
|
let result;
|