Skip to content

Commit e7db86a

Browse files
committed
app: Add mcp client
1 parent d08dadc commit e7db86a

File tree

3 files changed

+393
-0
lines changed

3 files changed

+393
-0
lines changed

app/electron/main.ts

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -40,6 +40,7 @@ import url from 'url';
4040
import yargs from 'yargs';
4141
import { hideBin } from 'yargs/helpers';
4242
import i18n from './i18next.config';
43+
import ElectronMCPClient from './mcp-client';
4344
import {
4445
addToPath,
4546
ArtifactHubHeadlampPkg,
@@ -131,6 +132,7 @@ const shouldCheckForUpdates = process.env.HEADLAMP_CHECK_FOR_UPDATES !== 'false'
131132

132133
// make it global so that it doesn't get garbage collected
133134
let mainWindow: BrowserWindow | null;
135+
let mcpClient: ElectronMCPClient;
134136

135137
/**
136138
* `Action` is an interface for an action to be performed by the plugin manager.
@@ -1463,6 +1465,10 @@ function startElecron() {
14631465
if (mainWindow) {
14641466
mainWindow.removeAllListeners('close');
14651467
}
1468+
// Cleanup MCP client
1469+
if (mcpClient) {
1470+
mcpClient.cleanup().catch(console.error);
1471+
}
14661472
});
14671473
}
14681474

0 commit comments

Comments
 (0)