feat(mcp): app-aware MCP panel and Codex MCP sync to config.toml
- Make MCP panel app-aware; pass appType from App and call APIs with current app - Show active app in title: “MCP Management · Claude Code/Codex” - Add sync_enabled_to_codex: project enabled servers from SSOT to ~/.codex/config.toml as [mcp.servers.*] - Sync on enable/disable, delete, and provider switch (post live write) - Add Tauri command sync_enabled_mcp_to_codex and expose window.api.syncEnabledMcpToCodex() - Fix Rust borrow scopes in switch_provider to avoid E0502 - Add TS declarations for new Codex sync API
This commit is contained in:
@@ -396,6 +396,16 @@ export const tauriAPI = {
|
||||
}
|
||||
},
|
||||
|
||||
// 手动同步:将启用的 MCP 投影到 ~/.codex/config.toml
|
||||
syncEnabledMcpToCodex: async (): Promise<boolean> => {
|
||||
try {
|
||||
return await invoke<boolean>("sync_enabled_mcp_to_codex");
|
||||
} catch (error) {
|
||||
console.error("同步启用 MCP 到 config.toml 失败:", error);
|
||||
throw error;
|
||||
}
|
||||
},
|
||||
|
||||
importMcpFromClaude: async (): Promise<number> => {
|
||||
try {
|
||||
return await invoke<number>("import_mcp_from_claude");
|
||||
|
||||
Reference in New Issue
Block a user