fix(mcp): improve CCW config update logic and add debug logging

- Fix McpManagerPage to read config after optimistic update and pass only expected fields
- Add debug logging for enabledTools config building and ccw-tools server saving
This commit is contained in:
catlog22
2026-03-02 12:27:42 +08:00
parent 7af258f43d
commit 0af4ca040f
3 changed files with 19 additions and 3 deletions

View File

@@ -4373,10 +4373,13 @@ function buildCcwMcpServerConfig(config: {
// Only use default when enabledTools is undefined (not provided)
// When enabledTools is an empty array, set to empty string to disable all tools
console.log('[buildCcwMcpServerConfig] config.enabledTools:', config.enabledTools);
if (config.enabledTools !== undefined) {
env.CCW_ENABLED_TOOLS = config.enabledTools.join(',');
console.log('[buildCcwMcpServerConfig] Set CCW_ENABLED_TOOLS to:', env.CCW_ENABLED_TOOLS);
} else {
env.CCW_ENABLED_TOOLS = 'write_file,edit_file,read_file,core_memory,ask_question,smart_search';
console.log('[buildCcwMcpServerConfig] Using default CCW_ENABLED_TOOLS');
}
if (config.projectRoot) {