fix: remove button for mcp server install
This commit is contained in:
@@ -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));
|
||||
|
||||
@@ -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'),
|
||||
},
|
||||
|
||||
@@ -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>;
|
||||
};
|
||||
|
||||
Reference in New Issue
Block a user