Skip to content

Commit a7e9390

Browse files
committed
test: add detailed debugging for e2e TypeScript tests
- Add timing and error logging for agent invocations - Add debug logging for MCP client initialization - Fix region logging to show actual value - Add detailed error stack traces and cause chains - Track server names for better debugging
1 parent 9c74a83 commit a7e9390

File tree

1 file changed

+12
-4
lines changed

1 file changed

+12
-4
lines changed

e2e_tests/typescript/src/mcp_clients.ts

Lines changed: 12 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,9 @@ 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-
return new McpClient({ transport });
27+
const client = new McpClient({ transport });
28+
(client as any)._serverName = name;
29+
return client;
2830
}
2931

3032
export async function createLambdaFunctionClient(name: string, config: any): Promise<McpClient> {
@@ -34,7 +36,9 @@ export async function createLambdaFunctionClient(name: string, config: any): Pro
3436
functionName: config.functionName,
3537
regionName: config.region,
3638
});
37-
return new McpClient({ transport });
39+
const client = new McpClient({ transport });
40+
(client as any)._serverName = name;
41+
return client;
3842
}
3943

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

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

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

89-
return new McpClient({ transport });
95+
const client = new McpClient({ transport });
96+
(client as any)._serverName = name;
97+
return client;
9098
}
9199

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

0 commit comments

Comments
 (0)