Skip to content

Commit f4d9bf6

Browse files
author
oleina
committed
initalize logging for cli mode
1 parent 925d11a commit f4d9bf6

File tree

1 file changed

+6
-0
lines changed

1 file changed

+6
-0
lines changed

cli/src/client/connection.ts

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,12 @@ export async function connect(
1818
): Promise<void> {
1919
try {
2020
await client.connect(transport);
21+
22+
if (client.getServerCapabilities()?.logging) {
23+
// default logging level is undefined in the spec, but the user of the
24+
// inspector most likely wants debug.
25+
await client.setLoggingLevel("debug");
26+
}
2127
} catch (error) {
2228
throw new Error(
2329
`Failed to connect to MCP server: ${error instanceof Error ? error.message : String(error)}`,

0 commit comments

Comments
 (0)