Consistent MCP Client() name from package

Make both clients use name from package.json for consistency and protocol clarity

 - web client changes `mcp-inspector` -> `inspector-client` (package.json)
 - cli client remains `inspector-cli` (package.json)
This commit is contained in:
Richard Michael 2025-08-05 10:52:56 -07:00
commit f942df7e4c
2 changed files with 21 additions and 16 deletions

View file

@ -89,10 +89,12 @@ function createTransportOptions(
async function callMethod(args: Args): Promise<void> {
const transportOptions = createTransportOptions(args.target, args.transport);
const transport = createTransport(transportOptions);
const client = new Client({
name: "inspector-cli",
version: packageJson.version,
});
const [, name = packageJson.name] = packageJson.name.split("/");
const version = packageJson.version;
const clientIdentity = { name, version };
const client = new Client(clientIdentity);
try {
await connect(client, transport);

View file

@ -347,20 +347,23 @@ export function useConnection({
};
const connect = async (_e?: unknown, retryCount: number = 0) => {
const client = new Client<Request, Notification, Result>(
{
name: "mcp-inspector",
version: packageJson.version,
},
{
capabilities: {
sampling: {},
elicitation: {},
roots: {
listChanged: true,
},
const [, name = packageJson.name] = packageJson.name.split("/");
const version = packageJson.version;
const clientIdentity = { name, version };
const clientCapabilities = {
capabilities: {
sampling: {},
elicitation: {},
roots: {
listChanged: true,
},
},
};
const client = new Client<Request, Notification, Result>(
clientIdentity,
clientCapabilities,
);
try {