fix: remove button for mcp server install

This commit is contained in:
2026-02-28 22:09:34 +01:00
parent 61b6c904f4
commit aedd013d88
10 changed files with 116 additions and 3 deletions

View File

@@ -1601,6 +1601,12 @@ export function registerIpcHandlers(bundle: EngineBundle): void {
return engine.addToConfig(agentId as import('../engine/MCPAgentConfigEngine').MCPAgentId);
});
safeHandle('mcp:removeFromAgentConfig', async (_event: unknown, agentId: string) => {
const { MCPAgentConfigEngine } = await import('../engine/MCPAgentConfigEngine');
const engine = new MCPAgentConfigEngine(buildMcpAgentConfigOptions(bundle));
return engine.removeFromConfig(agentId as import('../engine/MCPAgentConfigEngine').MCPAgentId);
});
safeHandle('mcp:isConfigured', async (_event: unknown, agentId: string) => {
const { MCPAgentConfigEngine } = await import('../engine/MCPAgentConfigEngine');
const engine = new MCPAgentConfigEngine(buildMcpAgentConfigOptions(bundle));

View File

@@ -392,6 +392,7 @@ export const electronAPI: ElectronAPI = {
mcp: {
getAgents: () => ipcRenderer.invoke('mcp:getAgents'),
addToAgentConfig: (agentId: string) => ipcRenderer.invoke('mcp:addToAgentConfig', agentId),
removeFromAgentConfig: (agentId: string) => ipcRenderer.invoke('mcp:removeFromAgentConfig', agentId),
isConfigured: (agentId: string) => ipcRenderer.invoke('mcp:isConfigured', agentId),
getPort: () => ipcRenderer.invoke('mcp:getPort'),
},

View File

@@ -848,6 +848,7 @@ export interface ElectronAPI {
mcp: {
getAgents: () => Promise<Array<{ id: string; label: string }>>;
addToAgentConfig: (agentId: string) => Promise<{ success: boolean; configPath: string; error?: string }>;
removeFromAgentConfig: (agentId: string) => Promise<{ success: boolean; configPath: string; error?: string }>;
isConfigured: (agentId: string) => Promise<boolean>;
getPort: () => Promise<number | null>;
};