Skip to content

Commit 57b2976

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

File tree

1 file changed

+7
-0
lines changed

1 file changed

+7
-0
lines changed

cli/src/client/connection.ts

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

0 commit comments

Comments
 (0)