refactor(mcp): switch to user-level config ~/.claude.json and remove project-level logic

- Read/write ~/.claude.json (preserve unknown fields) for mcpServers
- Remove settings.local.json and mcp.json handling
- Drop enableAllProjectMcpServers command and UI toggle
- Update types, Tauri APIs, and MCP panel to reflect new status fields
- Keep atomic write and command validation behaviors
This commit is contained in:
Jason
2025-10-08 23:22:19 +08:00
parent e0e84ca58a
commit 96a4b4fe95
9 changed files with 30 additions and 131 deletions

View File

@@ -279,7 +279,7 @@ export const tauriAPI = {
}
},
// Claude MCP获取状态settings.local.json + mcp.json
// Claude MCP获取状态用户级 ~/.claude.json
getClaudeMcpStatus: async (): Promise<McpStatus> => {
try {
return await invoke<McpStatus>("get_claude_mcp_status");
@@ -289,7 +289,7 @@ export const tauriAPI = {
}
},
// Claude MCP读取 mcp.json 文本
// Claude MCP读取 ~/.claude.json 文本
readClaudeMcpConfig: async (): Promise<string | null> => {
try {
return await invoke<string | null>("read_claude_mcp_config");
@@ -299,16 +299,6 @@ export const tauriAPI = {
}
},
// Claude MCP设置项目级启用开关
setClaudeMcpEnableAllProjects: async (enable: boolean): Promise<boolean> => {
try {
return await invoke<boolean>("set_claude_mcp_enable_all_projects", { enable });
} catch (error) {
console.error("写入 settings.local.json 失败:", error);
throw error;
}
},
// Claude MCP新增/更新服务器定义
upsertClaudeMcpServer: async (
id: string,