feat: Add lightweight Disconnect button

This commit is contained in:
Maxwell Gerber 2025-03-31 18:54:44 -07:00
commit 9ab213bc89
No known key found for this signature in database
GPG key ID: BB9C1A99266069B0

View file

@ -321,6 +321,14 @@ export function useConnection({
}
};
const disconnect = async () => {
await mcpClient?.close();
setMcpClient(null);
setConnectionStatus("disconnected");
setCompletionsSupported(false);
setServerCapabilities(null);
};
return {
connectionStatus,
serverCapabilities,
@ -331,5 +339,6 @@ export function useConnection({
handleCompletion,
completionsSupported,
connect,
disconnect,
};
}