Skip to content

Commit 2f0b8a9

Browse files
committed
test: use applicationName for MCP client identification
1 parent a7e9390 commit 2f0b8a9

File tree

1 file changed

+4
-12
lines changed

1 file changed

+4
-12
lines changed

e2e_tests/typescript/src/mcp_clients.ts

Lines changed: 4 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -24,9 +24,7 @@ export async function createStdioClient(name: string, config: any): Promise<McpC
2424
args: config.args,
2525
env: config.env ? { ...process.env, ...config.env } : undefined,
2626
});
27-
const client = new McpClient({ transport });
28-
(client as any)._serverName = name;
29-
return client;
27+
return new McpClient({ transport, applicationName: name });
3028
}
3129

3230
export async function createLambdaFunctionClient(name: string, config: any): Promise<McpClient> {
@@ -36,9 +34,7 @@ export async function createLambdaFunctionClient(name: string, config: any): Pro
3634
functionName: config.functionName,
3735
regionName: config.region,
3836
});
39-
const client = new McpClient({ transport });
40-
(client as any)._serverName = name;
41-
return client;
37+
return new McpClient({ transport, applicationName: name });
4238
}
4339

4440
export async function createLambdaFunctionUrlClient(name: string, config: any): Promise<McpClient> {
@@ -58,9 +54,7 @@ export async function createLambdaFunctionUrlClient(name: string, config: any):
5854

5955
logger.debug(`Lambda function URL: ${functionUrl}, region: ${region}`);
6056
const transport = new StreamableHTTPClientWithSigV4Transport(new URL(functionUrl), { region, service: "lambda" });
61-
const client = new McpClient({ transport });
62-
(client as any)._serverName = name;
63-
return client;
57+
return new McpClient({ transport, applicationName: name });
6458
}
6559

6660
export async function createAutomatedOAuthClient(name: string, config: any): Promise<McpClient> {
@@ -92,9 +86,7 @@ export async function createAutomatedOAuthClient(name: string, config: any): Pro
9286
logger.debug(`Creating OAuth transport for ${name}...`);
9387
const transport = await createAutomatedOAuthTransport(serverUrl, clientId, clientSecret);
9488

95-
const client = new McpClient({ transport });
96-
(client as any)._serverName = name;
97-
return client;
89+
return new McpClient({ transport, applicationName: name });
9890
}
9991

10092
async function getCloudFormationOutput(stackName: string, outputKey: string, region: string): Promise<string> {

0 commit comments

Comments
 (0)