Skip to content

Commit 8297f56

Browse files
authored
feat(mcp-server): display config file path in setup command output (#9761)
This PR enhances the `bit mcp-server setup` command to display the path where configuration was written. The improved output makes it easier for users to locate and manually adjust configuration files if needed after setup is complete.
1 parent cdf13cb commit 8297f56

File tree

2 files changed

+25
-1
lines changed

2 files changed

+25
-1
lines changed

scopes/mcp/cli-mcp-server/cli-mcp-server.main.runtime.ts

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1225,6 +1225,23 @@ export class CliMcpServerMain {
12251225
return McpSetupUtils.getEditorDisplayName(editor);
12261226
}
12271227

1228+
/**
1229+
* Get the path to the editor config file based on editor type and scope
1230+
*/
1231+
getEditorConfigPath(editor: string, isGlobal: boolean, workspaceDir?: string): string {
1232+
const editorLower = editor.toLowerCase();
1233+
1234+
if (editorLower === 'vscode') {
1235+
return McpSetupUtils.getVSCodeSettingsPath(isGlobal, workspaceDir);
1236+
} else if (editorLower === 'cursor') {
1237+
return McpSetupUtils.getCursorSettingsPath(isGlobal, workspaceDir);
1238+
} else if (editorLower === 'windsurf') {
1239+
return McpSetupUtils.getWindsurfSettingsPath(isGlobal, workspaceDir);
1240+
}
1241+
1242+
throw new Error(`Editor "${editor}" is not supported yet.`);
1243+
}
1244+
12281245
async setupEditor(editor: string, options: SetupOptions, workspaceDir?: string): Promise<void> {
12291246
const supportedEditors = ['vscode', 'cursor', 'windsurf'];
12301247
const editorLower = editor.toLowerCase();

scopes/mcp/cli-mcp-server/setup-cmd.ts

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -44,7 +44,14 @@ export class McpSetupCmd implements Command {
4444

4545
const scope = isGlobal ? 'global' : 'workspace';
4646
const editorName = this.mcpServerMain.getEditorDisplayName(editor);
47-
return chalk.green(`✓ Successfully configured ${editorName} MCP integration (${scope})`);
47+
48+
// Get the config file path based on the editor type
49+
const configPath = this.mcpServerMain.getEditorConfigPath(editor, isGlobal);
50+
51+
return chalk.green(
52+
`✓ Successfully configured ${editorName} MCP integration (${scope})\n` +
53+
` Configuration written to: ${chalk.cyan(configPath)}`
54+
);
4855
} catch (error) {
4956
const editorName = this.mcpServerMain.getEditorDisplayName(editor);
5057
return chalk.red(`Error setting up ${editorName} integration: ${(error as Error).message}`);

0 commit comments

Comments
 (0)