refactor(mcp): Enhance MCP configuration functions to return results#1159
Draft
refactor(mcp): Enhance MCP configuration functions to return results#1159
Conversation
- Updated `addCursorMcpConfig`, `addVsCodeMcpConfig`, `addClaudeCodeMcpConfig`, and `addOpenCodeMcpConfig` functions to return an object indicating the filename and action (created/updated) instead of logging directly. - Consolidated success messages in `offerProjectScopedMcpConfig` to provide a summary of created and updated files. - Improved logging for better clarity and consistency across MCP configuration processes.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
This pull request refactors the MCP configuration utility to provide more consolidated and informative feedback when configuring multiple editors. Instead of logging individual success messages for each editor, the code now collects the results and outputs a single, combined summary indicating which configuration files were created or updated. The test suite is also updated to reflect these changes.
Key changes:
Refactoring configuration functions:
addCursorMcpConfig,addVsCodeMcpConfig,addClaudeCodeMcpConfig, andaddOpenCodeMcpConfigfunctions now return a result object indicating the filename and whether the file was created or updated, instead of logging directly or returning void. [1] [2] [3] [4] [5] [6] [7] [8]Consolidated logging in project-scoped configuration:
offerProjectScopedMcpConfigfunction now aggregates the results from all editor configuration functions and logs a single, consolidated success message summarizing which files were created or updated, along with a unified note about reloading or restarting editors. [1] [2] [3]Test updates:
addCursorMcpConfig,addVsCodeMcpConfig,addClaudeCodeMcpConfig, andaddOpenCodeMcpConfigfunctions to return an object indicating the filename and action (created/updated) instead of logging directly.offerProjectScopedMcpConfigto provide a summary of created and updated files.