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:
parent
d7b020fdda
commit
f942df7e4c
2 changed files with 21 additions and 16 deletions
|
|
@ -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);
|
||||
|
|
|
|||
|
|
@ -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 {
|
||||
|
|
|
|||
Loading…
Reference in a new issue