@teambit/cli-mcp-server 0.0.0-1ed79eba7ca236740e6158efa8a6f27425ecaa11

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -0,0 +1,504 @@
1
+ "use strict";
2
+
3
+ Object.defineProperty(exports, "__esModule", {
4
+ value: true
5
+ });
6
+ exports.McpSetupUtils = void 0;
7
+ function _fsExtra() {
8
+ const data = _interopRequireDefault(require("fs-extra"));
9
+ _fsExtra = function () {
10
+ return data;
11
+ };
12
+ return data;
13
+ }
14
+ function _path() {
15
+ const data = _interopRequireDefault(require("path"));
16
+ _path = function () {
17
+ return data;
18
+ };
19
+ return data;
20
+ }
21
+ function _os() {
22
+ const data = require("os");
23
+ _os = function () {
24
+ return data;
25
+ };
26
+ return data;
27
+ }
28
+ function _interopRequireDefault(e) { return e && e.__esModule ? e : { default: e }; }
29
+ /**
30
+ * Options for setting up MCP server configuration
31
+ */
32
+
33
+ /**
34
+ * Options for writing rules/instructions files
35
+ */
36
+
37
+ /**
38
+ * Utility class for setting up MCP server configurations across different editors
39
+ */
40
+ class McpSetupUtils {
41
+ /**
42
+ * Build MCP server arguments based on provided options
43
+ */
44
+ static buildMcpServerArgs(options) {
45
+ const {
46
+ consumerProject,
47
+ includeAdditional
48
+ } = options;
49
+ const args = ['mcp-server', 'start'];
50
+ if (consumerProject) {
51
+ args.push('--consumer-project');
52
+ }
53
+ if (includeAdditional) {
54
+ args.push('--include-additional', includeAdditional);
55
+ }
56
+ return args;
57
+ }
58
+
59
+ /**
60
+ * Read and parse a JSON file, returning empty object if file doesn't exist
61
+ */
62
+ static async readJsonFile(filePath) {
63
+ if (!(await _fsExtra().default.pathExists(filePath))) {
64
+ return {};
65
+ }
66
+ try {
67
+ const content = await _fsExtra().default.readFile(filePath, 'utf8');
68
+ return JSON.parse(content);
69
+ } catch (error) {
70
+ throw new Error(`Failed to parse ${_path().default.basename(filePath)}: ${error.message}`);
71
+ }
72
+ }
73
+
74
+ /**
75
+ * Get display name for an editor
76
+ */
77
+ static getEditorDisplayName(editor) {
78
+ switch (editor) {
79
+ case 'vscode':
80
+ return 'VS Code';
81
+ case 'cursor':
82
+ return 'Cursor';
83
+ case 'windsurf':
84
+ return 'Windsurf';
85
+ case 'roo':
86
+ return 'Roo Code';
87
+ case 'cline':
88
+ return 'Cline';
89
+ default:
90
+ return editor;
91
+ }
92
+ }
93
+
94
+ /**
95
+ * Get VS Code settings.json path based on global/workspace scope
96
+ */
97
+ static getVSCodeSettingsPath(isGlobal, workspaceDir) {
98
+ if (isGlobal) {
99
+ // Global VS Code settings
100
+ const platform = process.platform;
101
+ switch (platform) {
102
+ case 'win32':
103
+ return _path().default.join((0, _os().homedir)(), 'AppData', 'Roaming', 'Code', 'User', 'settings.json');
104
+ case 'darwin':
105
+ return _path().default.join((0, _os().homedir)(), 'Library', 'Application Support', 'Code', 'User', 'settings.json');
106
+ case 'linux':
107
+ return _path().default.join((0, _os().homedir)(), '.config', 'Code', 'User', 'settings.json');
108
+ default:
109
+ throw new Error(`Unsupported platform: ${platform}`);
110
+ }
111
+ } else {
112
+ // Workspace-specific settings
113
+ const targetDir = workspaceDir || process.cwd();
114
+ return _path().default.join(targetDir, '.vscode', 'settings.json');
115
+ }
116
+ }
117
+
118
+ /**
119
+ * Get VS Code mcp.json path for workspace configuration
120
+ */
121
+ static getVSCodeMcpConfigPath(workspaceDir) {
122
+ const targetDir = workspaceDir || process.cwd();
123
+ return _path().default.join(targetDir, '.vscode', 'mcp.json');
124
+ }
125
+
126
+ /**
127
+ * Setup VS Code MCP integration
128
+ */
129
+ static async setupVSCode(options) {
130
+ const {
131
+ isGlobal,
132
+ workspaceDir
133
+ } = options;
134
+ if (isGlobal) {
135
+ // For global configuration, use settings.json with mcp.servers structure
136
+ const settingsPath = this.getVSCodeSettingsPath(isGlobal, workspaceDir);
137
+
138
+ // Ensure directory exists
139
+ await _fsExtra().default.ensureDir(_path().default.dirname(settingsPath));
140
+
141
+ // Read existing settings or create empty object
142
+ const settings = await this.readJsonFile(settingsPath);
143
+
144
+ // Build MCP server args
145
+ const args = this.buildMcpServerArgs(options);
146
+
147
+ // Create or update MCP configuration
148
+ if (!settings.mcp) {
149
+ settings.mcp = {};
150
+ }
151
+ if (!settings.mcp.servers) {
152
+ settings.mcp.servers = {};
153
+ }
154
+ settings.mcp.servers['bit-cli'] = {
155
+ type: 'stdio',
156
+ command: 'bit',
157
+ args: args
158
+ };
159
+
160
+ // Write updated settings
161
+ await _fsExtra().default.writeFile(settingsPath, JSON.stringify(settings, null, 2));
162
+ } else {
163
+ // For workspace configuration, use .vscode/mcp.json with direct servers structure
164
+ const mcpConfigPath = this.getVSCodeMcpConfigPath(workspaceDir);
165
+
166
+ // Ensure directory exists
167
+ await _fsExtra().default.ensureDir(_path().default.dirname(mcpConfigPath));
168
+
169
+ // Read existing MCP configuration or create empty object
170
+ const mcpConfig = await this.readJsonFile(mcpConfigPath);
171
+
172
+ // Build MCP server args
173
+ const args = this.buildMcpServerArgs(options);
174
+
175
+ // Create or update MCP configuration
176
+ if (!mcpConfig.servers) {
177
+ mcpConfig.servers = {};
178
+ }
179
+ mcpConfig.servers['bit-cli'] = {
180
+ type: 'stdio',
181
+ command: 'bit',
182
+ args: args
183
+ };
184
+
185
+ // Write updated MCP configuration
186
+ await _fsExtra().default.writeFile(mcpConfigPath, JSON.stringify(mcpConfig, null, 2));
187
+ }
188
+ }
189
+
190
+ /**
191
+ * Get Cursor mcp.json path based on global/workspace scope
192
+ */
193
+ static getCursorSettingsPath(isGlobal, workspaceDir) {
194
+ if (isGlobal) {
195
+ // Global Cursor MCP configuration
196
+ return _path().default.join((0, _os().homedir)(), '.cursor', 'mcp.json');
197
+ } else {
198
+ // Workspace-specific MCP configuration
199
+ const targetDir = workspaceDir || process.cwd();
200
+ return _path().default.join(targetDir, '.cursor', 'mcp.json');
201
+ }
202
+ }
203
+
204
+ /**
205
+ * Setup Cursor MCP integration
206
+ */
207
+ static async setupCursor(options) {
208
+ const {
209
+ isGlobal,
210
+ workspaceDir
211
+ } = options;
212
+
213
+ // Determine mcp.json path
214
+ const mcpConfigPath = this.getCursorSettingsPath(isGlobal, workspaceDir);
215
+
216
+ // Ensure directory exists
217
+ await _fsExtra().default.ensureDir(_path().default.dirname(mcpConfigPath));
218
+
219
+ // Read existing MCP configuration or create empty object
220
+ const mcpConfig = await this.readJsonFile(mcpConfigPath);
221
+
222
+ // Build MCP server args
223
+ const args = this.buildMcpServerArgs(options);
224
+
225
+ // Create or update MCP configuration for Cursor
226
+ if (!mcpConfig.mcpServers) {
227
+ mcpConfig.mcpServers = {};
228
+ }
229
+ mcpConfig.mcpServers.bit = {
230
+ type: 'stdio',
231
+ command: 'bit',
232
+ args: args
233
+ };
234
+
235
+ // Write updated MCP configuration
236
+ await _fsExtra().default.writeFile(mcpConfigPath, JSON.stringify(mcpConfig, null, 2));
237
+ }
238
+
239
+ /**
240
+ * Get Windsurf mcp.json path based on global/workspace scope
241
+ */
242
+ static getWindsurfSettingsPath(isGlobal, workspaceDir) {
243
+ if (isGlobal) {
244
+ // Global Windsurf MCP configuration
245
+ return _path().default.join((0, _os().homedir)(), '.windsurf', 'mcp.json');
246
+ } else {
247
+ // Workspace-specific MCP configuration
248
+ const targetDir = workspaceDir || process.cwd();
249
+ return _path().default.join(targetDir, '.windsurf', 'mcp.json');
250
+ }
251
+ }
252
+
253
+ /**
254
+ * Setup Windsurf MCP integration
255
+ */
256
+ static async setupWindsurf(options) {
257
+ const {
258
+ isGlobal,
259
+ workspaceDir
260
+ } = options;
261
+
262
+ // Determine mcp.json path
263
+ const mcpConfigPath = this.getWindsurfSettingsPath(isGlobal, workspaceDir);
264
+
265
+ // Ensure directory exists
266
+ await _fsExtra().default.ensureDir(_path().default.dirname(mcpConfigPath));
267
+
268
+ // Read existing MCP configuration or create empty object
269
+ const mcpConfig = await this.readJsonFile(mcpConfigPath);
270
+
271
+ // Build MCP server args
272
+ const args = this.buildMcpServerArgs(options);
273
+
274
+ // Create or update MCP configuration for Windsurf
275
+ if (!mcpConfig.mcpServers) {
276
+ mcpConfig.mcpServers = {};
277
+ }
278
+ mcpConfig.mcpServers.bit = {
279
+ type: 'stdio',
280
+ command: 'bit',
281
+ args: args
282
+ };
283
+
284
+ // Write updated MCP configuration
285
+ await _fsExtra().default.writeFile(mcpConfigPath, JSON.stringify(mcpConfig, null, 2));
286
+ }
287
+
288
+ /**
289
+ * Get VS Code prompts path based on global/workspace scope
290
+ */
291
+ static getVSCodePromptsPath(isGlobal, workspaceDir) {
292
+ if (isGlobal) {
293
+ // Global VS Code prompts - use the official User Data prompts directory
294
+ const platform = process.platform;
295
+ switch (platform) {
296
+ case 'win32':
297
+ return _path().default.join((0, _os().homedir)(), 'AppData', 'Roaming', 'Code', 'User', 'prompts', 'bit.instructions.md');
298
+ case 'darwin':
299
+ return _path().default.join((0, _os().homedir)(), 'Library', 'Application Support', 'Code', 'User', 'prompts', 'bit.instructions.md');
300
+ case 'linux':
301
+ return _path().default.join((0, _os().homedir)(), '.config', 'Code', 'User', 'prompts', 'bit.instructions.md');
302
+ default:
303
+ throw new Error(`Unsupported platform: ${platform}`);
304
+ }
305
+ } else {
306
+ // Workspace-specific prompts
307
+ const targetDir = workspaceDir || process.cwd();
308
+ return _path().default.join(targetDir, '.github', 'instructions', 'bit.instructions.md');
309
+ }
310
+ }
311
+
312
+ /**
313
+ * Get Cursor prompts path based on global/workspace scope
314
+ */
315
+ static getCursorPromptsPath(isGlobal, workspaceDir) {
316
+ if (isGlobal) {
317
+ throw new Error('Cursor does not support global prompts configuration in a file');
318
+ } else {
319
+ const targetDir = workspaceDir || process.cwd();
320
+ return _path().default.join(targetDir, '.cursor', 'rules', 'bit.rules.mdc');
321
+ }
322
+ }
323
+
324
+ /**
325
+ * Get Roo Code prompts path based on global/workspace scope
326
+ */
327
+ static getRooCodePromptsPath(isGlobal, workspaceDir) {
328
+ if (isGlobal) {
329
+ // Global Roo Code rules
330
+ return _path().default.join((0, _os().homedir)(), '.roo', 'rules', 'bit.instructions.md');
331
+ } else {
332
+ // Workspace-specific rules
333
+ const targetDir = workspaceDir || process.cwd();
334
+ return _path().default.join(targetDir, '.roo', 'rules', 'bit.instructions.md');
335
+ }
336
+ }
337
+
338
+ /**
339
+ * Get default Bit MCP rules content from template file
340
+ */
341
+ static getDefaultRulesContent(consumerProject = false) {
342
+ const templateName = consumerProject ? 'bit-rules-consumer-template.md' : 'bit-rules-template.md';
343
+ const templatePath = _path().default.join(__dirname, templateName);
344
+ return _fsExtra().default.readFile(templatePath, 'utf8');
345
+ }
346
+
347
+ /**
348
+ * Write Bit MCP rules file for VS Code
349
+ */
350
+ static async writeVSCodeRules(options) {
351
+ const {
352
+ isGlobal,
353
+ workspaceDir,
354
+ consumerProject = false
355
+ } = options;
356
+
357
+ // Determine prompts file path
358
+ const promptsPath = this.getVSCodePromptsPath(isGlobal, workspaceDir);
359
+
360
+ // Ensure directory exists
361
+ await _fsExtra().default.ensureDir(_path().default.dirname(promptsPath));
362
+
363
+ // Write rules content
364
+ const rulesContent = await this.getDefaultRulesContent(consumerProject);
365
+ await _fsExtra().default.writeFile(promptsPath, rulesContent);
366
+ }
367
+
368
+ /**
369
+ * Write Bit MCP rules file for Cursor
370
+ */
371
+ static async writeCursorRules(options) {
372
+ const {
373
+ isGlobal,
374
+ workspaceDir,
375
+ consumerProject = false
376
+ } = options;
377
+
378
+ // Determine prompts file path
379
+ const promptsPath = this.getCursorPromptsPath(isGlobal, workspaceDir);
380
+
381
+ // Ensure directory exists
382
+ await _fsExtra().default.ensureDir(_path().default.dirname(promptsPath));
383
+
384
+ // Write rules content
385
+ const rulesContent = await this.getDefaultRulesContent(consumerProject);
386
+ await _fsExtra().default.writeFile(promptsPath, rulesContent);
387
+ }
388
+
389
+ /**
390
+ * Write Bit MCP rules file for Roo Code
391
+ */
392
+ static async writeRooCodeRules(options) {
393
+ const {
394
+ isGlobal,
395
+ workspaceDir,
396
+ consumerProject = false
397
+ } = options;
398
+
399
+ // Determine prompts file path
400
+ const promptsPath = this.getRooCodePromptsPath(isGlobal, workspaceDir);
401
+
402
+ // Ensure directory exists
403
+ await _fsExtra().default.ensureDir(_path().default.dirname(promptsPath));
404
+
405
+ // Write rules content
406
+ const rulesContent = await this.getDefaultRulesContent(consumerProject);
407
+ await _fsExtra().default.writeFile(promptsPath, rulesContent);
408
+ }
409
+
410
+ /**
411
+ * Write Bit MCP rules file for Cline
412
+ */
413
+ static async writeClineRules(options) {
414
+ const {
415
+ isGlobal,
416
+ workspaceDir,
417
+ consumerProject = false
418
+ } = options;
419
+
420
+ // Determine prompts file path
421
+ const promptsPath = this.getClinePromptsPath(isGlobal, workspaceDir);
422
+
423
+ // Ensure directory exists
424
+ await _fsExtra().default.ensureDir(_path().default.dirname(promptsPath));
425
+
426
+ // Write rules content
427
+ const rulesContent = await this.getDefaultRulesContent(consumerProject);
428
+ await _fsExtra().default.writeFile(promptsPath, rulesContent);
429
+ }
430
+
431
+ /**
432
+ * Get Roo Code mcp.json path based on global/workspace scope
433
+ */
434
+ static getRooCodeSettingsPath(isGlobal, workspaceDir) {
435
+ if (isGlobal) {
436
+ // Roo Code doesn't support global configuration, show warning
437
+ throw new Error('Roo Code global configuration is not supported as it uses VS Code internal storage that cannot be accessed. Please use workspace-specific configuration instead.');
438
+ } else {
439
+ // Workspace-specific MCP configuration
440
+ const targetDir = workspaceDir || process.cwd();
441
+ return _path().default.join(targetDir, '.roo', 'mcp.json');
442
+ }
443
+ }
444
+
445
+ /**
446
+ * Setup Roo Code MCP integration
447
+ */
448
+ static async setupRooCode(options) {
449
+ const {
450
+ isGlobal,
451
+ workspaceDir
452
+ } = options;
453
+ if (isGlobal) {
454
+ throw new Error('Roo Code global configuration is not supported as it uses VS Code internal storage that cannot be accessed. Please use workspace-specific configuration instead.');
455
+ }
456
+
457
+ // Determine mcp.json path
458
+ const mcpConfigPath = this.getRooCodeSettingsPath(isGlobal, workspaceDir);
459
+
460
+ // Ensure directory exists
461
+ await _fsExtra().default.ensureDir(_path().default.dirname(mcpConfigPath));
462
+
463
+ // Read existing MCP configuration or create empty object
464
+ const mcpConfig = await this.readJsonFile(mcpConfigPath);
465
+
466
+ // Build MCP server args
467
+ const args = this.buildMcpServerArgs(options);
468
+
469
+ // Create or update MCP configuration for Roo Code
470
+ if (!mcpConfig.mcpServers) {
471
+ mcpConfig.mcpServers = {};
472
+ }
473
+ mcpConfig.mcpServers.bit = {
474
+ type: 'stdio',
475
+ command: 'bit',
476
+ args: args
477
+ };
478
+
479
+ // Write updated MCP configuration
480
+ await _fsExtra().default.writeFile(mcpConfigPath, JSON.stringify(mcpConfig, null, 2));
481
+ }
482
+
483
+ /**
484
+ * Get Cline prompts path based on global/workspace scope
485
+ */
486
+ static getClinePromptsPath(isGlobal, workspaceDir) {
487
+ if (isGlobal) {
488
+ // Global Cline rules - using Mac path as specified, error for others
489
+ const platform = process.platform;
490
+ if (platform === 'darwin') {
491
+ return _path().default.join((0, _os().homedir)(), 'Documents', 'Cline', 'Rules', 'bit.instructions.md');
492
+ } else {
493
+ throw new Error(`Global Cline rules configuration is not supported on ${platform}. ` + 'The global path is only known for macOS (~/Documents/Cline/Rules/). ' + 'For other operating systems, please use the --print flag to get the rules content ' + 'and add it manually to your global Cline configuration.');
494
+ }
495
+ } else {
496
+ // Workspace-specific rules
497
+ const targetDir = workspaceDir || process.cwd();
498
+ return _path().default.join(targetDir, '.clinerules', 'bit.instructions.md');
499
+ }
500
+ }
501
+ }
502
+ exports.McpSetupUtils = McpSetupUtils;
503
+
504
+ //# sourceMappingURL=setup-utils.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"names":["_fsExtra","data","_interopRequireDefault","require","_path","_os","e","__esModule","default","McpSetupUtils","buildMcpServerArgs","options","consumerProject","includeAdditional","args","push","readJsonFile","filePath","fs","pathExists","content","readFile","JSON","parse","error","Error","path","basename","message","getEditorDisplayName","editor","getVSCodeSettingsPath","isGlobal","workspaceDir","platform","process","join","homedir","targetDir","cwd","getVSCodeMcpConfigPath","setupVSCode","settingsPath","ensureDir","dirname","settings","mcp","servers","type","command","writeFile","stringify","mcpConfigPath","mcpConfig","getCursorSettingsPath","setupCursor","mcpServers","bit","getWindsurfSettingsPath","setupWindsurf","getVSCodePromptsPath","getCursorPromptsPath","getRooCodePromptsPath","getDefaultRulesContent","templateName","templatePath","__dirname","writeVSCodeRules","promptsPath","rulesContent","writeCursorRules","writeRooCodeRules","writeClineRules","getClinePromptsPath","getRooCodeSettingsPath","setupRooCode","exports"],"sources":["setup-utils.ts"],"sourcesContent":["import fs from 'fs-extra';\nimport path from 'path';\nimport { homedir } from 'os';\n\n/**\n * Options for setting up MCP server configuration\n */\nexport interface SetupOptions {\n consumerProject?: boolean;\n includeAdditional?: string;\n isGlobal: boolean;\n workspaceDir?: string;\n}\n\n/**\n * Options for writing rules/instructions files\n */\nexport interface RulesOptions {\n isGlobal: boolean;\n workspaceDir?: string;\n consumerProject?: boolean;\n}\n\n/**\n * Utility class for setting up MCP server configurations across different editors\n */\nexport class McpSetupUtils {\n /**\n * Build MCP server arguments based on provided options\n */\n static buildMcpServerArgs(options: SetupOptions): string[] {\n const { consumerProject, includeAdditional } = options;\n const args = ['mcp-server', 'start'];\n\n if (consumerProject) {\n args.push('--consumer-project');\n }\n\n if (includeAdditional) {\n args.push('--include-additional', includeAdditional);\n }\n\n return args;\n }\n\n /**\n * Read and parse a JSON file, returning empty object if file doesn't exist\n */\n static async readJsonFile(filePath: string): Promise<any> {\n if (!(await fs.pathExists(filePath))) {\n return {};\n }\n\n try {\n const content = await fs.readFile(filePath, 'utf8');\n return JSON.parse(content);\n } catch (error) {\n throw new Error(`Failed to parse ${path.basename(filePath)}: ${(error as Error).message}`);\n }\n }\n\n /**\n * Get display name for an editor\n */\n static getEditorDisplayName(editor: string): string {\n switch (editor) {\n case 'vscode':\n return 'VS Code';\n case 'cursor':\n return 'Cursor';\n case 'windsurf':\n return 'Windsurf';\n case 'roo':\n return 'Roo Code';\n case 'cline':\n return 'Cline';\n default:\n return editor;\n }\n }\n\n /**\n * Get VS Code settings.json path based on global/workspace scope\n */\n static getVSCodeSettingsPath(isGlobal: boolean, workspaceDir?: string): string {\n if (isGlobal) {\n // Global VS Code settings\n const platform = process.platform;\n switch (platform) {\n case 'win32':\n return path.join(homedir(), 'AppData', 'Roaming', 'Code', 'User', 'settings.json');\n case 'darwin':\n return path.join(homedir(), 'Library', 'Application Support', 'Code', 'User', 'settings.json');\n case 'linux':\n return path.join(homedir(), '.config', 'Code', 'User', 'settings.json');\n default:\n throw new Error(`Unsupported platform: ${platform}`);\n }\n } else {\n // Workspace-specific settings\n const targetDir = workspaceDir || process.cwd();\n return path.join(targetDir, '.vscode', 'settings.json');\n }\n }\n\n /**\n * Get VS Code mcp.json path for workspace configuration\n */\n static getVSCodeMcpConfigPath(workspaceDir?: string): string {\n const targetDir = workspaceDir || process.cwd();\n return path.join(targetDir, '.vscode', 'mcp.json');\n }\n\n /**\n * Setup VS Code MCP integration\n */\n static async setupVSCode(options: SetupOptions): Promise<void> {\n const { isGlobal, workspaceDir } = options;\n\n if (isGlobal) {\n // For global configuration, use settings.json with mcp.servers structure\n const settingsPath = this.getVSCodeSettingsPath(isGlobal, workspaceDir);\n\n // Ensure directory exists\n await fs.ensureDir(path.dirname(settingsPath));\n\n // Read existing settings or create empty object\n const settings = await this.readJsonFile(settingsPath);\n\n // Build MCP server args\n const args = this.buildMcpServerArgs(options);\n\n // Create or update MCP configuration\n if (!settings.mcp) {\n settings.mcp = {};\n }\n\n if (!settings.mcp.servers) {\n settings.mcp.servers = {};\n }\n\n settings.mcp.servers['bit-cli'] = {\n type: 'stdio',\n command: 'bit',\n args: args,\n };\n\n // Write updated settings\n await fs.writeFile(settingsPath, JSON.stringify(settings, null, 2));\n } else {\n // For workspace configuration, use .vscode/mcp.json with direct servers structure\n const mcpConfigPath = this.getVSCodeMcpConfigPath(workspaceDir);\n\n // Ensure directory exists\n await fs.ensureDir(path.dirname(mcpConfigPath));\n\n // Read existing MCP configuration or create empty object\n const mcpConfig = await this.readJsonFile(mcpConfigPath);\n\n // Build MCP server args\n const args = this.buildMcpServerArgs(options);\n\n // Create or update MCP configuration\n if (!mcpConfig.servers) {\n mcpConfig.servers = {};\n }\n\n mcpConfig.servers['bit-cli'] = {\n type: 'stdio',\n command: 'bit',\n args: args,\n };\n\n // Write updated MCP configuration\n await fs.writeFile(mcpConfigPath, JSON.stringify(mcpConfig, null, 2));\n }\n }\n\n /**\n * Get Cursor mcp.json path based on global/workspace scope\n */\n static getCursorSettingsPath(isGlobal: boolean, workspaceDir?: string): string {\n if (isGlobal) {\n // Global Cursor MCP configuration\n return path.join(homedir(), '.cursor', 'mcp.json');\n } else {\n // Workspace-specific MCP configuration\n const targetDir = workspaceDir || process.cwd();\n return path.join(targetDir, '.cursor', 'mcp.json');\n }\n }\n\n /**\n * Setup Cursor MCP integration\n */\n static async setupCursor(options: SetupOptions): Promise<void> {\n const { isGlobal, workspaceDir } = options;\n\n // Determine mcp.json path\n const mcpConfigPath = this.getCursorSettingsPath(isGlobal, workspaceDir);\n\n // Ensure directory exists\n await fs.ensureDir(path.dirname(mcpConfigPath));\n\n // Read existing MCP configuration or create empty object\n const mcpConfig = await this.readJsonFile(mcpConfigPath);\n\n // Build MCP server args\n const args = this.buildMcpServerArgs(options);\n\n // Create or update MCP configuration for Cursor\n if (!mcpConfig.mcpServers) {\n mcpConfig.mcpServers = {};\n }\n\n mcpConfig.mcpServers.bit = {\n type: 'stdio',\n command: 'bit',\n args: args,\n };\n\n // Write updated MCP configuration\n await fs.writeFile(mcpConfigPath, JSON.stringify(mcpConfig, null, 2));\n }\n\n /**\n * Get Windsurf mcp.json path based on global/workspace scope\n */\n static getWindsurfSettingsPath(isGlobal: boolean, workspaceDir?: string): string {\n if (isGlobal) {\n // Global Windsurf MCP configuration\n return path.join(homedir(), '.windsurf', 'mcp.json');\n } else {\n // Workspace-specific MCP configuration\n const targetDir = workspaceDir || process.cwd();\n return path.join(targetDir, '.windsurf', 'mcp.json');\n }\n }\n\n /**\n * Setup Windsurf MCP integration\n */\n static async setupWindsurf(options: SetupOptions): Promise<void> {\n const { isGlobal, workspaceDir } = options;\n\n // Determine mcp.json path\n const mcpConfigPath = this.getWindsurfSettingsPath(isGlobal, workspaceDir);\n\n // Ensure directory exists\n await fs.ensureDir(path.dirname(mcpConfigPath));\n\n // Read existing MCP configuration or create empty object\n const mcpConfig = await this.readJsonFile(mcpConfigPath);\n\n // Build MCP server args\n const args = this.buildMcpServerArgs(options);\n\n // Create or update MCP configuration for Windsurf\n if (!mcpConfig.mcpServers) {\n mcpConfig.mcpServers = {};\n }\n\n mcpConfig.mcpServers.bit = {\n type: 'stdio',\n command: 'bit',\n args: args,\n };\n\n // Write updated MCP configuration\n await fs.writeFile(mcpConfigPath, JSON.stringify(mcpConfig, null, 2));\n }\n\n /**\n * Get VS Code prompts path based on global/workspace scope\n */\n static getVSCodePromptsPath(isGlobal: boolean, workspaceDir?: string): string {\n if (isGlobal) {\n // Global VS Code prompts - use the official User Data prompts directory\n const platform = process.platform;\n switch (platform) {\n case 'win32':\n return path.join(homedir(), 'AppData', 'Roaming', 'Code', 'User', 'prompts', 'bit.instructions.md');\n case 'darwin':\n return path.join(\n homedir(),\n 'Library',\n 'Application Support',\n 'Code',\n 'User',\n 'prompts',\n 'bit.instructions.md'\n );\n case 'linux':\n return path.join(homedir(), '.config', 'Code', 'User', 'prompts', 'bit.instructions.md');\n default:\n throw new Error(`Unsupported platform: ${platform}`);\n }\n } else {\n // Workspace-specific prompts\n const targetDir = workspaceDir || process.cwd();\n return path.join(targetDir, '.github', 'instructions', 'bit.instructions.md');\n }\n }\n\n /**\n * Get Cursor prompts path based on global/workspace scope\n */\n static getCursorPromptsPath(isGlobal: boolean, workspaceDir?: string): string {\n if (isGlobal) {\n throw new Error('Cursor does not support global prompts configuration in a file');\n } else {\n const targetDir = workspaceDir || process.cwd();\n return path.join(targetDir, '.cursor', 'rules', 'bit.rules.mdc');\n }\n }\n\n /**\n * Get Roo Code prompts path based on global/workspace scope\n */\n static getRooCodePromptsPath(isGlobal: boolean, workspaceDir?: string): string {\n if (isGlobal) {\n // Global Roo Code rules\n return path.join(homedir(), '.roo', 'rules', 'bit.instructions.md');\n } else {\n // Workspace-specific rules\n const targetDir = workspaceDir || process.cwd();\n return path.join(targetDir, '.roo', 'rules', 'bit.instructions.md');\n }\n }\n\n /**\n * Get default Bit MCP rules content from template file\n */\n static getDefaultRulesContent(consumerProject: boolean = false): Promise<string> {\n const templateName = consumerProject ? 'bit-rules-consumer-template.md' : 'bit-rules-template.md';\n const templatePath = path.join(__dirname, templateName);\n return fs.readFile(templatePath, 'utf8');\n }\n\n /**\n * Write Bit MCP rules file for VS Code\n */\n static async writeVSCodeRules(options: RulesOptions): Promise<void> {\n const { isGlobal, workspaceDir, consumerProject = false } = options;\n\n // Determine prompts file path\n const promptsPath = this.getVSCodePromptsPath(isGlobal, workspaceDir);\n\n // Ensure directory exists\n await fs.ensureDir(path.dirname(promptsPath));\n\n // Write rules content\n const rulesContent = await this.getDefaultRulesContent(consumerProject);\n await fs.writeFile(promptsPath, rulesContent);\n }\n\n /**\n * Write Bit MCP rules file for Cursor\n */\n static async writeCursorRules(options: RulesOptions): Promise<void> {\n const { isGlobal, workspaceDir, consumerProject = false } = options;\n\n // Determine prompts file path\n const promptsPath = this.getCursorPromptsPath(isGlobal, workspaceDir);\n\n // Ensure directory exists\n await fs.ensureDir(path.dirname(promptsPath));\n\n // Write rules content\n const rulesContent = await this.getDefaultRulesContent(consumerProject);\n await fs.writeFile(promptsPath, rulesContent);\n }\n\n /**\n * Write Bit MCP rules file for Roo Code\n */\n static async writeRooCodeRules(options: RulesOptions): Promise<void> {\n const { isGlobal, workspaceDir, consumerProject = false } = options;\n\n // Determine prompts file path\n const promptsPath = this.getRooCodePromptsPath(isGlobal, workspaceDir);\n\n // Ensure directory exists\n await fs.ensureDir(path.dirname(promptsPath));\n\n // Write rules content\n const rulesContent = await this.getDefaultRulesContent(consumerProject);\n await fs.writeFile(promptsPath, rulesContent);\n }\n\n /**\n * Write Bit MCP rules file for Cline\n */\n static async writeClineRules(options: RulesOptions): Promise<void> {\n const { isGlobal, workspaceDir, consumerProject = false } = options;\n\n // Determine prompts file path\n const promptsPath = this.getClinePromptsPath(isGlobal, workspaceDir);\n\n // Ensure directory exists\n await fs.ensureDir(path.dirname(promptsPath));\n\n // Write rules content\n const rulesContent = await this.getDefaultRulesContent(consumerProject);\n await fs.writeFile(promptsPath, rulesContent);\n }\n\n /**\n * Get Roo Code mcp.json path based on global/workspace scope\n */\n static getRooCodeSettingsPath(isGlobal: boolean, workspaceDir?: string): string {\n if (isGlobal) {\n // Roo Code doesn't support global configuration, show warning\n throw new Error(\n 'Roo Code global configuration is not supported as it uses VS Code internal storage that cannot be accessed. Please use workspace-specific configuration instead.'\n );\n } else {\n // Workspace-specific MCP configuration\n const targetDir = workspaceDir || process.cwd();\n return path.join(targetDir, '.roo', 'mcp.json');\n }\n }\n\n /**\n * Setup Roo Code MCP integration\n */\n static async setupRooCode(options: SetupOptions): Promise<void> {\n const { isGlobal, workspaceDir } = options;\n\n if (isGlobal) {\n throw new Error(\n 'Roo Code global configuration is not supported as it uses VS Code internal storage that cannot be accessed. Please use workspace-specific configuration instead.'\n );\n }\n\n // Determine mcp.json path\n const mcpConfigPath = this.getRooCodeSettingsPath(isGlobal, workspaceDir);\n\n // Ensure directory exists\n await fs.ensureDir(path.dirname(mcpConfigPath));\n\n // Read existing MCP configuration or create empty object\n const mcpConfig = await this.readJsonFile(mcpConfigPath);\n\n // Build MCP server args\n const args = this.buildMcpServerArgs(options);\n\n // Create or update MCP configuration for Roo Code\n if (!mcpConfig.mcpServers) {\n mcpConfig.mcpServers = {};\n }\n\n mcpConfig.mcpServers.bit = {\n type: 'stdio',\n command: 'bit',\n args: args,\n };\n\n // Write updated MCP configuration\n await fs.writeFile(mcpConfigPath, JSON.stringify(mcpConfig, null, 2));\n }\n\n /**\n * Get Cline prompts path based on global/workspace scope\n */\n static getClinePromptsPath(isGlobal: boolean, workspaceDir?: string): string {\n if (isGlobal) {\n // Global Cline rules - using Mac path as specified, error for others\n const platform = process.platform;\n if (platform === 'darwin') {\n return path.join(homedir(), 'Documents', 'Cline', 'Rules', 'bit.instructions.md');\n } else {\n throw new Error(\n `Global Cline rules configuration is not supported on ${platform}. ` +\n 'The global path is only known for macOS (~/Documents/Cline/Rules/). ' +\n 'For other operating systems, please use the --print flag to get the rules content ' +\n 'and add it manually to your global Cline configuration.'\n );\n }\n } else {\n // Workspace-specific rules\n const targetDir = workspaceDir || process.cwd();\n return path.join(targetDir, '.clinerules', 'bit.instructions.md');\n }\n }\n}\n"],"mappings":";;;;;;AAAA,SAAAA,SAAA;EAAA,MAAAC,IAAA,GAAAC,sBAAA,CAAAC,OAAA;EAAAH,QAAA,YAAAA,CAAA;IAAA,OAAAC,IAAA;EAAA;EAAA,OAAAA,IAAA;AAAA;AACA,SAAAG,MAAA;EAAA,MAAAH,IAAA,GAAAC,sBAAA,CAAAC,OAAA;EAAAC,KAAA,YAAAA,CAAA;IAAA,OAAAH,IAAA;EAAA;EAAA,OAAAA,IAAA;AAAA;AACA,SAAAI,IAAA;EAAA,MAAAJ,IAAA,GAAAE,OAAA;EAAAE,GAAA,YAAAA,CAAA;IAAA,OAAAJ,IAAA;EAAA;EAAA,OAAAA,IAAA;AAAA;AAA6B,SAAAC,uBAAAI,CAAA,WAAAA,CAAA,IAAAA,CAAA,CAAAC,UAAA,GAAAD,CAAA,KAAAE,OAAA,EAAAF,CAAA;AAE7B;AACA;AACA;;AAQA;AACA;AACA;;AAOA;AACA;AACA;AACO,MAAMG,aAAa,CAAC;EACzB;AACF;AACA;EACE,OAAOC,kBAAkBA,CAACC,OAAqB,EAAY;IACzD,MAAM;MAAEC,eAAe;MAAEC;IAAkB,CAAC,GAAGF,OAAO;IACtD,MAAMG,IAAI,GAAG,CAAC,YAAY,EAAE,OAAO,CAAC;IAEpC,IAAIF,eAAe,EAAE;MACnBE,IAAI,CAACC,IAAI,CA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BA,CAACzC,QAAiB,EAAEC,YAAqB,EAAU;IAC3E,IAAID,QAAQ,EAAE;MACZ;MACA,MAAME,QAAQ,GAAGC,OAAO,CAACD,QAAQ;MACjC,IAAIA,QAAQ,KAAK,QAAQ,EAAE;QACzB,OAAOR,eAAI,CAACU,IAAI,CAAC,IAAAC,aAAO,EAAC,CAAC,EAAE,WAAW,EAAE,OAAO,EAAE,OAAO,EAAE,qBAAqB,CAAC;MACnF,CAAC,MAAM;QACL,MAAM,IAAIZ,KAAK,CACb,wDAAwDS,QAAQ,IAAI,GAClE,sEAAsE,GACtE,oFAAoF,GACpF,yDACJ,CAAC;MACH;IACF,CAAC,MAAM;MACL;MACA,MAAMI,SAAS,GAAGL,YAAY,IAAIE,OAAO,CAACI,GAAG,CAAC,CAAC;MAC/C,OAAOb,eAAI,CAACU,IAAI,CAACE,SAAS,EAAE,aAAa,EAAE,qBAAqB,CAAC;IACnE;EACF;AACF;AAACsC,OAAA,CAAAnE,aAAA,GAAAA,aAAA","ignoreList":[]}
package/package.json ADDED
@@ -0,0 +1,70 @@
1
+ {
2
+ "name": "@teambit/cli-mcp-server",
3
+ "version": "0.0.0-1ed79eba7ca236740e6158efa8a6f27425ecaa11",
4
+ "homepage": "https://bit.cloud/teambit/mcp/cli-mcp-server",
5
+ "main": "dist/index.js",
6
+ "componentId": {
7
+ "scope": "teambit.mcp",
8
+ "name": "cli-mcp-server",
9
+ "version": "1ed79eba7ca236740e6158efa8a6f27425ecaa11"
10
+ },
11
+ "dependencies": {
12
+ "comment-json": "4.2.5",
13
+ "fs-extra": "10.0.0",
14
+ "node-fetch": "2.6.7",
15
+ "strip-ansi": "6.0.0",
16
+ "zod": "^3.24.4",
17
+ "@modelcontextprotocol/sdk": "^1.12.0",
18
+ "lodash": "4.17.21",
19
+ "chalk": "4.1.2",
20
+ "@teambit/harmony": "0.4.7",
21
+ "@teambit/cli": "0.0.0-818417ec37de73d442cfa859e058308b9ef3282b",
22
+ "@teambit/legacy.constants": "0.0.12",
23
+ "@teambit/logger": "0.0.0-0451f37c27e2a2f18b5462436d70b6a2839a9ae1",
24
+ "@teambit/scope.network": "0.0.54"
25
+ },
26
+ "devDependencies": {
27
+ "@types/fs-extra": "9.0.7",
28
+ "@types/node-fetch": "2.5.12",
29
+ "@types/lodash": "4.14.165",
30
+ "@teambit/harmony.envs.core-aspect-env": "0.0.69",
31
+ "@teambit/component.testing.mock-components": "0.0.318",
32
+ "@teambit/harmony.testing.load-aspect": "0.0.313",
33
+ "@teambit/workspace.testing.mock-workspace": "0.0.93"
34
+ },
35
+ "peerDependencies": {
36
+ "chai": "4.3.0",
37
+ "@types/chai": "4.3.19"
38
+ },
39
+ "license": "Apache-2.0",
40
+ "optionalDependencies": {},
41
+ "peerDependenciesMeta": {},
42
+ "exports": {
43
+ ".": {
44
+ "node": {
45
+ "require": "./dist/index.js",
46
+ "import": "./dist/esm.mjs"
47
+ },
48
+ "default": "./dist/index.js"
49
+ },
50
+ "./dist/*": "./dist/*",
51
+ "./artifacts/*": "./artifacts/*",
52
+ "./*": "./*.ts"
53
+ },
54
+ "private": false,
55
+ "engines": {
56
+ "node": ">=16.0.0"
57
+ },
58
+ "repository": {
59
+ "type": "git",
60
+ "url": "https://github.com/teambit/bit"
61
+ },
62
+ "keywords": [
63
+ "bit",
64
+ "bit-aspect",
65
+ "bit-core-aspect",
66
+ "components",
67
+ "collaboration",
68
+ "web"
69
+ ]
70
+ }
@@ -0,0 +1,41 @@
1
+ declare module '*.png' {
2
+ const value: any;
3
+ export = value;
4
+ }
5
+ declare module '*.svg' {
6
+ import type { FunctionComponent, SVGProps } from 'react';
7
+
8
+ export const ReactComponent: FunctionComponent<
9
+ SVGProps<SVGSVGElement> & { title?: string }
10
+ >;
11
+ const src: string;
12
+ export default src;
13
+ }
14
+ declare module '*.jpg' {
15
+ const value: any;
16
+ export = value;
17
+ }
18
+ declare module '*.jpeg' {
19
+ const value: any;
20
+ export = value;
21
+ }
22
+ declare module '*.gif' {
23
+ const value: any;
24
+ export = value;
25
+ }
26
+ declare module '*.bmp' {
27
+ const value: any;
28
+ export = value;
29
+ }
30
+ declare module '*.otf' {
31
+ const value: any;
32
+ export = value;
33
+ }
34
+ declare module '*.woff' {
35
+ const value: any;
36
+ export = value;
37
+ }
38
+ declare module '*.woff2' {
39
+ const value: any;
40
+ export = value;
41
+ }