feat(mcp): add option to mirror MCP config to other app
- Add syncOtherSide parameter to upsert_mcp_server_in_config command - Implement checkbox UI in McpFormModal for cross-app sync - Automatically sync enabled MCP servers to both Claude and Codex when option is checked - Add i18n support for sync option labels and hints
This commit is contained in:
@@ -354,13 +354,18 @@ export const tauriAPI = {
|
||||
app: AppType = "claude",
|
||||
id: string,
|
||||
spec: McpServer,
|
||||
options?: { syncOtherSide?: boolean },
|
||||
): Promise<boolean> => {
|
||||
try {
|
||||
return await invoke<boolean>("upsert_mcp_server_in_config", {
|
||||
const payload = {
|
||||
app,
|
||||
id,
|
||||
spec,
|
||||
});
|
||||
...(options?.syncOtherSide !== undefined
|
||||
? { syncOtherSide: options.syncOtherSide }
|
||||
: {}),
|
||||
};
|
||||
return await invoke<boolean>("upsert_mcp_server_in_config", payload);
|
||||
} catch (error) {
|
||||
console.error("写入 MCP(config.json)失败:", error);
|
||||
throw error;
|
||||
|
||||
Reference in New Issue
Block a user