From f4d9bf6d5ee9cb00fa4a04f12a6e48230b7dc58f Mon Sep 17 00:00:00 2001 From: oleina Date: Fri, 11 Jul 2025 11:18:01 -0700 Subject: [PATCH] initalize logging for cli mode --- cli/src/client/connection.ts | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/cli/src/client/connection.ts b/cli/src/client/connection.ts index 931f803d..dcbe8e51 100644 --- a/cli/src/client/connection.ts +++ b/cli/src/client/connection.ts @@ -18,6 +18,12 @@ export async function connect( ): Promise { try { await client.connect(transport); + + if (client.getServerCapabilities()?.logging) { + // default logging level is undefined in the spec, but the user of the + // inspector most likely wants debug. + await client.setLoggingLevel("debug"); + } } catch (error) { throw new Error( `Failed to connect to MCP server: ${error instanceof Error ? error.message : String(error)}`,