initalize logging for cli mode
This commit is contained in:
parent
925d11a91d
commit
f4d9bf6d5e
1 changed files with 6 additions and 0 deletions
|
|
@ -18,6 +18,12 @@ export async function connect(
|
|||
): Promise<void> {
|
||||
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)}`,
|
||||
|
|
|
|||
Loading…
Reference in a new issue