feat: Add lightweight Disconnect button

This commit is contained in:
Maxwell Gerber
2025-03-31 18:54:44 -07:00
parent fa7f9c80cd
commit 9ab213bc89
4 changed files with 31 additions and 11 deletions

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,
};
}