@teambit/cli-mcp-server 0.0.38 → 0.0.39
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.
- package/README.docs.mdx +72 -2
- package/dist/README.docs.mdx +72 -2
- package/dist/cli-mcp-server.main.runtime.js +8 -2
- package/dist/cli-mcp-server.main.runtime.js.map +1 -1
- package/dist/{preview-1752152596621.js → preview-1752165050741.js} +1 -1
- package/dist/rules-cmd.js +10 -3
- package/dist/rules-cmd.js.map +1 -1
- package/dist/setup-cmd.js +8 -3
- package/dist/setup-cmd.js.map +1 -1
- package/dist/setup-utils.d.ts +16 -0
- package/dist/setup-utils.js +109 -0
- package/dist/setup-utils.js.map +1 -1
- package/package.json +2 -2
package/README.docs.mdx
CHANGED
|
@@ -50,7 +50,7 @@ This will automatically configure your VS Code settings to use the Bit MCP serve
|
|
|
50
50
|
The **recommended way** to integrate the MCP server with your IDE is using the `setup` command:
|
|
51
51
|
|
|
52
52
|
```bash
|
|
53
|
-
bit mcp-server setup [vscode|cursor|windsurf] [options]
|
|
53
|
+
bit mcp-server setup [vscode|cursor|windsurf|roo|cline|claude-code] [options]
|
|
54
54
|
```
|
|
55
55
|
|
|
56
56
|
This command automatically configures the MCP server settings in your chosen editor. If no editor is specified, it defaults to VS Code.
|
|
@@ -60,6 +60,9 @@ This command automatically configures the MCP server settings in your chosen edi
|
|
|
60
60
|
- **VS Code**: `bit mcp-server setup vscode` (or just `bit mcp-server setup`)
|
|
61
61
|
- **Cursor**: `bit mcp-server setup cursor`
|
|
62
62
|
- **Windsurf**: `bit mcp-server setup windsurf`
|
|
63
|
+
- **Roo Code**: `bit mcp-server setup roo`
|
|
64
|
+
- **Cline**: `bit mcp-server setup cline`
|
|
65
|
+
- **Claude Code**: `bit mcp-server setup claude-code`
|
|
63
66
|
|
|
64
67
|
#### Configuration Options
|
|
65
68
|
|
|
@@ -78,6 +81,12 @@ bit mcp-server setup cursor --global
|
|
|
78
81
|
|
|
79
82
|
# Setup with consumer project mode
|
|
80
83
|
bit mcp-server setup --consumer-project
|
|
84
|
+
|
|
85
|
+
# Setup for Claude Code (creates .mcp.json file)
|
|
86
|
+
bit mcp-server setup claude-code
|
|
87
|
+
|
|
88
|
+
# Global setup for Claude Code
|
|
89
|
+
bit mcp-server setup claude-code --global
|
|
81
90
|
```
|
|
82
91
|
|
|
83
92
|
#### Manual Configuration
|
|
@@ -120,6 +129,59 @@ If you need to manually configure the settings, here's how to set up VS Code MCP
|
|
|
120
129
|
}
|
|
121
130
|
```
|
|
122
131
|
|
|
132
|
+
#### Claude Code Setup
|
|
133
|
+
|
|
134
|
+
Claude Code uses `.mcp.json` files for MCP server configuration. The setup command creates these files automatically:
|
|
135
|
+
|
|
136
|
+
**Workspace Configuration:**
|
|
137
|
+
|
|
138
|
+
```bash
|
|
139
|
+
bit mcp-server setup claude-code
|
|
140
|
+
```
|
|
141
|
+
|
|
142
|
+
This creates a `.mcp.json` file in your project root:
|
|
143
|
+
|
|
144
|
+
```json
|
|
145
|
+
{
|
|
146
|
+
"mcpServers": {
|
|
147
|
+
"bit": {
|
|
148
|
+
"command": "bit",
|
|
149
|
+
"args": ["mcp-server", "start"]
|
|
150
|
+
}
|
|
151
|
+
}
|
|
152
|
+
}
|
|
153
|
+
```
|
|
154
|
+
|
|
155
|
+
**Global Configuration:**
|
|
156
|
+
|
|
157
|
+
```bash
|
|
158
|
+
bit mcp-server setup claude-code --global
|
|
159
|
+
```
|
|
160
|
+
|
|
161
|
+
This creates/updates the global configuration file:
|
|
162
|
+
|
|
163
|
+
- **macOS**: `~/Library/Application Support/Claude/claude_desktop_config.json`
|
|
164
|
+
- **Windows**: `%APPDATA%\Claude\claude_desktop_config.json`
|
|
165
|
+
- **Linux**: `~/.config/claude/claude_desktop_config.json`
|
|
166
|
+
|
|
167
|
+
**Important**: After setup, restart Claude Code for the MCP server to be available.
|
|
168
|
+
|
|
169
|
+
**Claude Code Rules:**
|
|
170
|
+
|
|
171
|
+
To provide Bit-specific guidance to Claude Code, use the rules command:
|
|
172
|
+
|
|
173
|
+
```bash
|
|
174
|
+
bit mcp-server rules claude-code
|
|
175
|
+
```
|
|
176
|
+
|
|
177
|
+
This creates `.claude/bit.md` with Bit instructions. To integrate with your existing `CLAUDE.md`, add:
|
|
178
|
+
|
|
179
|
+
```markdown
|
|
180
|
+
@.claude/bit.md
|
|
181
|
+
```
|
|
182
|
+
|
|
183
|
+
This approach ensures your existing `CLAUDE.md` file is never overwritten.
|
|
184
|
+
|
|
123
185
|
### Programmatic Usage
|
|
124
186
|
|
|
125
187
|
```javascript
|
|
@@ -206,7 +268,7 @@ bit mcp-server start --consumer-project --include-additional "deps,get,preview"
|
|
|
206
268
|
The MCP server provides a `rules` command to create instruction files for AI assistants:
|
|
207
269
|
|
|
208
270
|
```bash
|
|
209
|
-
bit mcp-server rules [vscode|cursor|windsurf|cline] [options]
|
|
271
|
+
bit mcp-server rules [vscode|cursor|windsurf|roo|cline|claude-code] [options]
|
|
210
272
|
```
|
|
211
273
|
|
|
212
274
|
This command creates rules/instructions markdown files that provide guidance to AI assistants on how to effectively use the Bit MCP server and follow best practices when working with Bit components.
|
|
@@ -216,7 +278,9 @@ This command creates rules/instructions markdown files that provide guidance to
|
|
|
216
278
|
- **VS Code**: `bit mcp-server rules vscode` (or just `bit mcp-server rules`)
|
|
217
279
|
- **Cursor**: `bit mcp-server rules cursor`
|
|
218
280
|
- **Windsurf**: `bit mcp-server rules windsurf`
|
|
281
|
+
- **Roo Code**: `bit mcp-server rules roo`
|
|
219
282
|
- **Cline**: `bit mcp-server rules cline`
|
|
283
|
+
- **Claude Code**: `bit mcp-server rules claude-code`
|
|
220
284
|
|
|
221
285
|
#### Configuration Options
|
|
222
286
|
|
|
@@ -236,6 +300,12 @@ bit mcp-server rules cursor --global
|
|
|
236
300
|
# Consumer project rules for VS Code
|
|
237
301
|
bit mcp-server rules --consumer-project
|
|
238
302
|
|
|
303
|
+
# Claude Code rules (creates .claude/bit.md)
|
|
304
|
+
bit mcp-server rules claude-code
|
|
305
|
+
|
|
306
|
+
# Global Claude Code rules
|
|
307
|
+
bit mcp-server rules claude-code --global
|
|
308
|
+
|
|
239
309
|
# Global rules for Cline (macOS only)
|
|
240
310
|
bit mcp-server rules cline --global
|
|
241
311
|
|
package/dist/README.docs.mdx
CHANGED
|
@@ -50,7 +50,7 @@ This will automatically configure your VS Code settings to use the Bit MCP serve
|
|
|
50
50
|
The **recommended way** to integrate the MCP server with your IDE is using the `setup` command:
|
|
51
51
|
|
|
52
52
|
```bash
|
|
53
|
-
bit mcp-server setup [vscode|cursor|windsurf] [options]
|
|
53
|
+
bit mcp-server setup [vscode|cursor|windsurf|roo|cline|claude-code] [options]
|
|
54
54
|
```
|
|
55
55
|
|
|
56
56
|
This command automatically configures the MCP server settings in your chosen editor. If no editor is specified, it defaults to VS Code.
|
|
@@ -60,6 +60,9 @@ This command automatically configures the MCP server settings in your chosen edi
|
|
|
60
60
|
- **VS Code**: `bit mcp-server setup vscode` (or just `bit mcp-server setup`)
|
|
61
61
|
- **Cursor**: `bit mcp-server setup cursor`
|
|
62
62
|
- **Windsurf**: `bit mcp-server setup windsurf`
|
|
63
|
+
- **Roo Code**: `bit mcp-server setup roo`
|
|
64
|
+
- **Cline**: `bit mcp-server setup cline`
|
|
65
|
+
- **Claude Code**: `bit mcp-server setup claude-code`
|
|
63
66
|
|
|
64
67
|
#### Configuration Options
|
|
65
68
|
|
|
@@ -78,6 +81,12 @@ bit mcp-server setup cursor --global
|
|
|
78
81
|
|
|
79
82
|
# Setup with consumer project mode
|
|
80
83
|
bit mcp-server setup --consumer-project
|
|
84
|
+
|
|
85
|
+
# Setup for Claude Code (creates .mcp.json file)
|
|
86
|
+
bit mcp-server setup claude-code
|
|
87
|
+
|
|
88
|
+
# Global setup for Claude Code
|
|
89
|
+
bit mcp-server setup claude-code --global
|
|
81
90
|
```
|
|
82
91
|
|
|
83
92
|
#### Manual Configuration
|
|
@@ -120,6 +129,59 @@ If you need to manually configure the settings, here's how to set up VS Code MCP
|
|
|
120
129
|
}
|
|
121
130
|
```
|
|
122
131
|
|
|
132
|
+
#### Claude Code Setup
|
|
133
|
+
|
|
134
|
+
Claude Code uses `.mcp.json` files for MCP server configuration. The setup command creates these files automatically:
|
|
135
|
+
|
|
136
|
+
**Workspace Configuration:**
|
|
137
|
+
|
|
138
|
+
```bash
|
|
139
|
+
bit mcp-server setup claude-code
|
|
140
|
+
```
|
|
141
|
+
|
|
142
|
+
This creates a `.mcp.json` file in your project root:
|
|
143
|
+
|
|
144
|
+
```json
|
|
145
|
+
{
|
|
146
|
+
"mcpServers": {
|
|
147
|
+
"bit": {
|
|
148
|
+
"command": "bit",
|
|
149
|
+
"args": ["mcp-server", "start"]
|
|
150
|
+
}
|
|
151
|
+
}
|
|
152
|
+
}
|
|
153
|
+
```
|
|
154
|
+
|
|
155
|
+
**Global Configuration:**
|
|
156
|
+
|
|
157
|
+
```bash
|
|
158
|
+
bit mcp-server setup claude-code --global
|
|
159
|
+
```
|
|
160
|
+
|
|
161
|
+
This creates/updates the global configuration file:
|
|
162
|
+
|
|
163
|
+
- **macOS**: `~/Library/Application Support/Claude/claude_desktop_config.json`
|
|
164
|
+
- **Windows**: `%APPDATA%\Claude\claude_desktop_config.json`
|
|
165
|
+
- **Linux**: `~/.config/claude/claude_desktop_config.json`
|
|
166
|
+
|
|
167
|
+
**Important**: After setup, restart Claude Code for the MCP server to be available.
|
|
168
|
+
|
|
169
|
+
**Claude Code Rules:**
|
|
170
|
+
|
|
171
|
+
To provide Bit-specific guidance to Claude Code, use the rules command:
|
|
172
|
+
|
|
173
|
+
```bash
|
|
174
|
+
bit mcp-server rules claude-code
|
|
175
|
+
```
|
|
176
|
+
|
|
177
|
+
This creates `.claude/bit.md` with Bit instructions. To integrate with your existing `CLAUDE.md`, add:
|
|
178
|
+
|
|
179
|
+
```markdown
|
|
180
|
+
@.claude/bit.md
|
|
181
|
+
```
|
|
182
|
+
|
|
183
|
+
This approach ensures your existing `CLAUDE.md` file is never overwritten.
|
|
184
|
+
|
|
123
185
|
### Programmatic Usage
|
|
124
186
|
|
|
125
187
|
```javascript
|
|
@@ -206,7 +268,7 @@ bit mcp-server start --consumer-project --include-additional "deps,get,preview"
|
|
|
206
268
|
The MCP server provides a `rules` command to create instruction files for AI assistants:
|
|
207
269
|
|
|
208
270
|
```bash
|
|
209
|
-
bit mcp-server rules [vscode|cursor|windsurf|cline] [options]
|
|
271
|
+
bit mcp-server rules [vscode|cursor|windsurf|roo|cline|claude-code] [options]
|
|
210
272
|
```
|
|
211
273
|
|
|
212
274
|
This command creates rules/instructions markdown files that provide guidance to AI assistants on how to effectively use the Bit MCP server and follow best practices when working with Bit components.
|
|
@@ -216,7 +278,9 @@ This command creates rules/instructions markdown files that provide guidance to
|
|
|
216
278
|
- **VS Code**: `bit mcp-server rules vscode` (or just `bit mcp-server rules`)
|
|
217
279
|
- **Cursor**: `bit mcp-server rules cursor`
|
|
218
280
|
- **Windsurf**: `bit mcp-server rules windsurf`
|
|
281
|
+
- **Roo Code**: `bit mcp-server rules roo`
|
|
219
282
|
- **Cline**: `bit mcp-server rules cline`
|
|
283
|
+
- **Claude Code**: `bit mcp-server rules claude-code`
|
|
220
284
|
|
|
221
285
|
#### Configuration Options
|
|
222
286
|
|
|
@@ -236,6 +300,12 @@ bit mcp-server rules cursor --global
|
|
|
236
300
|
# Consumer project rules for VS Code
|
|
237
301
|
bit mcp-server rules --consumer-project
|
|
238
302
|
|
|
303
|
+
# Claude Code rules (creates .claude/bit.md)
|
|
304
|
+
bit mcp-server rules claude-code
|
|
305
|
+
|
|
306
|
+
# Global Claude Code rules
|
|
307
|
+
bit mcp-server rules claude-code --global
|
|
308
|
+
|
|
239
309
|
# Global rules for Cline (macOS only)
|
|
240
310
|
bit mcp-server rules cline --global
|
|
241
311
|
|
|
@@ -1171,11 +1171,13 @@ class CliMcpServerMain {
|
|
|
1171
1171
|
return _setupUtils().McpSetupUtils.getRooCodeSettingsPath(isGlobal, workspaceDir);
|
|
1172
1172
|
} else if (editorLower === 'cline') {
|
|
1173
1173
|
return _setupUtils().McpSetupUtils.getClinePromptsPath(isGlobal, workspaceDir);
|
|
1174
|
+
} else if (editorLower === 'claude-code') {
|
|
1175
|
+
return _setupUtils().McpSetupUtils.getClaudeCodeSettingsPath(isGlobal, workspaceDir);
|
|
1174
1176
|
}
|
|
1175
1177
|
throw new Error(`Editor "${editor}" is not supported yet.`);
|
|
1176
1178
|
}
|
|
1177
1179
|
async setupEditor(editor, options, workspaceDir) {
|
|
1178
|
-
const supportedEditors = ['vscode', 'cursor', 'windsurf', 'roo', 'cline'];
|
|
1180
|
+
const supportedEditors = ['vscode', 'cursor', 'windsurf', 'roo', 'cline', 'claude-code'];
|
|
1179
1181
|
const editorLower = editor.toLowerCase();
|
|
1180
1182
|
if (!supportedEditors.includes(editorLower)) {
|
|
1181
1183
|
throw new Error(`Editor "${editor}" is not supported yet. Currently supported: ${supportedEditors.join(', ')}`);
|
|
@@ -1198,10 +1200,12 @@ class CliMcpServerMain {
|
|
|
1198
1200
|
// Cline doesn't need MCP server setup, only rules files
|
|
1199
1201
|
// This is a no-op but we include it for consistency
|
|
1200
1202
|
// Users should use the 'rules' command to set up Cline instructions
|
|
1203
|
+
} else if (editorLower === 'claude-code') {
|
|
1204
|
+
await _setupUtils().McpSetupUtils.setupClaudeCode(setupOptions);
|
|
1201
1205
|
}
|
|
1202
1206
|
}
|
|
1203
1207
|
async writeRulesFile(editor, options, workspaceDir) {
|
|
1204
|
-
const supportedEditors = ['vscode', 'cursor', 'roo', 'cline'];
|
|
1208
|
+
const supportedEditors = ['vscode', 'cursor', 'roo', 'cline', 'claude-code'];
|
|
1205
1209
|
const editorLower = editor.toLowerCase();
|
|
1206
1210
|
if (!supportedEditors.includes(editorLower)) {
|
|
1207
1211
|
throw new Error(`Editor "${editor}" is not supported yet. Currently supported: ${supportedEditors.join(', ')}`);
|
|
@@ -1220,6 +1224,8 @@ class CliMcpServerMain {
|
|
|
1220
1224
|
await _setupUtils().McpSetupUtils.writeRooCodeRules(rulesOptions);
|
|
1221
1225
|
} else if (editorLower === 'cline') {
|
|
1222
1226
|
await _setupUtils().McpSetupUtils.writeClineRules(rulesOptions);
|
|
1227
|
+
} else if (editorLower === 'claude-code') {
|
|
1228
|
+
await _setupUtils().McpSetupUtils.writeClaudeCodeRules(rulesOptions);
|
|
1223
1229
|
}
|
|
1224
1230
|
}
|
|
1225
1231
|
async getRulesContent(consumerProject = false) {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["_cli","data","require","_child_process","_interopRequireDefault","_stripAnsi","_fsExtra","_commentJson","_path","_cliMcpServer","_mcpServer","_mcp","_stdio","_zod","_logger","_scope","_legacy","_nodeFetch","_setupCmd","_rulesCmd","_setupUtils","e","__esModule","default","ownKeys","r","t","Object","keys","getOwnPropertySymbols","o","filter","getOwnPropertyDescriptor","enumerable","push","apply","_objectSpread","arguments","length","forEach","_defineProperty","getOwnPropertyDescriptors","defineProperties","defineProperty","_toPropertyKey","value","configurable","writable","i","_toPrimitive","Symbol","toPrimitive","call","TypeError","String","Number","CliMcpServerMain","constructor","cli","logger","Set","bitBin","validateBitBin","getHttp","_http","Http","connect","SYMPHONY_GRAPHQL","CENTRAL_BIT_HUB_NAME","getBitServerPort","cwd","skipValidatePortFlag","args","result","childProcess","spawnSync","env","process","BIT_CLI_SERVER","encoding","error","status","Error","stderr","existingPort","stdout","trim","undefined","parseInt","err","message","startBitServer","debug","Promise","resolve","reject","serverProcess","spawn","stdio","detached","serverStarted","outputBuffer","timeout","setTimeout","kill","on","output","toString","includes","clearTimeout","portMatch","match","port","serverPort","serverUrl","code","signal","killServerProcess","killed","exit","callBitServerAPI","command","flags","isReTrying","callBitServerAPIWithRoute","callBitServerIDEAPI","method","route","commandOrMethod","argsOrParams","isIDERoute","startedPort","realCwd","fs","realpathSync","body","url","commandArray","key","entries","pwd","response","fetch","headers","JSON","stringify","ok","errorMessage","statusText","errorJson","json","runMcpServer","options","commands","alwaysExcludeTools","additionalCommandsSet","includeAdditional","split","map","cmd","Array","from","join","server","McpServer","name","version","consumerProjectTools","consumerProject","Boolean","isConsumerProjectMode","filterOptions","cmdName","getCommandName","shouldIncludeCommand","registerToolForCommand","processSubCommands","registerRemoteSearchTool","registerRemoteComponentDetailsTool","registerWorkspaceInfoTool","registerComponentDetailsTool","registerCommandsListTool","registerCommandHelpTool","registerQueryTool","registerExecuteTool","StdioServerTransport","has","shouldInclude","buildZodSchema","config","schema","z","string","describe","argsData","arg","desc","description","nameRaw","isArray","nameCamelCase","required","array","optional","flagsData","flag","type","boolean","buildCommandArgs","params","val","item","stringValue","getToolName","replace","parentCmd","toolName","extendedDescription","getArgsData","getFlagsData","tool","argsToRun","runBit","readWorkspaceJsonc","workspaceDir","workspaceJsoncPath","path","fileExists","pathExists","content","readFile","parse","extractOwnerFromWorkspace","workspaceConfig","workspaceSection","defaultScope","parts","queryStr","owners","skipAutoOwner","http","ownersToUse","extractedOwner","results","search","components","text","formattedResults","componentName","includeSchema","showArgs","showResult","componentInfo","schemaArgs","schemaResult","schemaError","warn","formatAsCallToolResult","formatErrorAsCallToolResult","includeTemplates","includeApps","includeGraph","useJson","workspaceInfo","statusExecution","safeBitCommandExecution","listExecution","list","appsExecution","apps","templatesExecution","templates","graphExecution","graph","workspaceDependencies","laneId","ideApiResult","internal","commandsInfo","shouldSkipCommand","private","startsWith","mainCmdName","groupKey","group","commandInfo","groups","subcommands","subCmd","sort","a","b","localeCompare","total","subcommand","requestedCommand","requestedSubcommand","buildDetailedCommandInfo","parentName","info","examples","find","sub","commandFullName","record","union","fullCommand","isAllowed","readOnlyCommands","allowedCommands","commandArgs","execution","commandParts","parentCmdName","subCmdName","fullCmdName","BIT_DISABLE_SPINNER","executeBitServerCommand","operationName","operation","includeErrorInResult","stripAnsi","success","trimmed","test","getEditorDisplayName","editor","McpSetupUtils","getEditorConfigPath","isGlobal","editorLower","toLowerCase","getVSCodeSettingsPath","getVSCodeMcpConfigPath","getCursorSettingsPath","getWindsurfSettingsPath","getRooCodeSettingsPath","getClinePromptsPath","setupEditor","supportedEditors","setupOptions","setupVSCode","setupCursor","setupWindsurf","setupRooCode","writeRulesFile","rulesOptions","writeVSCodeRules","writeCursorRules","writeRooCodeRules","writeClineRules","getRulesContent","getDefaultRulesContent","provider","loggerMain","createLogger","CliMcpServerAspect","id","mcpServer","mcpServerCmd","McpServerCmd","McpStartCmd","McpSetupCmd","McpRulesCmd","register","exports","CLIAspect","LoggerAspect","MainRuntime","addRuntime","_default"],"sources":["cli-mcp-server.main.runtime.ts"],"sourcesContent":["/* eslint-disable import/extensions */\n/* eslint-disable import/no-unresolved */\n\nimport { CLIAspect, CLIMain, Command, getArgsData, getCommandName, getFlagsData, MainRuntime } from '@teambit/cli';\nimport childProcess from 'child_process';\nimport stripAnsi from 'strip-ansi';\nimport fs from 'fs-extra';\nimport { parse } from 'comment-json';\nimport path from 'path';\nimport { CliMcpServerAspect } from './cli-mcp-server.aspect';\nimport { McpServerCmd, McpStartCmd } from './mcp-server.cmd';\nimport { McpServer } from '@modelcontextprotocol/sdk/server/mcp.js';\nimport { StdioServerTransport } from '@modelcontextprotocol/sdk/server/stdio.js';\nimport { CallToolResult } from '@modelcontextprotocol/sdk/types.js';\nimport { z } from 'zod';\nimport { Logger, LoggerAspect, LoggerMain } from '@teambit/logger';\nimport { Http } from '@teambit/scope.network';\nimport { CENTRAL_BIT_HUB_NAME, SYMPHONY_GRAPHQL } from '@teambit/legacy.constants';\nimport fetch from 'node-fetch';\nimport { McpSetupCmd } from './setup-cmd';\nimport { McpRulesCmd } from './rules-cmd';\nimport { McpSetupUtils, SetupOptions, RulesOptions } from './setup-utils';\n\ninterface CommandFilterOptions {\n additionalCommandsSet?: Set<string>;\n alwaysExcludeTools: Set<string>;\n consumerProject: boolean;\n consumerProjectTools: Set<string>;\n}\n\ninterface CommandConfig {\n name: string;\n description: string;\n argsData: ReturnType<typeof getArgsData>;\n flagsData: ReturnType<typeof getFlagsData>;\n}\n\nexport class CliMcpServerMain {\n private bitBin = 'bit';\n private _http: Http;\n private isConsumerProjectMode: boolean = false;\n private serverPort?: number;\n private serverUrl?: string;\n private serverProcess: childProcess.ChildProcess | null = null;\n\n // Whitelist of commands that are considered read-only/query operations\n private readonly readOnlyCommands = new Set([\n 'status',\n 'list',\n 'info',\n 'show',\n 'schema',\n 'artifacts',\n 'diff',\n 'log',\n 'graph',\n 'deps get',\n 'deps blame',\n 'why',\n 'config get',\n 'envs list',\n 'envs get',\n 'remote list',\n 'templates',\n 'cat-component',\n 'cat-lane',\n 'cat-object',\n 'cat-scope',\n 'lane show',\n 'lane list',\n 'lane diff',\n 'lane history',\n 'lane history-diff',\n 'test',\n 'help',\n 'version',\n ]);\n\n constructor(\n private cli: CLIMain,\n private logger: Logger\n ) {\n // Validate the default bitBin on construction\n this.bitBin = this.validateBitBin(this.bitBin);\n }\n\n async getHttp(): Promise<Http> {\n if (!this._http) {\n this._http = await Http.connect(SYMPHONY_GRAPHQL, CENTRAL_BIT_HUB_NAME);\n }\n return this._http;\n }\n\n private async getBitServerPort(cwd: string, skipValidatePortFlag = false): Promise<number | undefined> {\n try {\n const args = ['cli-server-port'];\n if (skipValidatePortFlag) {\n args.push(String(skipValidatePortFlag));\n }\n\n const result = childProcess.spawnSync(this.bitBin, args, {\n cwd,\n env: { ...process.env, BIT_CLI_SERVER: 'true' },\n encoding: 'utf8',\n });\n\n if (result.error) {\n throw result.error;\n }\n\n if (result.status !== 0) {\n throw new Error(`Command failed with status ${result.status}: ${result.stderr}`);\n }\n\n const existingPort = result.stdout.trim();\n if (!existingPort) return undefined;\n return parseInt(existingPort, 10);\n } catch (err: any) {\n this.logger.error(`[MCP-DEBUG] error getting existing port from bit server at ${cwd}. err: ${err.message}`);\n return undefined;\n }\n }\n\n /**\n * Start a new bit-server process\n */\n private async startBitServer(cwd: string): Promise<number | null> {\n this.logger.debug('[MCP-DEBUG] Starting new bit-server process');\n\n return new Promise((resolve, reject) => {\n try {\n const serverProcess = childProcess.spawn(this.bitBin, ['server'], {\n cwd,\n stdio: ['pipe', 'pipe', 'pipe'],\n detached: false,\n });\n\n this.serverProcess = serverProcess;\n\n let serverStarted = false;\n let outputBuffer = '';\n\n const timeout = setTimeout(() => {\n if (!serverStarted) {\n this.logger.error('[MCP-DEBUG] Timeout waiting for bit-server to start');\n serverProcess.kill();\n resolve(null);\n }\n }, 30000); // 30 second timeout\n\n serverProcess.stdout?.on('data', (data) => {\n const output = data.toString();\n outputBuffer += output;\n this.logger.debug(`[MCP-DEBUG] bit-server stdout: ${output}`);\n if (output.includes('listening on port')) {\n clearTimeout(timeout);\n if (!serverStarted) {\n serverStarted = true;\n // Extract the port from the output\n const portMatch = output.match(/listening on port (\\d+)/);\n if (portMatch && portMatch[1]) {\n const port = parseInt(portMatch[1], 10);\n this.logger.debug(`[MCP-DEBUG] bit-server started on port ${port}`);\n this.serverPort = port;\n this.serverUrl = `http://localhost:${port}/api`;\n resolve(port);\n }\n }\n }\n });\n\n serverProcess.stderr?.on('data', (data) => {\n const error = data.toString();\n outputBuffer += error;\n this.logger.debug(`[MCP-DEBUG] bit-server stderr: ${error}`);\n });\n\n serverProcess.on('error', (err) => {\n clearTimeout(timeout);\n this.logger.error(`[MCP-DEBUG] Failed to start bit-server: ${err.message}`);\n reject(err);\n });\n\n serverProcess.on('exit', (code, signal) => {\n clearTimeout(timeout);\n if (!serverStarted) {\n this.logger.error(`[MCP-DEBUG] bit-server exited with code ${code}, signal ${signal}`);\n this.logger.debug(`[MCP-DEBUG] bit-server output: ${outputBuffer}`);\n resolve(null);\n }\n });\n\n const killServerProcess = () => {\n if (this.serverProcess && !this.serverProcess.killed) {\n this.logger.debug('[MCP-DEBUG] Killing bit-server process');\n this.serverProcess.kill();\n }\n };\n\n // Handle process cleanup\n process.on('exit', () => {\n killServerProcess();\n });\n\n process.on('SIGINT', () => {\n killServerProcess();\n process.exit();\n });\n\n process.on('SIGTERM', () => {\n killServerProcess();\n process.exit();\n });\n } catch (err) {\n this.logger.error(`[MCP-DEBUG] Error spawning bit-server: ${(err as Error).message}`);\n reject(err);\n }\n });\n }\n\n /**\n * Call bit-server API endpoint using cli-raw route\n */\n private async callBitServerAPI(\n command: string,\n args: string[] = [],\n flags: Record<string, any> = {},\n cwd: string,\n isReTrying = false\n ): Promise<any> {\n return this.callBitServerAPIWithRoute('cli-raw', command, args, flags, cwd, isReTrying);\n }\n\n /**\n * Call bit-server API endpoint using IDE route\n */\n private async callBitServerIDEAPI(method: string, args: any[] = [], cwd: string, isReTrying = false): Promise<any> {\n return this.callBitServerAPIWithRoute('ide', method, args, {}, cwd, isReTrying, true);\n }\n\n /**\n * Generic method to call bit-server API with different routes\n */\n private async callBitServerAPIWithRoute(\n route: string,\n commandOrMethod: string,\n argsOrParams: any[] = [],\n flags: Record<string, any> = {},\n cwd: string,\n isReTrying = false,\n isIDERoute = false\n ): Promise<any> {\n if (!this.serverPort) {\n if (!cwd) throw new Error('CWD is required to call bit-server API');\n this.serverPort = await this.getBitServerPort(cwd);\n if (this.serverPort) {\n this.serverUrl = `http://localhost:${this.serverPort}/api`;\n } else {\n // No server running, try to start one\n this.logger.debug('[MCP-DEBUG] No bit-server found, attempting to start one');\n const startedPort = await this.startBitServer(cwd);\n if (startedPort) {\n this.serverPort = startedPort;\n this.serverUrl = `http://localhost:${this.serverPort}/api`;\n }\n }\n }\n\n if (!this.serverUrl) {\n throw new Error('Unable to connect to bit-server. Please ensure you are in a valid Bit workspace.');\n }\n\n // Resolve the real path to handle symlinks (e.g., /tmp -> /private/tmp on macOS)\n const realCwd = fs.realpathSync(cwd);\n\n let body: any;\n let url: string;\n\n if (isIDERoute) {\n // For IDE route, use the method name and args directly\n body = {\n args: argsOrParams,\n };\n url = `${this.serverUrl}/${route}/${commandOrMethod}`;\n } else {\n // For CLI route, build command array with flags\n const commandArray = [commandOrMethod, ...argsOrParams];\n\n // Convert flags to command line arguments\n for (const [key, value] of Object.entries(flags)) {\n if (value === true) {\n commandArray.push(`--${key}`);\n } else if (value !== false && value !== undefined) {\n commandArray.push(`--${key}`, String(value));\n }\n }\n\n body = {\n command: commandArray,\n pwd: realCwd,\n };\n url = `${this.serverUrl}/${route}`;\n }\n\n try {\n const response = await fetch(url, {\n method: 'POST',\n headers: { 'Content-Type': 'application/json' },\n body: JSON.stringify(body),\n });\n\n if (!response.ok) {\n let errorMessage = `HTTP ${response.status}: ${response.statusText}`;\n try {\n const errorJson = await response.json();\n errorMessage = errorJson.message || errorJson || errorMessage;\n } catch {\n // Ignore JSON parse errors\n }\n throw new Error(errorMessage);\n }\n\n return await response.json();\n } catch (err: any) {\n if (err.code === 'ECONNREFUSED' && !isReTrying) {\n // Server is no longer running, reset cached values and try to restart\n this.serverPort = undefined;\n this.serverUrl = undefined;\n this.logger.debug('[MCP-DEBUG] Connection refused, attempting to restart bit-server');\n return this.callBitServerAPIWithRoute(route, commandOrMethod, argsOrParams, flags, cwd, true, isIDERoute);\n }\n throw err;\n }\n }\n\n async runMcpServer(options: { includeAdditional?: string; bitBin?: string; consumerProject?: boolean }) {\n this.logger.debug(\n `[MCP-DEBUG] Starting MCP server with options: ${JSON.stringify(options)}. CWD: ${process.cwd()}`\n );\n const commands = this.cli.commands;\n\n // Validate and set bitBin with security checks\n if (options.bitBin) {\n this.bitBin = this.validateBitBin(options.bitBin);\n }\n // If no bitBin provided, keep the default 'bit'\n\n // Tools to always exclude\n const alwaysExcludeTools = new Set([\n 'login',\n 'logout',\n 'completion',\n 'mcp-server',\n 'start',\n 'run-action',\n 'watch',\n 'run',\n 'resume-export',\n 'server',\n 'serve-preview',\n ]);\n\n // Parse command strings from flag options\n let additionalCommandsSet: Set<string> | undefined;\n if (options.includeAdditional) {\n additionalCommandsSet = new Set(options.includeAdditional.split(',').map((cmd) => cmd.trim()));\n this.logger.debug(`[MCP-DEBUG] Including additional commands: ${Array.from(additionalCommandsSet).join(', ')}`);\n }\n\n const server = new McpServer({\n name: 'bit-cli-mcp',\n version: '0.0.1',\n });\n\n // Set of tools for consumer projects (non-Bit workspaces)\n const consumerProjectTools = new Set<string>();\n\n const consumerProject = Boolean(options.consumerProject);\n\n // Store consumer project mode globally in the class\n this.isConsumerProjectMode = consumerProject;\n\n // Validate flags combination\n if (consumerProject) {\n this.logger.debug(\n `[MCP-DEBUG] Running MCP server in consumer project mode (for non-Bit workspaces) with tools: bit_remote_search, bit_remote_component_details`\n );\n if (options.includeAdditional) {\n this.logger.debug(\n `[MCP-DEBUG] Additional tools enabled in consumer project mode: ${options.includeAdditional}`\n );\n }\n }\n\n const filterOptions: CommandFilterOptions = {\n additionalCommandsSet,\n alwaysExcludeTools,\n consumerProject,\n consumerProjectTools,\n };\n\n commands.forEach((cmd) => {\n const cmdName = getCommandName(cmd);\n\n if (this.shouldIncludeCommand(cmdName, filterOptions)) {\n this.registerToolForCommand(server, cmd);\n }\n\n // Process sub-commands\n if (cmd.commands && cmd.commands.length) {\n this.processSubCommands(server, cmd, filterOptions);\n }\n });\n\n // Always register remote-search tool\n this.registerRemoteSearchTool(server);\n\n // In consumer project mode, only register bit_remote_search and bit_remote_component_details\n // All other tools should not be available in consumer project mode\n if (consumerProject) {\n // Register the new combined remote component details tool\n this.registerRemoteComponentDetailsTool(server);\n } else {\n // Register the bit_workspace_info tool\n this.registerWorkspaceInfoTool(server);\n\n // Register the bit_component_details tool\n this.registerComponentDetailsTool(server);\n\n // Register command discovery and help tools\n this.registerCommandsListTool(server);\n this.registerCommandHelpTool(server);\n\n this.registerQueryTool(server);\n this.registerExecuteTool(server);\n }\n\n await server.connect(new StdioServerTransport());\n }\n\n private shouldIncludeCommand(cmdName: string, options: CommandFilterOptions): boolean {\n // Always exclude certain commands\n if (options.alwaysExcludeTools.has(cmdName)) return false;\n\n // Consumer project mode: only include consumer project tools + any additional specified\n if (options.consumerProject) {\n const shouldInclude =\n options.consumerProjectTools.has(cmdName) || (options.additionalCommandsSet?.has(cmdName) ?? false);\n if (shouldInclude) {\n this.logger.debug(`[MCP-DEBUG] Including command in consumer project mode: ${cmdName}`);\n }\n return shouldInclude;\n }\n\n // Default mode: only include additional specified commands (no default tools anymore)\n return options.additionalCommandsSet?.has(cmdName) ?? false;\n }\n\n private buildZodSchema(config: CommandConfig): Record<string, any> {\n const schema: Record<string, any> = {\n // Add cwd parameter as mandatory to all commands\n cwd: z.string().describe('Path to workspace'),\n };\n\n config.argsData.forEach((arg) => {\n const desc = arg.description || `Positional argument: ${arg.nameRaw}`;\n if (arg.isArray) {\n schema[arg.nameCamelCase] = arg.required\n ? z.array(z.string()).describe(desc)\n : z.array(z.string()).optional().describe(desc);\n } else {\n schema[arg.nameCamelCase] = arg.required ? z.string().describe(desc) : z.string().optional().describe(desc);\n }\n });\n\n config.flagsData.forEach((flag) => {\n const type = flag.type;\n schema[flag.name] =\n type === 'string'\n ? z.string().optional().describe(flag.description)\n : z.boolean().optional().describe(flag.description);\n });\n\n return schema;\n }\n\n private buildCommandArgs(config: CommandConfig, params: any): string[] {\n // Split the command name on spaces to properly handle subcommands\n const args: string[] = config.name.split(' ');\n\n // Add positional arguments in order\n config.argsData.forEach((arg) => {\n const val = params[arg.nameCamelCase];\n if (val === undefined) return;\n\n if (arg.isArray && Array.isArray(val)) {\n val.forEach((item) => args.push(item));\n } else {\n args.push(val);\n }\n });\n\n // Add options as flags\n config.flagsData.forEach((flag) => {\n const name = flag.name;\n const type = flag.type;\n const val = params[name];\n if (val === undefined) return;\n if (type === 'boolean' && val) {\n args.push(`--${name}`);\n } else if (type === 'string' && val) {\n // Check if the string value contains spaces and quote it if necessary\n const stringValue = String(val);\n if (stringValue.includes(' ')) {\n args.push(`--${name}`, `\"${stringValue}\"`);\n } else {\n args.push(`--${name}`, stringValue);\n }\n }\n });\n\n return args;\n }\n\n private getToolName(name: string): string {\n // replace white spaces (\\s) and dashes (-) with underscores (_)\n return `bit_${name}`.replace(/[-\\s]/g, '_');\n }\n\n private registerToolForCommand(server: McpServer, cmd: Command, parentCmd?: Command) {\n const cmdName = parentCmd ? `${getCommandName(parentCmd)} ${getCommandName(cmd)}` : getCommandName(cmd);\n const toolName = this.getToolName(cmdName);\n\n // Modify description for show and schema commands in consumer project mode\n let description = `${cmd.description}${cmd.extendedDescription ? `.\\n(${cmd.extendedDescription})` : ''}`;\n if (this.isConsumerProjectMode && (cmdName === 'show' || cmdName === 'schema')) {\n description += `\\n(In consumer project mode, --remote flag is automatically added)`;\n }\n\n const config: CommandConfig = {\n name: cmdName,\n description,\n argsData: getArgsData(cmd),\n flagsData: getFlagsData(cmd),\n };\n\n const schema = this.buildZodSchema(config);\n\n server.tool(toolName, config.description, schema, async (params: any) => {\n const argsToRun = this.buildCommandArgs(config, params);\n\n // Special handling for consumer projects - auto-add --remote flag for show and schema commands\n if (this.isConsumerProjectMode && (cmdName === 'show' || cmdName === 'schema')) {\n if (!argsToRun.includes('--remote')) {\n this.logger.debug(`[MCP-DEBUG] Auto-adding --remote flag for ${cmdName} in consumer project mode`);\n argsToRun.push('--remote');\n }\n if (cmdName === 'show' && !argsToRun.includes('--legacy')) {\n this.logger.debug(`[MCP-DEBUG] Auto-adding --legacy flag for ${cmdName} in consumer project mode`);\n argsToRun.push('--legacy');\n }\n }\n\n return this.runBit(argsToRun, params.cwd);\n });\n }\n\n /**\n * Read and parse workspace.jsonc file from a given directory\n */\n private async readWorkspaceJsonc(workspaceDir: string): Promise<any> {\n try {\n const workspaceJsoncPath = path.join(workspaceDir, 'workspace.jsonc');\n const fileExists = await fs.pathExists(workspaceJsoncPath);\n if (!fileExists) {\n this.logger.debug(`[MCP-DEBUG] workspace.jsonc not found at ${workspaceJsoncPath}`);\n return null;\n }\n\n const content = await fs.readFile(workspaceJsoncPath, 'utf-8');\n return parse(content);\n } catch (error) {\n this.logger.debug(`[MCP-DEBUG] Failed to read workspace.jsonc: ${error}`);\n return null;\n }\n }\n\n /**\n * Extract owner from defaultScope in workspace.jsonc\n * If defaultScope contains a dot, split by dot and take the first part\n */\n private extractOwnerFromWorkspace(workspaceConfig: any): string | null {\n try {\n const workspaceSection = workspaceConfig?.['teambit.workspace/workspace'];\n const defaultScope = workspaceSection?.defaultScope;\n\n if (!defaultScope || typeof defaultScope !== 'string') {\n return null;\n }\n\n // If defaultScope contains a dot, split by dot and take the first part (owner)\n if (defaultScope.includes('.')) {\n const parts = defaultScope.split('.');\n return parts[0];\n }\n\n // If no dot, the entire defaultScope is treated as the owner\n return defaultScope;\n } catch (error) {\n this.logger.debug(`[MCP-DEBUG] Failed to extract owner from workspace config: ${error}`);\n return null;\n }\n }\n\n private registerRemoteSearchTool(server: McpServer) {\n const toolName = 'bit_remote_search';\n const description = `Search for components in remote scopes. Use this tool to find existing components before creating new ones. Essential for component reuse and discovery`;\n const schema: Record<string, any> = {\n queryStr: z\n .string()\n .describe(\n `Search query string - Don't try to search with too many keywords. It will try to find components that match all keywords, which is often too restrictive. Instead, search with a single keyword or a few broad keywords`\n ),\n cwd: z.string().optional().describe('Path to workspace directory'),\n owners: z\n .array(z.string())\n .optional()\n .describe(\n 'Filter results by specific owners or organizations. AVOID using this parameter - let the system automatically extract the owner from workspace.jsonc defaultScope for better relevance. Only use when you need to override the automatic behavior or search across different owners'\n ),\n skipAutoOwner: z\n .boolean()\n .optional()\n .describe(\n 'Set to true to disable automatic owner extraction from workspace.jsonc. When false or omitted, the system will try to automatically extract owner from workspace defaultScope'\n ),\n };\n server.tool(toolName, description, schema, async (params: any) => {\n const http = await this.getHttp();\n\n // Determine the owners to use for the search\n let ownersToUse = params.owners && params.owners.length > 0 ? params.owners : undefined;\n\n // If owners not explicitly provided and skipAutoOwner is not true, try to extract from workspace.jsonc\n if (!ownersToUse && !params.skipAutoOwner) {\n try {\n // Use provided cwd parameter or fall back to current working directory\n const workspaceDir = params.cwd || process.cwd();\n this.logger.debug(`[MCP-DEBUG] Attempting to auto-extract owner from workspace.jsonc in: ${workspaceDir}`);\n const workspaceConfig = await this.readWorkspaceJsonc(workspaceDir);\n if (workspaceConfig) {\n const extractedOwner = this.extractOwnerFromWorkspace(workspaceConfig);\n if (extractedOwner) {\n ownersToUse = [extractedOwner];\n this.logger.debug(`[MCP-DEBUG] Auto-extracted owner from workspace.jsonc: ${extractedOwner}`);\n }\n }\n } catch (error) {\n this.logger.debug(`[MCP-DEBUG] Failed to auto-extract owner: ${error}`);\n // Continue without auto-extracted owner\n }\n } else {\n this.logger.debug(\n `[MCP-DEBUG] Using provided owners for search: ${ownersToUse ? ownersToUse.join(', ') : 'none'}`\n );\n }\n\n const results = await http.search(params.queryStr, ownersToUse);\n this.logger.debug(`[MCP-DEBUG] Search results: ${JSON.stringify(results)}`);\n if (!results?.components || results.components.length === 0) {\n return { content: [{ type: 'text', text: 'No results found' }] };\n }\n const formattedResults = {\n type: 'text',\n text: results.components.join('\\n'),\n };\n return { content: [formattedResults] } as CallToolResult;\n });\n }\n\n private registerRemoteComponentDetailsTool(server: McpServer) {\n const toolName = 'bit_remote_component_details';\n const description =\n 'Get detailed information about a remote component including basic info and its public API schema. Combines the functionality of show and schema commands for remote components.';\n const schema: Record<string, any> = {\n cwd: z.string().describe('Path to workspace directory'),\n componentName: z.string().describe('Component name or component ID to get details for'),\n includeSchema: z.boolean().optional().describe('Include component public API schema (default: true)'),\n };\n\n server.tool(toolName, description, schema, async (params: any) => {\n try {\n const { componentName, includeSchema = true, cwd } = params;\n\n // Get basic component information using show command via direct execution\n const showArgs = ['show', componentName, '--remote', '--legacy'];\n const showResult = await this.runBit(showArgs, cwd);\n\n const result: any = {\n componentInfo: showResult.content[0].text,\n };\n\n // Get schema information if requested\n if (includeSchema) {\n try {\n const schemaArgs = ['schema', componentName, '--remote'];\n const schemaResult = await this.runBit(schemaArgs, cwd);\n result.schema = schemaResult.content[0].text;\n } catch (schemaError) {\n this.logger.warn(\n `[MCP-DEBUG] Failed to get schema for ${componentName}: ${(schemaError as Error).message}`\n );\n result.schemaError = `Failed to retrieve schema: ${(schemaError as Error).message}`;\n }\n }\n\n return this.formatAsCallToolResult(result);\n } catch (error) {\n this.logger.error(`[MCP-DEBUG] Error in bit_remote_component_details tool: ${(error as Error).message}`);\n return this.formatErrorAsCallToolResult(error as Error, 'getting remote component details');\n }\n });\n }\n\n private registerWorkspaceInfoTool(server: McpServer) {\n const toolName = 'bit_workspace_info';\n const description =\n 'Get comprehensive workspace information including status, components list, apps, templates, dependency graph, and workspace dependencies';\n const schema: Record<string, any> = {\n cwd: z.string().describe('Path to workspace directory'),\n includeTemplates: z.boolean().optional().describe('Include templates list (default: false)'),\n includeApps: z.boolean().optional().describe('Include apps list (default: false)'),\n includeGraph: z.boolean().optional().describe('Include dependency graph (default: false)'),\n json: z\n .boolean()\n .optional()\n .describe(\n 'Return output in JSON format - WARNING: This produces verbose output and should be used when structured data is specifically needed (default: false)'\n ),\n };\n\n server.tool(toolName, description, schema, async (params: any) => {\n try {\n const includeTemplates = params.includeTemplates === true; // default: false\n const includeApps = params.includeApps === true;\n const includeGraph = params.includeGraph === true;\n const useJson = params.json === true;\n\n const workspaceInfo: any = {};\n const flags = useJson ? { json: true } : {};\n\n const statusExecution = await this.safeBitCommandExecution(\n 'status',\n [],\n flags,\n params.cwd,\n 'get workspace status',\n true\n );\n workspaceInfo.status = statusExecution.result;\n\n const listExecution = await this.safeBitCommandExecution(\n 'list',\n [],\n flags,\n params.cwd,\n 'get components list',\n true\n );\n workspaceInfo.list = listExecution.result;\n\n // Get apps list if requested\n if (includeApps) {\n const appsExecution = await this.safeBitCommandExecution(\n 'app',\n ['list'],\n flags,\n params.cwd,\n 'get apps list',\n true\n );\n workspaceInfo.apps = appsExecution.result;\n }\n\n // Get templates list if requested\n if (includeTemplates) {\n const templatesExecution = await this.safeBitCommandExecution(\n 'templates',\n [],\n flags,\n params.cwd,\n 'get templates list',\n true\n );\n workspaceInfo.templates = templatesExecution.result;\n }\n\n // Get dependency graph if requested\n if (includeGraph) {\n const graphExecution = await this.safeBitCommandExecution(\n 'graph',\n [],\n { json: true },\n params.cwd,\n 'get dependency graph',\n true\n );\n workspaceInfo.graph = graphExecution.result;\n }\n\n // Get workspace dependencies if requested\n try {\n const workspaceDependencies = await this.callBitServerIDEAPI('getWorkspaceDependencies', [], params.cwd);\n workspaceInfo.workspaceDependencies = workspaceDependencies;\n } catch (error) {\n this.logger.error(`[MCP-DEBUG] Error getting workspace dependencies: ${(error as Error).message}`);\n workspaceInfo.workspaceDependencies = {\n error: `Failed to get workspace dependencies: ${(error as Error).message}`,\n };\n }\n\n // Get current lane name with scope\n try {\n const laneId = await this.callBitServerIDEAPI('getCurrentLaneName', [true], params.cwd);\n workspaceInfo.laneId = laneId;\n } catch (error) {\n this.logger.error(`[MCP-DEBUG] Error getting current lane name: ${(error as Error).message}`);\n workspaceInfo.laneId = {\n error: `Failed to get current lane name: ${(error as Error).message}`,\n };\n }\n\n return this.formatAsCallToolResult(workspaceInfo);\n } catch (error) {\n this.logger.error(`[MCP-DEBUG] Error in bit_workspace_info tool: ${(error as Error).message}`);\n return this.formatErrorAsCallToolResult(error as Error, 'getting workspace info');\n }\n });\n }\n\n private registerComponentDetailsTool(server: McpServer) {\n const toolName = 'bit_component_details';\n const description =\n 'Get detailed information about a specific component including basic info and optionally its public API schema';\n const schema: Record<string, any> = {\n cwd: z.string().describe('Path to workspace directory'),\n componentName: z.string().describe('Component name or component ID to get details for'),\n includeSchema: z.boolean().optional().describe('Include component public API schema (default: false)'),\n };\n\n server.tool(toolName, description, schema, async (params: any) => {\n try {\n const includeSchema = params.includeSchema === true;\n const componentName = params.componentName;\n\n // Get component details using IDE API with includeSchema parameter\n const ideApiResult = await this.callBitServerIDEAPI(\n 'getCompDetails',\n [componentName, includeSchema],\n params.cwd\n );\n\n return this.formatAsCallToolResult(ideApiResult);\n } catch (error) {\n this.logger.error(`[MCP-DEBUG] Error in bit_component_details tool: ${(error as Error).message}`);\n return this.formatErrorAsCallToolResult(error as Error, 'getting component details');\n }\n });\n }\n\n private registerCommandsListTool(server: McpServer) {\n const toolName = 'bit_commands_list';\n const description =\n 'Get all available Bit commands with descriptions and groups. Use this to discover what commands are available.';\n const schema: Record<string, any> = {\n extendedDescription: z\n .boolean()\n .optional()\n .describe('Include extended descriptions for commands (default: false)'),\n internal: z.boolean().optional().describe('Include internal/debug commands (default: false)'),\n };\n\n server.tool(toolName, description, schema, async (params: any) => {\n try {\n const { extendedDescription = false, internal = false } = params;\n const commandsInfo: any[] = [];\n\n const shouldSkipCommand = (cmd: Command): boolean => {\n return Boolean((cmd.private && !internal) || cmd.description.startsWith('DEPRECATED'));\n };\n\n // Build list of all commands\n this.cli.commands.forEach((cmd) => {\n if (shouldSkipCommand(cmd)) return;\n\n const mainCmdName = getCommandName(cmd);\n const groupKey = cmd.group;\n\n const commandInfo: any = {\n name: mainCmdName,\n description: cmd.description || '',\n };\n\n if (extendedDescription && cmd.extendedDescription) {\n commandInfo.extendedDescription = cmd.extendedDescription;\n }\n if (groupKey) commandInfo.group = this.cli.groups[groupKey] || groupKey;\n\n // Add subcommands summary\n if (cmd.commands && cmd.commands.length > 0) {\n commandInfo.subcommands = cmd.commands\n .filter((subCmd) => !shouldSkipCommand(subCmd))\n .map((subCmd) => ({\n name: getCommandName(subCmd),\n description: subCmd.description || '',\n }));\n }\n\n commandsInfo.push(commandInfo);\n });\n\n commandsInfo.sort((a, b) => a.name.localeCompare(b.name));\n\n const result = JSON.stringify({ total: commandsInfo.length, commands: commandsInfo }, null, 2);\n this.logger.debug(`[MCP-DEBUG] Successfully retrieved commands list. Total: ${commandsInfo.length}`);\n return this.formatAsCallToolResult(result);\n } catch (error) {\n this.logger.error(`[MCP-DEBUG] Error in bit_commands_list tool: ${(error as Error).message}`);\n return this.formatErrorAsCallToolResult(error as Error, 'getting commands list');\n }\n });\n }\n\n private registerCommandHelpTool(server: McpServer) {\n const toolName = 'bit_command_help';\n const description =\n 'Get detailed help for a specific Bit command including syntax, arguments, flags, and usage examples. Use this to understand exactly how to use a command.';\n const schema: Record<string, any> = {\n command: z.string().describe('The command name to get help for (e.g., \"status\", \"install\", \"create\")'),\n subcommand: z\n .string()\n .optional()\n .describe('Optional subcommand name (e.g., for \"lane show\", use command=\"lane\" and subcommand=\"show\")'),\n };\n\n server.tool(toolName, description, schema, async (params: any) => {\n try {\n const { command: requestedCommand, subcommand: requestedSubcommand } = params;\n let commandInfo: any = null;\n\n const buildDetailedCommandInfo = (cmd: Command, parentName?: string) => {\n const cmdName = parentName ? `${parentName} ${getCommandName(cmd)}` : getCommandName(cmd);\n\n const info: any = {\n name: cmdName,\n description: cmd.description || '',\n extendedDescription: cmd.extendedDescription || '',\n group: cmd.group ? this.cli.groups[cmd.group] || cmd.group : '',\n };\n\n // Add arguments information\n const argsData = getArgsData(cmd);\n if (argsData.length > 0) {\n info.arguments = argsData.map((arg) => ({\n name: arg.nameRaw,\n description: arg.description || '',\n required: arg.required,\n isArray: arg.isArray,\n }));\n }\n\n // Add options/flags information\n info.options = getFlagsData(cmd);\n\n // Add examples if available\n if (cmd.examples) {\n info.examples = cmd.examples;\n }\n\n // Add subcommands if available (including private ones for help purposes)\n if (cmd.commands && cmd.commands.length > 0) {\n info.subcommands = cmd.commands.map((subCmd) => ({\n name: getCommandName(subCmd),\n description: subCmd.description || '',\n }));\n }\n\n return info;\n };\n\n // Search for the requested command\n this.cli.commands.forEach((cmd) => {\n const mainCmdName = getCommandName(cmd);\n\n if (requestedSubcommand) {\n // Looking for a subcommand\n if (mainCmdName === requestedCommand && cmd.commands) {\n const subCmd = cmd.commands.find((sub) => getCommandName(sub) === requestedSubcommand);\n if (subCmd) {\n commandInfo = buildDetailedCommandInfo(subCmd, requestedCommand);\n }\n }\n } else {\n // Looking for a main command\n if (mainCmdName === requestedCommand) {\n commandInfo = buildDetailedCommandInfo(cmd);\n }\n }\n });\n\n if (!commandInfo) {\n const commandFullName = requestedSubcommand ? `${requestedCommand} ${requestedSubcommand}` : requestedCommand;\n return this.formatAsCallToolResult(`Command not found: ${commandFullName}`);\n }\n\n const result = JSON.stringify(commandInfo, null, 2);\n this.logger.debug(`[MCP-DEBUG] Successfully retrieved command help for: ${commandInfo.name}`);\n return this.formatAsCallToolResult(result);\n } catch (error) {\n this.logger.error(`[MCP-DEBUG] Error in bit_command_help tool: ${(error as Error).message}`);\n return this.formatErrorAsCallToolResult(error as Error, 'getting command help');\n }\n });\n }\n\n private registerQueryTool(server: McpServer) {\n const toolName = 'bit_query';\n const description =\n 'Execute read-only Bit commands that safely inspect workspace and component state without making modifications. Only whitelisted query commands are allowed for safety.';\n const schema: Record<string, any> = {\n cwd: z.string().describe('Path to workspace directory'),\n command: z.string().describe('The Bit command to execute (e.g., \"status\", \"show\", \"list\")'),\n args: z.array(z.string()).optional().describe('Arguments to pass to the command'),\n flags: z\n .record(z.union([z.string(), z.boolean()]))\n .optional()\n .describe('Flags to pass to the command as key-value pairs'),\n };\n\n server.tool(toolName, description, schema, async (params: any) => {\n try {\n const { command, args = [], flags = {}, cwd } = params;\n\n // Check if command is in the read-only whitelist\n // Support both single commands and subcommands (e.g., \"lane show\")\n const fullCommand = args.length > 0 ? `${command} ${args[0]}` : command;\n const isAllowed = this.readOnlyCommands.has(command) || this.readOnlyCommands.has(fullCommand);\n\n if (!isAllowed) {\n const allowedCommands = Array.from(this.readOnlyCommands).sort().join(', ');\n return this.formatAsCallToolResult(\n `Error: Command \"${command}\" is not allowed in query mode. Allowed read-only commands: ${allowedCommands}`\n );\n }\n\n // Build command arguments\n const commandArgs = [command, ...args];\n\n // Add flags to arguments\n Object.entries(flags).forEach(([key, value]) => {\n if (typeof value === 'boolean' && value) {\n commandArgs.push(`--${key}`);\n } else if (typeof value === 'string' && value) {\n commandArgs.push(`--${key}`);\n commandArgs.push(value);\n }\n });\n\n this.logger.debug(`[MCP-DEBUG] Executing query command: ${command} with args: ${JSON.stringify(commandArgs)}`);\n\n const execution = await this.safeBitCommandExecution(\n command,\n args,\n flags,\n cwd,\n `execute query command ${command}`\n );\n\n return this.formatAsCallToolResult(execution.result);\n } catch (error) {\n this.logger.error(`[MCP-DEBUG] Error in bit_query tool: ${(error as Error).message}`);\n return this.formatErrorAsCallToolResult(error as Error, 'executing query command');\n }\n });\n }\n\n private registerExecuteTool(server: McpServer) {\n const toolName = 'bit_execute';\n const description = 'Execute Bit commands that make changes to workspace or components (not read-only).';\n const schema: Record<string, any> = {\n cwd: z.string().describe('Path to workspace directory'),\n command: z.string().describe('The Bit command to execute (e.g., \"import\", \"tag\", \"export\", \"remove\")'),\n args: z.array(z.string()).optional().describe('Arguments to pass to the command'),\n flags: z\n .record(z.union([z.string(), z.boolean()]))\n .optional()\n .describe('Flags to pass to the command as key-value pairs'),\n };\n\n server.tool(toolName, description, schema, async (params: any) => {\n try {\n let { command, args = [] } = params;\n const { flags = {}, cwd } = params;\n\n // Handle sub-commands: if command has multiple words, move the second word to args\n const commandParts = command.trim().split(/\\s+/);\n if (commandParts.length > 1) {\n command = commandParts[0];\n args = [commandParts[1], ...args];\n }\n\n this.logger.debug(\n `[MCP-DEBUG] Executing command: ${command} with args: ${JSON.stringify(args)} and flags: ${JSON.stringify(flags)}`\n );\n\n const execution = await this.safeBitCommandExecution(command, args, flags, cwd, `execute command ${command}`);\n\n return this.formatAsCallToolResult(execution.result);\n } catch (error) {\n this.logger.error(`[MCP-DEBUG] Error in bit_execute tool: ${(error as Error).message}`);\n return this.formatErrorAsCallToolResult(error as Error, 'executing command');\n }\n });\n }\n\n private processSubCommands(server: McpServer, parentCmd: Command, options: CommandFilterOptions) {\n const parentCmdName = getCommandName(parentCmd);\n\n parentCmd.commands?.forEach((subCmd) => {\n const subCmdName = getCommandName(subCmd);\n const fullCmdName = `${parentCmdName} ${subCmdName}`;\n\n if (this.shouldIncludeCommand(fullCmdName, options)) {\n this.registerToolForCommand(server, subCmd, parentCmd);\n }\n });\n }\n\n private async runBit(args: string[], cwd: string): Promise<CallToolResult> {\n this.logger.debug(`[MCP-DEBUG] Running: ${this.bitBin} ${args.join(' ')} in ${cwd}`);\n try {\n const result = childProcess.spawnSync(this.bitBin, args, {\n cwd,\n env: { ...process.env, BIT_DISABLE_SPINNER: '1' },\n encoding: 'utf8',\n });\n\n if (result.error) {\n throw result.error;\n }\n\n if (result.status !== 0) {\n const errorMessage = result.stderr || `Command failed with status ${result.status}`;\n throw new Error(errorMessage);\n }\n\n this.logger.debug(`[MCP-DEBUG] result. stdout: ${result.stdout}`);\n return { content: [{ type: 'text', text: result.stdout }] };\n } catch (error: any) {\n this.logger.error(`[MCP-DEBUG] Error executing ${this.bitBin} ${args.join(' ')}`, error);\n return { content: [{ type: 'text', text: error.message }] };\n }\n }\n\n /**\n * Helper method to execute a bit-server API call with standardized error handling\n */\n private async executeBitServerCommand(\n command: string,\n args: string[] = [],\n flags: Record<string, any> = {},\n cwd: string,\n operationName: string\n ): Promise<any> {\n try {\n const result = await this.callBitServerAPI(command, args, flags, cwd);\n this.logger.debug(`[MCP-DEBUG] Successfully executed ${operationName} via bit-server`);\n return result;\n } catch (error) {\n this.logger.warn(`[MCP-DEBUG] Failed to execute ${operationName} via bit-server: ${(error as Error).message}`);\n throw error;\n }\n }\n\n /**\n * Helper method to format any result as CallToolResult\n */\n private formatAsCallToolResult(result: any): CallToolResult {\n if (typeof result === 'string') {\n return { content: [{ type: 'text', text: result }] } as CallToolResult;\n } else if (typeof result === 'object') {\n return { content: [{ type: 'text', text: JSON.stringify(result, null, 2) }] } as CallToolResult;\n } else {\n return { content: [{ type: 'text', text: String(result) }] } as CallToolResult;\n }\n }\n\n /**\n * Helper method to format error as CallToolResult\n */\n private formatErrorAsCallToolResult(error: Error, operation: string): CallToolResult {\n return {\n content: [\n {\n type: 'text',\n text: `Error ${operation}: ${error.message}`,\n },\n ],\n } as CallToolResult;\n }\n\n /**\n * Helper method to safely execute a bit command with error handling\n */\n private async safeBitCommandExecution(\n command: string,\n args: string[] = [],\n flags: Record<string, any> = {},\n cwd: string,\n operationName: string,\n includeErrorInResult = false\n ): Promise<{ success: boolean; result: any; error?: string }> {\n try {\n let result = await this.executeBitServerCommand(command, args, flags, cwd, operationName);\n\n // Unwrap the result from data wrapper if it exists and we have a successful result\n if (result && typeof result === 'object' && 'data' in result && result.data !== undefined) {\n result = result.data;\n }\n\n // Clean up output by removing ANSI color codes when not using JSON format\n const useJson = flags && flags.json === true;\n if (!useJson && typeof result === 'string') {\n result = stripAnsi(result);\n }\n\n return { success: true, result };\n } catch (error) {\n if (includeErrorInResult) {\n return {\n success: false,\n result: { error: `Failed to ${operationName}: ${(error as Error).message}` },\n error: (error as Error).message,\n };\n } else {\n throw error;\n }\n }\n }\n private validateBitBin(bitBin: string): string {\n const trimmed = bitBin?.trim();\n // Check for shell metacharacters and spaces. Protect against command injection.\n if (!trimmed || /[;&|`$(){}[\\]<>'\"\\\\]/.test(trimmed) || /\\s/.test(trimmed)) throw new Error('Invalid bitBin');\n return trimmed;\n }\n\n // Setup command business logic methods\n getEditorDisplayName(editor: string): string {\n return McpSetupUtils.getEditorDisplayName(editor);\n }\n\n /**\n * Get the path to the editor config file based on editor type and scope\n */\n getEditorConfigPath(editor: string, isGlobal: boolean, workspaceDir?: string): string {\n const editorLower = editor.toLowerCase();\n\n if (editorLower === 'vscode') {\n // For VS Code, return appropriate config path based on global vs workspace scope\n return isGlobal\n ? McpSetupUtils.getVSCodeSettingsPath(isGlobal, workspaceDir)\n : McpSetupUtils.getVSCodeMcpConfigPath(workspaceDir);\n } else if (editorLower === 'cursor') {\n return McpSetupUtils.getCursorSettingsPath(isGlobal, workspaceDir);\n } else if (editorLower === 'windsurf') {\n return McpSetupUtils.getWindsurfSettingsPath(isGlobal, workspaceDir);\n } else if (editorLower === 'roo') {\n return McpSetupUtils.getRooCodeSettingsPath(isGlobal, workspaceDir);\n } else if (editorLower === 'cline') {\n return McpSetupUtils.getClinePromptsPath(isGlobal, workspaceDir);\n }\n\n throw new Error(`Editor \"${editor}\" is not supported yet.`);\n }\n\n async setupEditor(editor: string, options: SetupOptions, workspaceDir?: string): Promise<void> {\n const supportedEditors = ['vscode', 'cursor', 'windsurf', 'roo', 'cline'];\n const editorLower = editor.toLowerCase();\n\n if (!supportedEditors.includes(editorLower)) {\n throw new Error(`Editor \"${editor}\" is not supported yet. Currently supported: ${supportedEditors.join(', ')}`);\n }\n\n // Add workspaceDir to options if provided\n const setupOptions: SetupOptions = { ...options };\n if (workspaceDir) {\n setupOptions.workspaceDir = workspaceDir;\n }\n\n if (editorLower === 'vscode') {\n await McpSetupUtils.setupVSCode(setupOptions);\n } else if (editorLower === 'cursor') {\n await McpSetupUtils.setupCursor(setupOptions);\n } else if (editorLower === 'windsurf') {\n await McpSetupUtils.setupWindsurf(setupOptions);\n } else if (editorLower === 'roo') {\n await McpSetupUtils.setupRooCode(setupOptions);\n } else if (editorLower === 'cline') {\n // Cline doesn't need MCP server setup, only rules files\n // This is a no-op but we include it for consistency\n // Users should use the 'rules' command to set up Cline instructions\n }\n }\n\n async writeRulesFile(editor: string, options: RulesOptions, workspaceDir?: string): Promise<void> {\n const supportedEditors = ['vscode', 'cursor', 'roo', 'cline'];\n const editorLower = editor.toLowerCase();\n\n if (!supportedEditors.includes(editorLower)) {\n throw new Error(`Editor \"${editor}\" is not supported yet. Currently supported: ${supportedEditors.join(', ')}`);\n }\n\n // Add workspaceDir to options if provided\n const rulesOptions: RulesOptions = { ...options };\n if (workspaceDir) {\n rulesOptions.workspaceDir = workspaceDir;\n }\n\n if (editorLower === 'vscode') {\n await McpSetupUtils.writeVSCodeRules(rulesOptions);\n } else if (editorLower === 'cursor') {\n await McpSetupUtils.writeCursorRules(rulesOptions);\n } else if (editorLower === 'roo') {\n await McpSetupUtils.writeRooCodeRules(rulesOptions);\n } else if (editorLower === 'cline') {\n await McpSetupUtils.writeClineRules(rulesOptions);\n }\n }\n\n async getRulesContent(consumerProject: boolean = false): Promise<string> {\n return McpSetupUtils.getDefaultRulesContent(consumerProject);\n }\n\n static slots = [];\n static dependencies = [CLIAspect, LoggerAspect];\n static runtime = MainRuntime;\n static async provider([cli, loggerMain]: [CLIMain, LoggerMain]) {\n const logger = loggerMain.createLogger(CliMcpServerAspect.id);\n const mcpServer = new CliMcpServerMain(cli, logger);\n const mcpServerCmd = new McpServerCmd(mcpServer);\n mcpServerCmd.commands = [new McpStartCmd(mcpServer), new McpSetupCmd(mcpServer), new McpRulesCmd(mcpServer)];\n cli.register(mcpServerCmd);\n return mcpServer;\n }\n}\n\nCliMcpServerAspect.addRuntime(CliMcpServerMain);\n\nexport default CliMcpServerMain;\n"],"mappings":";;;;;;AAGA,SAAAA,KAAA;EAAA,MAAAC,IAAA,GAAAC,OAAA;EAAAF,IAAA,YAAAA,CAAA;IAAA,OAAAC,IAAA;EAAA;EAAA,OAAAA,IAAA;AAAA;AACA,SAAAE,eAAA;EAAA,MAAAF,IAAA,GAAAG,sBAAA,CAAAF,OAAA;EAAAC,cAAA,YAAAA,CAAA;IAAA,OAAAF,IAAA;EAAA;EAAA,OAAAA,IAAA;AAAA;AACA,SAAAI,WAAA;EAAA,MAAAJ,IAAA,GAAAG,sBAAA,CAAAF,OAAA;EAAAG,UAAA,YAAAA,CAAA;IAAA,OAAAJ,IAAA;EAAA;EAAA,OAAAA,IAAA;AAAA;AACA,SAAAK,SAAA;EAAA,MAAAL,IAAA,GAAAG,sBAAA,CAAAF,OAAA;EAAAI,QAAA,YAAAA,CAAA;IAAA,OAAAL,IAAA;EAAA;EAAA,OAAAA,IAAA;AAAA;AACA,SAAAM,aAAA;EAAA,MAAAN,IAAA,GAAAC,OAAA;EAAAK,YAAA,YAAAA,CAAA;IAAA,OAAAN,IAAA;EAAA;EAAA,OAAAA,IAAA;AAAA;AACA,SAAAO,MAAA;EAAA,MAAAP,IAAA,GAAAG,sBAAA,CAAAF,OAAA;EAAAM,KAAA,YAAAA,CAAA;IAAA,OAAAP,IAAA;EAAA;EAAA,OAAAA,IAAA;AAAA;AACA,SAAAQ,cAAA;EAAA,MAAAR,IAAA,GAAAC,OAAA;EAAAO,aAAA,YAAAA,CAAA;IAAA,OAAAR,IAAA;EAAA;EAAA,OAAAA,IAAA;AAAA;AACA,SAAAS,WAAA;EAAA,MAAAT,IAAA,GAAAC,OAAA;EAAAQ,UAAA,YAAAA,CAAA;IAAA,OAAAT,IAA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yB,sBAAsB,CAACxL,eAAe,CAAC;EAC9D;EAKA,aAAayL,QAAQA,CAAC,CAACvS,GAAG,EAAEwS,UAAU,CAAwB,EAAE;IAC9D,MAAMvS,MAAM,GAAGuS,UAAU,CAACC,YAAY,CAACC,kCAAkB,CAACC,EAAE,CAAC;IAC7D,MAAMC,SAAS,GAAG,IAAI9S,gBAAgB,CAACE,GAAG,EAAEC,MAAM,CAAC;IACnD,MAAM4S,YAAY,GAAG,KAAIC,yBAAY,EAACF,SAAS,CAAC;IAChDC,YAAY,CAAC9M,QAAQ,GAAG,CAAC,KAAIgN,wBAAW,EAACH,SAAS,CAAC,EAAE,KAAII,uBAAW,EAACJ,SAAS,CAAC,EAAE,KAAIK,uBAAW,EAACL,SAAS,CAAC,CAAC;IAC5G5S,GAAG,CAACkT,QAAQ,CAACL,YAAY,CAAC;IAC1B,OAAOD,SAAS;EAClB;AACF;AAACO,OAAA,CAAArT,gBAAA,GAAAA,gBAAA;AAAAhB,eAAA,CAryCYgB,gBAAgB,WA0xCZ,EAAE;AAAAhB,eAAA,CA1xCNgB,gBAAgB,kBA2xCL,CAACsT,gBAAS,EAAEC,sBAAY,CAAC;AAAAvU,eAAA,CA3xCpCgB,gBAAgB,aA4xCVwT,kBAAW;AAW9BZ,kCAAkB,CAACa,UAAU,CAACzT,gBAAgB,CAAC;AAAC,IAAA0T,QAAA,GAAAL,OAAA,CAAAtV,OAAA,GAEjCiC,gBAAgB","ignoreList":[]}
|
|
1
|
+
{"version":3,"names":["_cli","data","require","_child_process","_interopRequireDefault","_stripAnsi","_fsExtra","_commentJson","_path","_cliMcpServer","_mcpServer","_mcp","_stdio","_zod","_logger","_scope","_legacy","_nodeFetch","_setupCmd","_rulesCmd","_setupUtils","e","__esModule","default","ownKeys","r","t","Object","keys","getOwnPropertySymbols","o","filter","getOwnPropertyDescriptor","enumerable","push","apply","_objectSpread","arguments","length","forEach","_defineProperty","getOwnPropertyDescriptors","defineProperties","defineProperty","_toPropertyKey","value","configurable","writable","i","_toPrimitive","Symbol","toPrimitive","call","TypeError","String","Number","CliMcpServerMain","constructor","cli","logger","Set","bitBin","validateBitBin","getHttp","_http","Http","connect","SYMPHONY_GRAPHQL","CENTRAL_BIT_HUB_NAME","getBitServerPort","cwd","skipValidatePortFlag","args","result","childProcess","spawnSync","env","process","BIT_CLI_SERVER","encoding","error","status","Error","stderr","existingPort","stdout","trim","undefined","parseInt","err","message","startBitServer","debug","Promise","resolve","reject","serverProcess","spawn","stdio","detached","serverStarted","outputBuffer","timeout","setTimeout","kill","on","output","toString","includes","clearTimeout","portMatch","match","port","serverPort","serverUrl","code","signal","killServerProcess","killed","exit","callBitServerAPI","command","flags","isReTrying","callBitServerAPIWithRoute","callBitServerIDEAPI","method","route","commandOrMethod","argsOrParams","isIDERoute","startedPort","realCwd","fs","realpathSync","body","url","commandArray","key","entries","pwd","response","fetch","headers","JSON","stringify","ok","errorMessage","statusText","errorJson","json","runMcpServer","options","commands","alwaysExcludeTools","additionalCommandsSet","includeAdditional","split","map","cmd","Array","from","join","server","McpServer","name","version","consumerProjectTools","consumerProject","Boolean","isConsumerProjectMode","filterOptions","cmdName","getCommandName","shouldIncludeCommand","registerToolForCommand","processSubCommands","registerRemoteSearchTool","registerRemoteComponentDetailsTool","registerWorkspaceInfoTool","registerComponentDetailsTool","registerCommandsListTool","registerCommandHelpTool","registerQueryTool","registerExecuteTool","StdioServerTransport","has","shouldInclude","buildZodSchema","config","schema","z","string","describe","argsData","arg","desc","description","nameRaw","isArray","nameCamelCase","required","array","optional","flagsData","flag","type","boolean","buildCommandArgs","params","val","item","stringValue","getToolName","replace","parentCmd","toolName","extendedDescription","getArgsData","getFlagsData","tool","argsToRun","runBit","readWorkspaceJsonc","workspaceDir","workspaceJsoncPath","path","fileExists","pathExists","content","readFile","parse","extractOwnerFromWorkspace","workspaceConfig","workspaceSection","defaultScope","parts","queryStr","owners","skipAutoOwner","http","ownersToUse","extractedOwner","results","search","components","text","formattedResults","componentName","includeSchema","showArgs","showResult","componentInfo","schemaArgs","schemaResult","schemaError","warn","formatAsCallToolResult","formatErrorAsCallToolResult","includeTemplates","includeApps","includeGraph","useJson","workspaceInfo","statusExecution","safeBitCommandExecution","listExecution","list","appsExecution","apps","templatesExecution","templates","graphExecution","graph","workspaceDependencies","laneId","ideApiResult","internal","commandsInfo","shouldSkipCommand","private","startsWith","mainCmdName","groupKey","group","commandInfo","groups","subcommands","subCmd","sort","a","b","localeCompare","total","subcommand","requestedCommand","requestedSubcommand","buildDetailedCommandInfo","parentName","info","examples","find","sub","commandFullName","record","union","fullCommand","isAllowed","readOnlyCommands","allowedCommands","commandArgs","execution","commandParts","parentCmdName","subCmdName","fullCmdName","BIT_DISABLE_SPINNER","executeBitServerCommand","operationName","operation","includeErrorInResult","stripAnsi","success","trimmed","test","getEditorDisplayName","editor","McpSetupUtils","getEditorConfigPath","isGlobal","editorLower","toLowerCase","getVSCodeSettingsPath","getVSCodeMcpConfigPath","getCursorSettingsPath","getWindsurfSettingsPath","getRooCodeSettingsPath","getClinePromptsPath","getClaudeCodeSettingsPath","setupEditor","supportedEditors","setupOptions","setupVSCode","setupCursor","setupWindsurf","setupRooCode","setupClaudeCode","writeRulesFile","rulesOptions","writeVSCodeRules","writeCursorRules","writeRooCodeRules","writeClineRules","writeClaudeCodeRules","getRulesContent","getDefaultRulesContent","provider","loggerMain","createLogger","CliMcpServerAspect","id","mcpServer","mcpServerCmd","McpServerCmd","McpStartCmd","McpSetupCmd","McpRulesCmd","register","exports","CLIAspect","LoggerAspect","MainRuntime","addRuntime","_default"],"sources":["cli-mcp-server.main.runtime.ts"],"sourcesContent":["/* eslint-disable import/extensions */\n/* eslint-disable import/no-unresolved */\n\nimport { CLIAspect, CLIMain, Command, getArgsData, getCommandName, getFlagsData, MainRuntime } from '@teambit/cli';\nimport childProcess from 'child_process';\nimport stripAnsi from 'strip-ansi';\nimport fs from 'fs-extra';\nimport { parse } from 'comment-json';\nimport path from 'path';\nimport { CliMcpServerAspect } from './cli-mcp-server.aspect';\nimport { McpServerCmd, McpStartCmd } from './mcp-server.cmd';\nimport { McpServer } from '@modelcontextprotocol/sdk/server/mcp.js';\nimport { StdioServerTransport } from '@modelcontextprotocol/sdk/server/stdio.js';\nimport { CallToolResult } from '@modelcontextprotocol/sdk/types.js';\nimport { z } from 'zod';\nimport { Logger, LoggerAspect, LoggerMain } from '@teambit/logger';\nimport { Http } from '@teambit/scope.network';\nimport { CENTRAL_BIT_HUB_NAME, SYMPHONY_GRAPHQL } from '@teambit/legacy.constants';\nimport fetch from 'node-fetch';\nimport { McpSetupCmd } from './setup-cmd';\nimport { McpRulesCmd } from './rules-cmd';\nimport { McpSetupUtils, SetupOptions, RulesOptions } from './setup-utils';\n\ninterface CommandFilterOptions {\n additionalCommandsSet?: Set<string>;\n alwaysExcludeTools: Set<string>;\n consumerProject: boolean;\n consumerProjectTools: Set<string>;\n}\n\ninterface CommandConfig {\n name: string;\n description: string;\n argsData: ReturnType<typeof getArgsData>;\n flagsData: ReturnType<typeof getFlagsData>;\n}\n\nexport class CliMcpServerMain {\n private bitBin = 'bit';\n private _http: Http;\n private isConsumerProjectMode: boolean = false;\n private serverPort?: number;\n private serverUrl?: string;\n private serverProcess: childProcess.ChildProcess | null = null;\n\n // Whitelist of commands that are considered read-only/query operations\n private readonly readOnlyCommands = new Set([\n 'status',\n 'list',\n 'info',\n 'show',\n 'schema',\n 'artifacts',\n 'diff',\n 'log',\n 'graph',\n 'deps get',\n 'deps blame',\n 'why',\n 'config get',\n 'envs list',\n 'envs get',\n 'remote list',\n 'templates',\n 'cat-component',\n 'cat-lane',\n 'cat-object',\n 'cat-scope',\n 'lane show',\n 'lane list',\n 'lane diff',\n 'lane history',\n 'lane history-diff',\n 'test',\n 'help',\n 'version',\n ]);\n\n constructor(\n private cli: CLIMain,\n private logger: Logger\n ) {\n // Validate the default bitBin on construction\n this.bitBin = this.validateBitBin(this.bitBin);\n }\n\n async getHttp(): Promise<Http> {\n if (!this._http) {\n this._http = await Http.connect(SYMPHONY_GRAPHQL, CENTRAL_BIT_HUB_NAME);\n }\n return this._http;\n }\n\n private async getBitServerPort(cwd: string, skipValidatePortFlag = false): Promise<number | undefined> {\n try {\n const args = ['cli-server-port'];\n if (skipValidatePortFlag) {\n args.push(String(skipValidatePortFlag));\n }\n\n const result = childProcess.spawnSync(this.bitBin, args, {\n cwd,\n env: { ...process.env, BIT_CLI_SERVER: 'true' },\n encoding: 'utf8',\n });\n\n if (result.error) {\n throw result.error;\n }\n\n if (result.status !== 0) {\n throw new Error(`Command failed with status ${result.status}: ${result.stderr}`);\n }\n\n const existingPort = result.stdout.trim();\n if (!existingPort) return undefined;\n return parseInt(existingPort, 10);\n } catch (err: any) {\n this.logger.error(`[MCP-DEBUG] error getting existing port from bit server at ${cwd}. err: ${err.message}`);\n return undefined;\n }\n }\n\n /**\n * Start a new bit-server process\n */\n private async startBitServer(cwd: string): Promise<number | null> {\n this.logger.debug('[MCP-DEBUG] Starting new bit-server process');\n\n return new Promise((resolve, reject) => {\n try {\n const serverProcess = childProcess.spawn(this.bitBin, ['server'], {\n cwd,\n stdio: ['pipe', 'pipe', 'pipe'],\n detached: false,\n });\n\n this.serverProcess = serverProcess;\n\n let serverStarted = false;\n let outputBuffer = '';\n\n const timeout = setTimeout(() => {\n if (!serverStarted) {\n this.logger.error('[MCP-DEBUG] Timeout waiting for bit-server to start');\n serverProcess.kill();\n resolve(null);\n }\n }, 30000); // 30 second timeout\n\n serverProcess.stdout?.on('data', (data) => {\n const output = data.toString();\n outputBuffer += output;\n this.logger.debug(`[MCP-DEBUG] bit-server stdout: ${output}`);\n if (output.includes('listening on port')) {\n clearTimeout(timeout);\n if (!serverStarted) {\n serverStarted = true;\n // Extract the port from the output\n const portMatch = output.match(/listening on port (\\d+)/);\n if (portMatch && portMatch[1]) {\n const port = parseInt(portMatch[1], 10);\n this.logger.debug(`[MCP-DEBUG] bit-server started on port ${port}`);\n this.serverPort = port;\n this.serverUrl = `http://localhost:${port}/api`;\n resolve(port);\n }\n }\n }\n });\n\n serverProcess.stderr?.on('data', (data) => {\n const error = data.toString();\n outputBuffer += error;\n this.logger.debug(`[MCP-DEBUG] bit-server stderr: ${error}`);\n });\n\n serverProcess.on('error', (err) => {\n clearTimeout(timeout);\n this.logger.error(`[MCP-DEBUG] Failed to start bit-server: ${err.message}`);\n reject(err);\n });\n\n serverProcess.on('exit', (code, signal) => {\n clearTimeout(timeout);\n if (!serverStarted) {\n this.logger.error(`[MCP-DEBUG] bit-server exited with code ${code}, signal ${signal}`);\n this.logger.debug(`[MCP-DEBUG] bit-server output: ${outputBuffer}`);\n resolve(null);\n }\n });\n\n const killServerProcess = () => {\n if (this.serverProcess && !this.serverProcess.killed) {\n this.logger.debug('[MCP-DEBUG] Killing bit-server process');\n this.serverProcess.kill();\n }\n };\n\n // Handle process cleanup\n process.on('exit', () => {\n killServerProcess();\n });\n\n process.on('SIGINT', () => {\n killServerProcess();\n process.exit();\n });\n\n process.on('SIGTERM', () => {\n killServerProcess();\n process.exit();\n });\n } catch (err) {\n this.logger.error(`[MCP-DEBUG] Error spawning bit-server: ${(err as Error).message}`);\n reject(err);\n }\n });\n }\n\n /**\n * Call bit-server API endpoint using cli-raw route\n */\n private async callBitServerAPI(\n command: string,\n args: string[] = [],\n flags: Record<string, any> = {},\n cwd: string,\n isReTrying = false\n ): Promise<any> {\n return this.callBitServerAPIWithRoute('cli-raw', command, args, flags, cwd, isReTrying);\n }\n\n /**\n * Call bit-server API endpoint using IDE route\n */\n private async callBitServerIDEAPI(method: string, args: any[] = [], cwd: string, isReTrying = false): Promise<any> {\n return this.callBitServerAPIWithRoute('ide', method, args, {}, cwd, isReTrying, true);\n }\n\n /**\n * Generic method to call bit-server API with different routes\n */\n private async callBitServerAPIWithRoute(\n route: string,\n commandOrMethod: string,\n argsOrParams: any[] = [],\n flags: Record<string, any> = {},\n cwd: string,\n isReTrying = false,\n isIDERoute = false\n ): Promise<any> {\n if (!this.serverPort) {\n if (!cwd) throw new Error('CWD is required to call bit-server API');\n this.serverPort = await this.getBitServerPort(cwd);\n if (this.serverPort) {\n this.serverUrl = `http://localhost:${this.serverPort}/api`;\n } else {\n // No server running, try to start one\n this.logger.debug('[MCP-DEBUG] No bit-server found, attempting to start one');\n const startedPort = await this.startBitServer(cwd);\n if (startedPort) {\n this.serverPort = startedPort;\n this.serverUrl = `http://localhost:${this.serverPort}/api`;\n }\n }\n }\n\n if (!this.serverUrl) {\n throw new Error('Unable to connect to bit-server. Please ensure you are in a valid Bit workspace.');\n }\n\n // Resolve the real path to handle symlinks (e.g., /tmp -> /private/tmp on macOS)\n const realCwd = fs.realpathSync(cwd);\n\n let body: any;\n let url: string;\n\n if (isIDERoute) {\n // For IDE route, use the method name and args directly\n body = {\n args: argsOrParams,\n };\n url = `${this.serverUrl}/${route}/${commandOrMethod}`;\n } else {\n // For CLI route, build command array with flags\n const commandArray = [commandOrMethod, ...argsOrParams];\n\n // Convert flags to command line arguments\n for (const [key, value] of Object.entries(flags)) {\n if (value === true) {\n commandArray.push(`--${key}`);\n } else if (value !== false && value !== undefined) {\n commandArray.push(`--${key}`, String(value));\n }\n }\n\n body = {\n command: commandArray,\n pwd: realCwd,\n };\n url = `${this.serverUrl}/${route}`;\n }\n\n try {\n const response = await fetch(url, {\n method: 'POST',\n headers: { 'Content-Type': 'application/json' },\n body: JSON.stringify(body),\n });\n\n if (!response.ok) {\n let errorMessage = `HTTP ${response.status}: ${response.statusText}`;\n try {\n const errorJson = await response.json();\n errorMessage = errorJson.message || errorJson || errorMessage;\n } catch {\n // Ignore JSON parse errors\n }\n throw new Error(errorMessage);\n }\n\n return await response.json();\n } catch (err: any) {\n if (err.code === 'ECONNREFUSED' && !isReTrying) {\n // Server is no longer running, reset cached values and try to restart\n this.serverPort = undefined;\n this.serverUrl = undefined;\n this.logger.debug('[MCP-DEBUG] Connection refused, attempting to restart bit-server');\n return this.callBitServerAPIWithRoute(route, commandOrMethod, argsOrParams, flags, cwd, true, isIDERoute);\n }\n throw err;\n }\n }\n\n async runMcpServer(options: { includeAdditional?: string; bitBin?: string; consumerProject?: boolean }) {\n this.logger.debug(\n `[MCP-DEBUG] Starting MCP server with options: ${JSON.stringify(options)}. CWD: ${process.cwd()}`\n );\n const commands = this.cli.commands;\n\n // Validate and set bitBin with security checks\n if (options.bitBin) {\n this.bitBin = this.validateBitBin(options.bitBin);\n }\n // If no bitBin provided, keep the default 'bit'\n\n // Tools to always exclude\n const alwaysExcludeTools = new Set([\n 'login',\n 'logout',\n 'completion',\n 'mcp-server',\n 'start',\n 'run-action',\n 'watch',\n 'run',\n 'resume-export',\n 'server',\n 'serve-preview',\n ]);\n\n // Parse command strings from flag options\n let additionalCommandsSet: Set<string> | undefined;\n if (options.includeAdditional) {\n additionalCommandsSet = new Set(options.includeAdditional.split(',').map((cmd) => cmd.trim()));\n this.logger.debug(`[MCP-DEBUG] Including additional commands: ${Array.from(additionalCommandsSet).join(', ')}`);\n }\n\n const server = new McpServer({\n name: 'bit-cli-mcp',\n version: '0.0.1',\n });\n\n // Set of tools for consumer projects (non-Bit workspaces)\n const consumerProjectTools = new Set<string>();\n\n const consumerProject = Boolean(options.consumerProject);\n\n // Store consumer project mode globally in the class\n this.isConsumerProjectMode = consumerProject;\n\n // Validate flags combination\n if (consumerProject) {\n this.logger.debug(\n `[MCP-DEBUG] Running MCP server in consumer project mode (for non-Bit workspaces) with tools: bit_remote_search, bit_remote_component_details`\n );\n if (options.includeAdditional) {\n this.logger.debug(\n `[MCP-DEBUG] Additional tools enabled in consumer project mode: ${options.includeAdditional}`\n );\n }\n }\n\n const filterOptions: CommandFilterOptions = {\n additionalCommandsSet,\n alwaysExcludeTools,\n consumerProject,\n consumerProjectTools,\n };\n\n commands.forEach((cmd) => {\n const cmdName = getCommandName(cmd);\n\n if (this.shouldIncludeCommand(cmdName, filterOptions)) {\n this.registerToolForCommand(server, cmd);\n }\n\n // Process sub-commands\n if (cmd.commands && cmd.commands.length) {\n this.processSubCommands(server, cmd, filterOptions);\n }\n });\n\n // Always register remote-search tool\n this.registerRemoteSearchTool(server);\n\n // In consumer project mode, only register bit_remote_search and bit_remote_component_details\n // All other tools should not be available in consumer project mode\n if (consumerProject) {\n // Register the new combined remote component details tool\n this.registerRemoteComponentDetailsTool(server);\n } else {\n // Register the bit_workspace_info tool\n this.registerWorkspaceInfoTool(server);\n\n // Register the bit_component_details tool\n this.registerComponentDetailsTool(server);\n\n // Register command discovery and help tools\n this.registerCommandsListTool(server);\n this.registerCommandHelpTool(server);\n\n this.registerQueryTool(server);\n this.registerExecuteTool(server);\n }\n\n await server.connect(new StdioServerTransport());\n }\n\n private shouldIncludeCommand(cmdName: string, options: CommandFilterOptions): boolean {\n // Always exclude certain commands\n if (options.alwaysExcludeTools.has(cmdName)) return false;\n\n // Consumer project mode: only include consumer project tools + any additional specified\n if (options.consumerProject) {\n const shouldInclude =\n options.consumerProjectTools.has(cmdName) || (options.additionalCommandsSet?.has(cmdName) ?? false);\n if (shouldInclude) {\n this.logger.debug(`[MCP-DEBUG] Including command in consumer project mode: ${cmdName}`);\n }\n return shouldInclude;\n }\n\n // Default mode: only include additional specified commands (no default tools anymore)\n return options.additionalCommandsSet?.has(cmdName) ?? false;\n }\n\n private buildZodSchema(config: CommandConfig): Record<string, any> {\n const schema: Record<string, any> = {\n // Add cwd parameter as mandatory to all commands\n cwd: z.string().describe('Path to workspace'),\n };\n\n config.argsData.forEach((arg) => {\n const desc = arg.description || `Positional argument: ${arg.nameRaw}`;\n if (arg.isArray) {\n schema[arg.nameCamelCase] = arg.required\n ? z.array(z.string()).describe(desc)\n : z.array(z.string()).optional().describe(desc);\n } else {\n schema[arg.nameCamelCase] = arg.required ? z.string().describe(desc) : z.string().optional().describe(desc);\n }\n });\n\n config.flagsData.forEach((flag) => {\n const type = flag.type;\n schema[flag.name] =\n type === 'string'\n ? z.string().optional().describe(flag.description)\n : z.boolean().optional().describe(flag.description);\n });\n\n return schema;\n }\n\n private buildCommandArgs(config: CommandConfig, params: any): string[] {\n // Split the command name on spaces to properly handle subcommands\n const args: string[] = config.name.split(' ');\n\n // Add positional arguments in order\n config.argsData.forEach((arg) => {\n const val = params[arg.nameCamelCase];\n if (val === undefined) return;\n\n if (arg.isArray && Array.isArray(val)) {\n val.forEach((item) => args.push(item));\n } else {\n args.push(val);\n }\n });\n\n // Add options as flags\n config.flagsData.forEach((flag) => {\n const name = flag.name;\n const type = flag.type;\n const val = params[name];\n if (val === undefined) return;\n if (type === 'boolean' && val) {\n args.push(`--${name}`);\n } else if (type === 'string' && val) {\n // Check if the string value contains spaces and quote it if necessary\n const stringValue = String(val);\n if (stringValue.includes(' ')) {\n args.push(`--${name}`, `\"${stringValue}\"`);\n } else {\n args.push(`--${name}`, stringValue);\n }\n }\n });\n\n return args;\n }\n\n private getToolName(name: string): string {\n // replace white spaces (\\s) and dashes (-) with underscores (_)\n return `bit_${name}`.replace(/[-\\s]/g, '_');\n }\n\n private registerToolForCommand(server: McpServer, cmd: Command, parentCmd?: Command) {\n const cmdName = parentCmd ? `${getCommandName(parentCmd)} ${getCommandName(cmd)}` : getCommandName(cmd);\n const toolName = this.getToolName(cmdName);\n\n // Modify description for show and schema commands in consumer project mode\n let description = `${cmd.description}${cmd.extendedDescription ? `.\\n(${cmd.extendedDescription})` : ''}`;\n if (this.isConsumerProjectMode && (cmdName === 'show' || cmdName === 'schema')) {\n description += `\\n(In consumer project mode, --remote flag is automatically added)`;\n }\n\n const config: CommandConfig = {\n name: cmdName,\n description,\n argsData: getArgsData(cmd),\n flagsData: getFlagsData(cmd),\n };\n\n const schema = this.buildZodSchema(config);\n\n server.tool(toolName, config.description, schema, async (params: any) => {\n const argsToRun = this.buildCommandArgs(config, params);\n\n // Special handling for consumer projects - auto-add --remote flag for show and schema commands\n if (this.isConsumerProjectMode && (cmdName === 'show' || cmdName === 'schema')) {\n if (!argsToRun.includes('--remote')) {\n this.logger.debug(`[MCP-DEBUG] Auto-adding --remote flag for ${cmdName} in consumer project mode`);\n argsToRun.push('--remote');\n }\n if (cmdName === 'show' && !argsToRun.includes('--legacy')) {\n this.logger.debug(`[MCP-DEBUG] Auto-adding --legacy flag for ${cmdName} in consumer project mode`);\n argsToRun.push('--legacy');\n }\n }\n\n return this.runBit(argsToRun, params.cwd);\n });\n }\n\n /**\n * Read and parse workspace.jsonc file from a given directory\n */\n private async readWorkspaceJsonc(workspaceDir: string): Promise<any> {\n try {\n const workspaceJsoncPath = path.join(workspaceDir, 'workspace.jsonc');\n const fileExists = await fs.pathExists(workspaceJsoncPath);\n if (!fileExists) {\n this.logger.debug(`[MCP-DEBUG] workspace.jsonc not found at ${workspaceJsoncPath}`);\n return null;\n }\n\n const content = await fs.readFile(workspaceJsoncPath, 'utf-8');\n return parse(content);\n } catch (error) {\n this.logger.debug(`[MCP-DEBUG] Failed to read workspace.jsonc: ${error}`);\n return null;\n }\n }\n\n /**\n * Extract owner from defaultScope in workspace.jsonc\n * If defaultScope contains a dot, split by dot and take the first part\n */\n private extractOwnerFromWorkspace(workspaceConfig: any): string | null {\n try {\n const workspaceSection = workspaceConfig?.['teambit.workspace/workspace'];\n const defaultScope = workspaceSection?.defaultScope;\n\n if (!defaultScope || typeof defaultScope !== 'string') {\n return null;\n }\n\n // If defaultScope contains a dot, split by dot and take the first part (owner)\n if (defaultScope.includes('.')) {\n const parts = defaultScope.split('.');\n return parts[0];\n }\n\n // If no dot, the entire defaultScope is treated as the owner\n return defaultScope;\n } catch (error) {\n this.logger.debug(`[MCP-DEBUG] Failed to extract owner from workspace config: ${error}`);\n return null;\n }\n }\n\n private registerRemoteSearchTool(server: McpServer) {\n const toolName = 'bit_remote_search';\n const description = `Search for components in remote scopes. Use this tool to find existing components before creating new ones. Essential for component reuse and discovery`;\n const schema: Record<string, any> = {\n queryStr: z\n .string()\n .describe(\n `Search query string - Don't try to search with too many keywords. It will try to find components that match all keywords, which is often too restrictive. Instead, search with a single keyword or a few broad keywords`\n ),\n cwd: z.string().optional().describe('Path to workspace directory'),\n owners: z\n .array(z.string())\n .optional()\n .describe(\n 'Filter results by specific owners or organizations. AVOID using this parameter - let the system automatically extract the owner from workspace.jsonc defaultScope for better relevance. Only use when you need to override the automatic behavior or search across different owners'\n ),\n skipAutoOwner: z\n .boolean()\n .optional()\n .describe(\n 'Set to true to disable automatic owner extraction from workspace.jsonc. When false or omitted, the system will try to automatically extract owner from workspace defaultScope'\n ),\n };\n server.tool(toolName, description, schema, async (params: any) => {\n const http = await this.getHttp();\n\n // Determine the owners to use for the search\n let ownersToUse = params.owners && params.owners.length > 0 ? params.owners : undefined;\n\n // If owners not explicitly provided and skipAutoOwner is not true, try to extract from workspace.jsonc\n if (!ownersToUse && !params.skipAutoOwner) {\n try {\n // Use provided cwd parameter or fall back to current working directory\n const workspaceDir = params.cwd || process.cwd();\n this.logger.debug(`[MCP-DEBUG] Attempting to auto-extract owner from workspace.jsonc in: ${workspaceDir}`);\n const workspaceConfig = await this.readWorkspaceJsonc(workspaceDir);\n if (workspaceConfig) {\n const extractedOwner = this.extractOwnerFromWorkspace(workspaceConfig);\n if (extractedOwner) {\n ownersToUse = [extractedOwner];\n this.logger.debug(`[MCP-DEBUG] Auto-extracted owner from workspace.jsonc: ${extractedOwner}`);\n }\n }\n } catch (error) {\n this.logger.debug(`[MCP-DEBUG] Failed to auto-extract owner: ${error}`);\n // Continue without auto-extracted owner\n }\n } else {\n this.logger.debug(\n `[MCP-DEBUG] Using provided owners for search: ${ownersToUse ? ownersToUse.join(', ') : 'none'}`\n );\n }\n\n const results = await http.search(params.queryStr, ownersToUse);\n this.logger.debug(`[MCP-DEBUG] Search results: ${JSON.stringify(results)}`);\n if (!results?.components || results.components.length === 0) {\n return { content: [{ type: 'text', text: 'No results found' }] };\n }\n const formattedResults = {\n type: 'text',\n text: results.components.join('\\n'),\n };\n return { content: [formattedResults] } as CallToolResult;\n });\n }\n\n private registerRemoteComponentDetailsTool(server: McpServer) {\n const toolName = 'bit_remote_component_details';\n const description =\n 'Get detailed information about a remote component including basic info and its public API schema. Combines the functionality of show and schema commands for remote components.';\n const schema: Record<string, any> = {\n cwd: z.string().describe('Path to workspace directory'),\n componentName: z.string().describe('Component name or component ID to get details for'),\n includeSchema: z.boolean().optional().describe('Include component public API schema (default: true)'),\n };\n\n server.tool(toolName, description, schema, async (params: any) => {\n try {\n const { componentName, includeSchema = true, cwd } = params;\n\n // Get basic component information using show command via direct execution\n const showArgs = ['show', componentName, '--remote', '--legacy'];\n const showResult = await this.runBit(showArgs, cwd);\n\n const result: any = {\n componentInfo: showResult.content[0].text,\n };\n\n // Get schema information if requested\n if (includeSchema) {\n try {\n const schemaArgs = ['schema', componentName, '--remote'];\n const schemaResult = await this.runBit(schemaArgs, cwd);\n result.schema = schemaResult.content[0].text;\n } catch (schemaError) {\n this.logger.warn(\n `[MCP-DEBUG] Failed to get schema for ${componentName}: ${(schemaError as Error).message}`\n );\n result.schemaError = `Failed to retrieve schema: ${(schemaError as Error).message}`;\n }\n }\n\n return this.formatAsCallToolResult(result);\n } catch (error) {\n this.logger.error(`[MCP-DEBUG] Error in bit_remote_component_details tool: ${(error as Error).message}`);\n return this.formatErrorAsCallToolResult(error as Error, 'getting remote component details');\n }\n });\n }\n\n private registerWorkspaceInfoTool(server: McpServer) {\n const toolName = 'bit_workspace_info';\n const description =\n 'Get comprehensive workspace information including status, components list, apps, templates, dependency graph, and workspace dependencies';\n const schema: Record<string, any> = {\n cwd: z.string().describe('Path to workspace directory'),\n includeTemplates: z.boolean().optional().describe('Include templates list (default: false)'),\n includeApps: z.boolean().optional().describe('Include apps list (default: false)'),\n includeGraph: z.boolean().optional().describe('Include dependency graph (default: false)'),\n json: z\n .boolean()\n .optional()\n .describe(\n 'Return output in JSON format - WARNING: This produces verbose output and should be used when structured data is specifically needed (default: false)'\n ),\n };\n\n server.tool(toolName, description, schema, async (params: any) => {\n try {\n const includeTemplates = params.includeTemplates === true; // default: false\n const includeApps = params.includeApps === true;\n const includeGraph = params.includeGraph === true;\n const useJson = params.json === true;\n\n const workspaceInfo: any = {};\n const flags = useJson ? { json: true } : {};\n\n const statusExecution = await this.safeBitCommandExecution(\n 'status',\n [],\n flags,\n params.cwd,\n 'get workspace status',\n true\n );\n workspaceInfo.status = statusExecution.result;\n\n const listExecution = await this.safeBitCommandExecution(\n 'list',\n [],\n flags,\n params.cwd,\n 'get components list',\n true\n );\n workspaceInfo.list = listExecution.result;\n\n // Get apps list if requested\n if (includeApps) {\n const appsExecution = await this.safeBitCommandExecution(\n 'app',\n ['list'],\n flags,\n params.cwd,\n 'get apps list',\n true\n );\n workspaceInfo.apps = appsExecution.result;\n }\n\n // Get templates list if requested\n if (includeTemplates) {\n const templatesExecution = await this.safeBitCommandExecution(\n 'templates',\n [],\n flags,\n params.cwd,\n 'get templates list',\n true\n );\n workspaceInfo.templates = templatesExecution.result;\n }\n\n // Get dependency graph if requested\n if (includeGraph) {\n const graphExecution = await this.safeBitCommandExecution(\n 'graph',\n [],\n { json: true },\n params.cwd,\n 'get dependency graph',\n true\n );\n workspaceInfo.graph = graphExecution.result;\n }\n\n // Get workspace dependencies if requested\n try {\n const workspaceDependencies = await this.callBitServerIDEAPI('getWorkspaceDependencies', [], params.cwd);\n workspaceInfo.workspaceDependencies = workspaceDependencies;\n } catch (error) {\n this.logger.error(`[MCP-DEBUG] Error getting workspace dependencies: ${(error as Error).message}`);\n workspaceInfo.workspaceDependencies = {\n error: `Failed to get workspace dependencies: ${(error as Error).message}`,\n };\n }\n\n // Get current lane name with scope\n try {\n const laneId = await this.callBitServerIDEAPI('getCurrentLaneName', [true], params.cwd);\n workspaceInfo.laneId = laneId;\n } catch (error) {\n this.logger.error(`[MCP-DEBUG] Error getting current lane name: ${(error as Error).message}`);\n workspaceInfo.laneId = {\n error: `Failed to get current lane name: ${(error as Error).message}`,\n };\n }\n\n return this.formatAsCallToolResult(workspaceInfo);\n } catch (error) {\n this.logger.error(`[MCP-DEBUG] Error in bit_workspace_info tool: ${(error as Error).message}`);\n return this.formatErrorAsCallToolResult(error as Error, 'getting workspace info');\n }\n });\n }\n\n private registerComponentDetailsTool(server: McpServer) {\n const toolName = 'bit_component_details';\n const description =\n 'Get detailed information about a specific component including basic info and optionally its public API schema';\n const schema: Record<string, any> = {\n cwd: z.string().describe('Path to workspace directory'),\n componentName: z.string().describe('Component name or component ID to get details for'),\n includeSchema: z.boolean().optional().describe('Include component public API schema (default: false)'),\n };\n\n server.tool(toolName, description, schema, async (params: any) => {\n try {\n const includeSchema = params.includeSchema === true;\n const componentName = params.componentName;\n\n // Get component details using IDE API with includeSchema parameter\n const ideApiResult = await this.callBitServerIDEAPI(\n 'getCompDetails',\n [componentName, includeSchema],\n params.cwd\n );\n\n return this.formatAsCallToolResult(ideApiResult);\n } catch (error) {\n this.logger.error(`[MCP-DEBUG] Error in bit_component_details tool: ${(error as Error).message}`);\n return this.formatErrorAsCallToolResult(error as Error, 'getting component details');\n }\n });\n }\n\n private registerCommandsListTool(server: McpServer) {\n const toolName = 'bit_commands_list';\n const description =\n 'Get all available Bit commands with descriptions and groups. Use this to discover what commands are available.';\n const schema: Record<string, any> = {\n extendedDescription: z\n .boolean()\n .optional()\n .describe('Include extended descriptions for commands (default: false)'),\n internal: z.boolean().optional().describe('Include internal/debug commands (default: false)'),\n };\n\n server.tool(toolName, description, schema, async (params: any) => {\n try {\n const { extendedDescription = false, internal = false } = params;\n const commandsInfo: any[] = [];\n\n const shouldSkipCommand = (cmd: Command): boolean => {\n return Boolean((cmd.private && !internal) || cmd.description.startsWith('DEPRECATED'));\n };\n\n // Build list of all commands\n this.cli.commands.forEach((cmd) => {\n if (shouldSkipCommand(cmd)) return;\n\n const mainCmdName = getCommandName(cmd);\n const groupKey = cmd.group;\n\n const commandInfo: any = {\n name: mainCmdName,\n description: cmd.description || '',\n };\n\n if (extendedDescription && cmd.extendedDescription) {\n commandInfo.extendedDescription = cmd.extendedDescription;\n }\n if (groupKey) commandInfo.group = this.cli.groups[groupKey] || groupKey;\n\n // Add subcommands summary\n if (cmd.commands && cmd.commands.length > 0) {\n commandInfo.subcommands = cmd.commands\n .filter((subCmd) => !shouldSkipCommand(subCmd))\n .map((subCmd) => ({\n name: getCommandName(subCmd),\n description: subCmd.description || '',\n }));\n }\n\n commandsInfo.push(commandInfo);\n });\n\n commandsInfo.sort((a, b) => a.name.localeCompare(b.name));\n\n const result = JSON.stringify({ total: commandsInfo.length, commands: commandsInfo }, null, 2);\n this.logger.debug(`[MCP-DEBUG] Successfully retrieved commands list. Total: ${commandsInfo.length}`);\n return this.formatAsCallToolResult(result);\n } catch (error) {\n this.logger.error(`[MCP-DEBUG] Error in bit_commands_list tool: ${(error as Error).message}`);\n return this.formatErrorAsCallToolResult(error as Error, 'getting commands list');\n }\n });\n }\n\n private registerCommandHelpTool(server: McpServer) {\n const toolName = 'bit_command_help';\n const description =\n 'Get detailed help for a specific Bit command including syntax, arguments, flags, and usage examples. Use this to understand exactly how to use a command.';\n const schema: Record<string, any> = {\n command: z.string().describe('The command name to get help for (e.g., \"status\", \"install\", \"create\")'),\n subcommand: z\n .string()\n .optional()\n .describe('Optional subcommand name (e.g., for \"lane show\", use command=\"lane\" and subcommand=\"show\")'),\n };\n\n server.tool(toolName, description, schema, async (params: any) => {\n try {\n const { command: requestedCommand, subcommand: requestedSubcommand } = params;\n let commandInfo: any = null;\n\n const buildDetailedCommandInfo = (cmd: Command, parentName?: string) => {\n const cmdName = parentName ? `${parentName} ${getCommandName(cmd)}` : getCommandName(cmd);\n\n const info: any = {\n name: cmdName,\n description: cmd.description || '',\n extendedDescription: cmd.extendedDescription || '',\n group: cmd.group ? this.cli.groups[cmd.group] || cmd.group : '',\n };\n\n // Add arguments information\n const argsData = getArgsData(cmd);\n if (argsData.length > 0) {\n info.arguments = argsData.map((arg) => ({\n name: arg.nameRaw,\n description: arg.description || '',\n required: arg.required,\n isArray: arg.isArray,\n }));\n }\n\n // Add options/flags information\n info.options = getFlagsData(cmd);\n\n // Add examples if available\n if (cmd.examples) {\n info.examples = cmd.examples;\n }\n\n // Add subcommands if available (including private ones for help purposes)\n if (cmd.commands && cmd.commands.length > 0) {\n info.subcommands = cmd.commands.map((subCmd) => ({\n name: getCommandName(subCmd),\n description: subCmd.description || '',\n }));\n }\n\n return info;\n };\n\n // Search for the requested command\n this.cli.commands.forEach((cmd) => {\n const mainCmdName = getCommandName(cmd);\n\n if (requestedSubcommand) {\n // Looking for a subcommand\n if (mainCmdName === requestedCommand && cmd.commands) {\n const subCmd = cmd.commands.find((sub) => getCommandName(sub) === requestedSubcommand);\n if (subCmd) {\n commandInfo = buildDetailedCommandInfo(subCmd, requestedCommand);\n }\n }\n } else {\n // Looking for a main command\n if (mainCmdName === requestedCommand) {\n commandInfo = buildDetailedCommandInfo(cmd);\n }\n }\n });\n\n if (!commandInfo) {\n const commandFullName = requestedSubcommand ? `${requestedCommand} ${requestedSubcommand}` : requestedCommand;\n return this.formatAsCallToolResult(`Command not found: ${commandFullName}`);\n }\n\n const result = JSON.stringify(commandInfo, null, 2);\n this.logger.debug(`[MCP-DEBUG] Successfully retrieved command help for: ${commandInfo.name}`);\n return this.formatAsCallToolResult(result);\n } catch (error) {\n this.logger.error(`[MCP-DEBUG] Error in bit_command_help tool: ${(error as Error).message}`);\n return this.formatErrorAsCallToolResult(error as Error, 'getting command help');\n }\n });\n }\n\n private registerQueryTool(server: McpServer) {\n const toolName = 'bit_query';\n const description =\n 'Execute read-only Bit commands that safely inspect workspace and component state without making modifications. Only whitelisted query commands are allowed for safety.';\n const schema: Record<string, any> = {\n cwd: z.string().describe('Path to workspace directory'),\n command: z.string().describe('The Bit command to execute (e.g., \"status\", \"show\", \"list\")'),\n args: z.array(z.string()).optional().describe('Arguments to pass to the command'),\n flags: z\n .record(z.union([z.string(), z.boolean()]))\n .optional()\n .describe('Flags to pass to the command as key-value pairs'),\n };\n\n server.tool(toolName, description, schema, async (params: any) => {\n try {\n const { command, args = [], flags = {}, cwd } = params;\n\n // Check if command is in the read-only whitelist\n // Support both single commands and subcommands (e.g., \"lane show\")\n const fullCommand = args.length > 0 ? `${command} ${args[0]}` : command;\n const isAllowed = this.readOnlyCommands.has(command) || this.readOnlyCommands.has(fullCommand);\n\n if (!isAllowed) {\n const allowedCommands = Array.from(this.readOnlyCommands).sort().join(', ');\n return this.formatAsCallToolResult(\n `Error: Command \"${command}\" is not allowed in query mode. Allowed read-only commands: ${allowedCommands}`\n );\n }\n\n // Build command arguments\n const commandArgs = [command, ...args];\n\n // Add flags to arguments\n Object.entries(flags).forEach(([key, value]) => {\n if (typeof value === 'boolean' && value) {\n commandArgs.push(`--${key}`);\n } else if (typeof value === 'string' && value) {\n commandArgs.push(`--${key}`);\n commandArgs.push(value);\n }\n });\n\n this.logger.debug(`[MCP-DEBUG] Executing query command: ${command} with args: ${JSON.stringify(commandArgs)}`);\n\n const execution = await this.safeBitCommandExecution(\n command,\n args,\n flags,\n cwd,\n `execute query command ${command}`\n );\n\n return this.formatAsCallToolResult(execution.result);\n } catch (error) {\n this.logger.error(`[MCP-DEBUG] Error in bit_query tool: ${(error as Error).message}`);\n return this.formatErrorAsCallToolResult(error as Error, 'executing query command');\n }\n });\n }\n\n private registerExecuteTool(server: McpServer) {\n const toolName = 'bit_execute';\n const description = 'Execute Bit commands that make changes to workspace or components (not read-only).';\n const schema: Record<string, any> = {\n cwd: z.string().describe('Path to workspace directory'),\n command: z.string().describe('The Bit command to execute (e.g., \"import\", \"tag\", \"export\", \"remove\")'),\n args: z.array(z.string()).optional().describe('Arguments to pass to the command'),\n flags: z\n .record(z.union([z.string(), z.boolean()]))\n .optional()\n .describe('Flags to pass to the command as key-value pairs'),\n };\n\n server.tool(toolName, description, schema, async (params: any) => {\n try {\n let { command, args = [] } = params;\n const { flags = {}, cwd } = params;\n\n // Handle sub-commands: if command has multiple words, move the second word to args\n const commandParts = command.trim().split(/\\s+/);\n if (commandParts.length > 1) {\n command = commandParts[0];\n args = [commandParts[1], ...args];\n }\n\n this.logger.debug(\n `[MCP-DEBUG] Executing command: ${command} with args: ${JSON.stringify(args)} and flags: ${JSON.stringify(flags)}`\n );\n\n const execution = await this.safeBitCommandExecution(command, args, flags, cwd, `execute command ${command}`);\n\n return this.formatAsCallToolResult(execution.result);\n } catch (error) {\n this.logger.error(`[MCP-DEBUG] Error in bit_execute tool: ${(error as Error).message}`);\n return this.formatErrorAsCallToolResult(error as Error, 'executing command');\n }\n });\n }\n\n private processSubCommands(server: McpServer, parentCmd: Command, options: CommandFilterOptions) {\n const parentCmdName = getCommandName(parentCmd);\n\n parentCmd.commands?.forEach((subCmd) => {\n const subCmdName = getCommandName(subCmd);\n const fullCmdName = `${parentCmdName} ${subCmdName}`;\n\n if (this.shouldIncludeCommand(fullCmdName, options)) {\n this.registerToolForCommand(server, subCmd, parentCmd);\n }\n });\n }\n\n private async runBit(args: string[], cwd: string): Promise<CallToolResult> {\n this.logger.debug(`[MCP-DEBUG] Running: ${this.bitBin} ${args.join(' ')} in ${cwd}`);\n try {\n const result = childProcess.spawnSync(this.bitBin, args, {\n cwd,\n env: { ...process.env, BIT_DISABLE_SPINNER: '1' },\n encoding: 'utf8',\n });\n\n if (result.error) {\n throw result.error;\n }\n\n if (result.status !== 0) {\n const errorMessage = result.stderr || `Command failed with status ${result.status}`;\n throw new Error(errorMessage);\n }\n\n this.logger.debug(`[MCP-DEBUG] result. stdout: ${result.stdout}`);\n return { content: [{ type: 'text', text: result.stdout }] };\n } catch (error: any) {\n this.logger.error(`[MCP-DEBUG] Error executing ${this.bitBin} ${args.join(' ')}`, error);\n return { content: [{ type: 'text', text: error.message }] };\n }\n }\n\n /**\n * Helper method to execute a bit-server API call with standardized error handling\n */\n private async executeBitServerCommand(\n command: string,\n args: string[] = [],\n flags: Record<string, any> = {},\n cwd: string,\n operationName: string\n ): Promise<any> {\n try {\n const result = await this.callBitServerAPI(command, args, flags, cwd);\n this.logger.debug(`[MCP-DEBUG] Successfully executed ${operationName} via bit-server`);\n return result;\n } catch (error) {\n this.logger.warn(`[MCP-DEBUG] Failed to execute ${operationName} via bit-server: ${(error as Error).message}`);\n throw error;\n }\n }\n\n /**\n * Helper method to format any result as CallToolResult\n */\n private formatAsCallToolResult(result: any): CallToolResult {\n if (typeof result === 'string') {\n return { content: [{ type: 'text', text: result }] } as CallToolResult;\n } else if (typeof result === 'object') {\n return { content: [{ type: 'text', text: JSON.stringify(result, null, 2) }] } as CallToolResult;\n } else {\n return { content: [{ type: 'text', text: String(result) }] } as CallToolResult;\n }\n }\n\n /**\n * Helper method to format error as CallToolResult\n */\n private formatErrorAsCallToolResult(error: Error, operation: string): CallToolResult {\n return {\n content: [\n {\n type: 'text',\n text: `Error ${operation}: ${error.message}`,\n },\n ],\n } as CallToolResult;\n }\n\n /**\n * Helper method to safely execute a bit command with error handling\n */\n private async safeBitCommandExecution(\n command: string,\n args: string[] = [],\n flags: Record<string, any> = {},\n cwd: string,\n operationName: string,\n includeErrorInResult = false\n ): Promise<{ success: boolean; result: any; error?: string }> {\n try {\n let result = await this.executeBitServerCommand(command, args, flags, cwd, operationName);\n\n // Unwrap the result from data wrapper if it exists and we have a successful result\n if (result && typeof result === 'object' && 'data' in result && result.data !== undefined) {\n result = result.data;\n }\n\n // Clean up output by removing ANSI color codes when not using JSON format\n const useJson = flags && flags.json === true;\n if (!useJson && typeof result === 'string') {\n result = stripAnsi(result);\n }\n\n return { success: true, result };\n } catch (error) {\n if (includeErrorInResult) {\n return {\n success: false,\n result: { error: `Failed to ${operationName}: ${(error as Error).message}` },\n error: (error as Error).message,\n };\n } else {\n throw error;\n }\n }\n }\n private validateBitBin(bitBin: string): string {\n const trimmed = bitBin?.trim();\n // Check for shell metacharacters and spaces. Protect against command injection.\n if (!trimmed || /[;&|`$(){}[\\]<>'\"\\\\]/.test(trimmed) || /\\s/.test(trimmed)) throw new Error('Invalid bitBin');\n return trimmed;\n }\n\n // Setup command business logic methods\n getEditorDisplayName(editor: string): string {\n return McpSetupUtils.getEditorDisplayName(editor);\n }\n\n /**\n * Get the path to the editor config file based on editor type and scope\n */\n getEditorConfigPath(editor: string, isGlobal: boolean, workspaceDir?: string): string {\n const editorLower = editor.toLowerCase();\n\n if (editorLower === 'vscode') {\n // For VS Code, return appropriate config path based on global vs workspace scope\n return isGlobal\n ? McpSetupUtils.getVSCodeSettingsPath(isGlobal, workspaceDir)\n : McpSetupUtils.getVSCodeMcpConfigPath(workspaceDir);\n } else if (editorLower === 'cursor') {\n return McpSetupUtils.getCursorSettingsPath(isGlobal, workspaceDir);\n } else if (editorLower === 'windsurf') {\n return McpSetupUtils.getWindsurfSettingsPath(isGlobal, workspaceDir);\n } else if (editorLower === 'roo') {\n return McpSetupUtils.getRooCodeSettingsPath(isGlobal, workspaceDir);\n } else if (editorLower === 'cline') {\n return McpSetupUtils.getClinePromptsPath(isGlobal, workspaceDir);\n } else if (editorLower === 'claude-code') {\n return McpSetupUtils.getClaudeCodeSettingsPath(isGlobal, workspaceDir);\n }\n\n throw new Error(`Editor \"${editor}\" is not supported yet.`);\n }\n\n async setupEditor(editor: string, options: SetupOptions, workspaceDir?: string): Promise<void> {\n const supportedEditors = ['vscode', 'cursor', 'windsurf', 'roo', 'cline', 'claude-code'];\n const editorLower = editor.toLowerCase();\n\n if (!supportedEditors.includes(editorLower)) {\n throw new Error(`Editor \"${editor}\" is not supported yet. Currently supported: ${supportedEditors.join(', ')}`);\n }\n\n // Add workspaceDir to options if provided\n const setupOptions: SetupOptions = { ...options };\n if (workspaceDir) {\n setupOptions.workspaceDir = workspaceDir;\n }\n\n if (editorLower === 'vscode') {\n await McpSetupUtils.setupVSCode(setupOptions);\n } else if (editorLower === 'cursor') {\n await McpSetupUtils.setupCursor(setupOptions);\n } else if (editorLower === 'windsurf') {\n await McpSetupUtils.setupWindsurf(setupOptions);\n } else if (editorLower === 'roo') {\n await McpSetupUtils.setupRooCode(setupOptions);\n } else if (editorLower === 'cline') {\n // Cline doesn't need MCP server setup, only rules files\n // This is a no-op but we include it for consistency\n // Users should use the 'rules' command to set up Cline instructions\n } else if (editorLower === 'claude-code') {\n await McpSetupUtils.setupClaudeCode(setupOptions);\n }\n }\n\n async writeRulesFile(editor: string, options: RulesOptions, workspaceDir?: string): Promise<void> {\n const supportedEditors = ['vscode', 'cursor', 'roo', 'cline', 'claude-code'];\n const editorLower = editor.toLowerCase();\n\n if (!supportedEditors.includes(editorLower)) {\n throw new Error(`Editor \"${editor}\" is not supported yet. Currently supported: ${supportedEditors.join(', ')}`);\n }\n\n // Add workspaceDir to options if provided\n const rulesOptions: RulesOptions = { ...options };\n if (workspaceDir) {\n rulesOptions.workspaceDir = workspaceDir;\n }\n\n if (editorLower === 'vscode') {\n await McpSetupUtils.writeVSCodeRules(rulesOptions);\n } else if (editorLower === 'cursor') {\n await McpSetupUtils.writeCursorRules(rulesOptions);\n } else if (editorLower === 'roo') {\n await McpSetupUtils.writeRooCodeRules(rulesOptions);\n } else if (editorLower === 'cline') {\n await McpSetupUtils.writeClineRules(rulesOptions);\n } else if (editorLower === 'claude-code') {\n await McpSetupUtils.writeClaudeCodeRules(rulesOptions);\n }\n }\n\n async getRulesContent(consumerProject: boolean = false): Promise<string> {\n return McpSetupUtils.getDefaultRulesContent(consumerProject);\n }\n\n static slots = [];\n static dependencies = [CLIAspect, LoggerAspect];\n static runtime = MainRuntime;\n static async provider([cli, loggerMain]: [CLIMain, LoggerMain]) {\n const logger = loggerMain.createLogger(CliMcpServerAspect.id);\n const mcpServer = new CliMcpServerMain(cli, logger);\n const mcpServerCmd = new McpServerCmd(mcpServer);\n mcpServerCmd.commands = [new McpStartCmd(mcpServer), new McpSetupCmd(mcpServer), new McpRulesCmd(mcpServer)];\n cli.register(mcpServerCmd);\n return mcpServer;\n }\n}\n\nCliMcpServerAspect.addRuntime(CliMcpServerMain);\n\nexport default CliMcpServerMain;\n"],"mappings":";;;;;;AAGA,SAAAA,KAAA;EAAA,MAAAC,IAAA,GAAAC,OAAA;EAAAF,IAAA,YAAAA,CAAA;IAAA,OAAAC,IAAA;EAAA;EAAA,OAAAA,IAAA;AAAA;AACA,SAAAE,eAAA;EAAA,MAAAF,IAAA,GAAAG,sBAAA,CAAAF,OAAA;EAAAC,cAAA,YAA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aAAa4L,QAAQA,CAAC,CAAC1S,GAAG,EAAE2S,UAAU,CAAwB,EAAE;IAC9D,MAAM1S,MAAM,GAAG0S,UAAU,CAACC,YAAY,CAACC,kCAAkB,CAACC,EAAE,CAAC;IAC7D,MAAMC,SAAS,GAAG,IAAIjT,gBAAgB,CAACE,GAAG,EAAEC,MAAM,CAAC;IACnD,MAAM+S,YAAY,GAAG,KAAIC,yBAAY,EAACF,SAAS,CAAC;IAChDC,YAAY,CAACjN,QAAQ,GAAG,CAAC,KAAImN,wBAAW,EAACH,SAAS,CAAC,EAAE,KAAII,uBAAW,EAACJ,SAAS,CAAC,EAAE,KAAIK,uBAAW,EAACL,SAAS,CAAC,CAAC;IAC5G/S,GAAG,CAACqT,QAAQ,CAACL,YAAY,CAAC;IAC1B,OAAOD,SAAS;EAClB;AACF;AAACO,OAAA,CAAAxT,gBAAA,GAAAA,gBAAA;AAAAhB,eAAA,CA3yCYgB,gBAAgB,WAgyCZ,EAAE;AAAAhB,eAAA,CAhyCNgB,gBAAgB,kBAiyCL,CAACyT,gBAAS,EAAEC,sBAAY,CAAC;AAAA1U,eAAA,CAjyCpCgB,gBAAgB,aAkyCV2T,kBAAW;AAW9BZ,kCAAkB,CAACa,UAAU,CAAC5T,gBAAgB,CAAC;AAAC,IAAA6T,QAAA,GAAAL,OAAA,CAAAzV,OAAA,GAEjCiC,gBAAgB","ignoreList":[]}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
;
|
|
2
|
-
import * as overview_0 from '/home/circleci/Library/Caches/Bit/capsules/8891be5ad/teambit.mcp_cli-mcp-server@0.0.
|
|
2
|
+
import * as overview_0 from '/home/circleci/Library/Caches/Bit/capsules/8891be5ad/teambit.mcp_cli-mcp-server@0.0.39/dist/README.docs.mdx';
|
|
3
3
|
|
|
4
4
|
export const compositions = [];
|
|
5
5
|
export const overview = [overview_0];
|
package/dist/rules-cmd.js
CHANGED
|
@@ -19,11 +19,11 @@ class McpRulesCmd {
|
|
|
19
19
|
constructor(mcpServerMain) {
|
|
20
20
|
this.mcpServerMain = mcpServerMain;
|
|
21
21
|
_defineProperty(this, "name", 'rules [editor]');
|
|
22
|
-
_defineProperty(this, "description", 'Write Bit MCP rules/instructions file for VS Code, Cursor, Roo Code, Cline, or print to screen');
|
|
23
|
-
_defineProperty(this, "extendedDescription", 'Creates or updates rules/instructions markdown files to provide AI assistants with guidance on using Bit MCP server. Currently supports VS Code, Cursor, Roo Code, and
|
|
22
|
+
_defineProperty(this, "description", 'Write Bit MCP rules/instructions file for VS Code, Cursor, Roo Code, Cline, Claude Code, or print to screen');
|
|
23
|
+
_defineProperty(this, "extendedDescription", 'Creates or updates rules/instructions markdown files to provide AI assistants with guidance on using Bit MCP server. Currently supports VS Code, Cursor, Roo Code, Cline, and Claude Code. For Claude Code, creates .claude/bit.md to avoid overwriting existing CLAUDE.md files. Use --print to display content on screen. Use --consumer-project for non-Bit workspaces that only consume components as packages.');
|
|
24
24
|
_defineProperty(this, "arguments", [{
|
|
25
25
|
name: 'editor',
|
|
26
|
-
description: 'Editor to write rules for (default: vscode). Available: vscode, cursor, roo, cline'
|
|
26
|
+
description: 'Editor to write rules for (default: vscode). Available: vscode, cursor, roo, cline, claude-code'
|
|
27
27
|
}]);
|
|
28
28
|
_defineProperty(this, "options", [['g', 'global', 'Write rules to global configuration (default: workspace-specific)'], ['p', 'print', 'Print rules content to screen instead of writing to file'], ['', 'consumer-project', 'Generate rules for consumer projects that only use Bit components as packages']]);
|
|
29
29
|
}
|
|
@@ -50,6 +50,13 @@ class McpRulesCmd {
|
|
|
50
50
|
});
|
|
51
51
|
const scope = isGlobal ? 'global' : 'workspace';
|
|
52
52
|
const editorName = this.mcpServerMain.getEditorDisplayName(editor);
|
|
53
|
+
|
|
54
|
+
// Special message for Claude Code to explain the file location
|
|
55
|
+
if (editor.toLowerCase() === 'claude-code') {
|
|
56
|
+
const filePath = isGlobal ? '~/.claude/bit.md' : '.claude/bit.md';
|
|
57
|
+
const atSyntax = isGlobal ? '@~/.claude/bit.md' : '@.claude/bit.md';
|
|
58
|
+
return _chalk().default.green(`✓ Successfully wrote ${editorName} Bit rules file (${scope})\n` + ` File created: ${_chalk().default.cyan(filePath)}\n\n` + ` ${_chalk().default.yellow('Integration:')} Add this line to your main CLAUDE.md file:\n` + ` ${_chalk().default.cyan(atSyntax)}\n\n` + ` ${_chalk().default.gray('This will automatically include all Bit-specific instructions.')}`);
|
|
59
|
+
}
|
|
53
60
|
return _chalk().default.green(`✓ Successfully wrote ${editorName} Bit MCP rules file (${scope})`);
|
|
54
61
|
} catch (error) {
|
|
55
62
|
const editorName = this.mcpServerMain.getEditorDisplayName(editor);
|
package/dist/rules-cmd.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["_chalk","data","_interopRequireDefault","require","e","__esModule","default","_defineProperty","r","t","_toPropertyKey","Object","defineProperty","value","enumerable","configurable","writable","i","_toPrimitive","Symbol","toPrimitive","call","TypeError","String","Number","McpRulesCmd","constructor","mcpServerMain","name","description","report","editor","global","isGlobal","print","shouldPrint","consumerProject","toLowerCase","chalk","yellow","rulesContent","getRulesContent","writeRulesFile","scope","editorName","getEditorDisplayName","green","error","red","message","exports"],"sources":["rules-cmd.ts"],"sourcesContent":["import { Command, CommandOptions } from '@teambit/cli';\nimport chalk from 'chalk';\nimport { CliMcpServerMain } from './cli-mcp-server.main.runtime';\n\nexport type McpRulesCmdOptions = {\n global?: boolean;\n print?: boolean;\n consumerProject?: boolean;\n};\n\nexport class McpRulesCmd implements Command {\n name = 'rules [editor]';\n description
|
|
1
|
+
{"version":3,"names":["_chalk","data","_interopRequireDefault","require","e","__esModule","default","_defineProperty","r","t","_toPropertyKey","Object","defineProperty","value","enumerable","configurable","writable","i","_toPrimitive","Symbol","toPrimitive","call","TypeError","String","Number","McpRulesCmd","constructor","mcpServerMain","name","description","report","editor","global","isGlobal","print","shouldPrint","consumerProject","toLowerCase","chalk","yellow","rulesContent","getRulesContent","writeRulesFile","scope","editorName","getEditorDisplayName","filePath","atSyntax","green","cyan","gray","error","red","message","exports"],"sources":["rules-cmd.ts"],"sourcesContent":["import { Command, CommandOptions } from '@teambit/cli';\nimport chalk from 'chalk';\nimport { CliMcpServerMain } from './cli-mcp-server.main.runtime';\n\nexport type McpRulesCmdOptions = {\n global?: boolean;\n print?: boolean;\n consumerProject?: boolean;\n};\n\nexport class McpRulesCmd implements Command {\n name = 'rules [editor]';\n description =\n 'Write Bit MCP rules/instructions file for VS Code, Cursor, Roo Code, Cline, Claude Code, or print to screen';\n extendedDescription =\n 'Creates or updates rules/instructions markdown files to provide AI assistants with guidance on using Bit MCP server. Currently supports VS Code, Cursor, Roo Code, Cline, and Claude Code. For Claude Code, creates .claude/bit.md to avoid overwriting existing CLAUDE.md files. Use --print to display content on screen. Use --consumer-project for non-Bit workspaces that only consume components as packages.';\n arguments = [\n {\n name: 'editor',\n description: 'Editor to write rules for (default: vscode). Available: vscode, cursor, roo, cline, claude-code',\n },\n ];\n options = [\n ['g', 'global', 'Write rules to global configuration (default: workspace-specific)'],\n ['p', 'print', 'Print rules content to screen instead of writing to file'],\n ['', 'consumer-project', 'Generate rules for consumer projects that only use Bit components as packages'],\n ] as CommandOptions;\n\n constructor(private mcpServerMain: CliMcpServerMain) {}\n\n async report(\n [editor = 'vscode']: [string],\n { global: isGlobal = false, print: shouldPrint = false, consumerProject = false }: McpRulesCmdOptions\n ): Promise<string> {\n try {\n // Handle Windsurf requests by directing to print option\n if (editor.toLowerCase() === 'windsurf') {\n if (!shouldPrint) {\n return chalk.yellow(\n '⚠️ Windsurf uses a single-file configuration (.windsurfrules) that is complex to manage automatically.\\n' +\n 'Please use --print flag to get the rules content and manually add it to your .windsurfrules file.'\n );\n }\n // If print is requested, we'll show the content below\n }\n\n if (shouldPrint) {\n const rulesContent = await this.mcpServerMain.getRulesContent(consumerProject);\n return rulesContent;\n }\n\n await this.mcpServerMain.writeRulesFile(editor, {\n isGlobal,\n consumerProject,\n });\n\n const scope = isGlobal ? 'global' : 'workspace';\n const editorName = this.mcpServerMain.getEditorDisplayName(editor);\n\n // Special message for Claude Code to explain the file location\n if (editor.toLowerCase() === 'claude-code') {\n const filePath = isGlobal ? '~/.claude/bit.md' : '.claude/bit.md';\n const atSyntax = isGlobal ? '@~/.claude/bit.md' : '@.claude/bit.md';\n\n return chalk.green(\n `✓ Successfully wrote ${editorName} Bit rules file (${scope})\\n` +\n ` File created: ${chalk.cyan(filePath)}\\n\\n` +\n ` ${chalk.yellow('Integration:')} Add this line to your main CLAUDE.md file:\\n` +\n ` ${chalk.cyan(atSyntax)}\\n\\n` +\n ` ${chalk.gray('This will automatically include all Bit-specific instructions.')}`\n );\n }\n\n return chalk.green(`✓ Successfully wrote ${editorName} Bit MCP rules file (${scope})`);\n } catch (error) {\n const editorName = this.mcpServerMain.getEditorDisplayName(editor);\n return chalk.red(`Error writing ${editorName} rules file: ${(error as Error).message}`);\n }\n }\n}\n"],"mappings":";;;;;;AACA,SAAAA,OAAA;EAAA,MAAAC,IAAA,GAAAC,sBAAA,CAAAC,OAAA;EAAAH,MAAA,YAAAA,CAAA;IAAA,OAAAC,IAAA;EAAA;EAAA,OAAAA,IAAA;AAAA;AAA0B,SAAAC,uBAAAE,CAAA,WAAAA,CAAA,IAAAA,CAAA,CAAAC,UAAA,GAAAD,CAAA,KAAAE,OAAA,EAAAF,CAAA;AAAA,SAAAG,gBAAAH,CAAA,EAAAI,CAAA,EAAAC,CAAA,YAAAD,CAAA,GAAAE,cAAA,CAAAF,CAAA,MAAAJ,CAAA,GAAAO,MAAA,CAAAC,cAAA,CAAAR,CAAA,EAAAI,CAAA,IAAAK,KAAA,EAAAJ,CAAA,EAAAK,UAAA,MAAAC,YAAA,MAAAC,QAAA,UAAAZ,CAAA,CAAAI,CAAA,IAAAC,CAAA,EAAAL,CAAA;AAAA,SAAAM,eAAAD,CAAA,QAAAQ,CAAA,GAAAC,YAAA,CAAAT,CAAA,uCAAAQ,CAAA,GAAAA,CAAA,GAAAA,CAAA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Cmd {
|
|
|
19
19
|
constructor(mcpServerMain) {
|
|
20
20
|
this.mcpServerMain = mcpServerMain;
|
|
21
21
|
_defineProperty(this, "name", 'setup [editor]');
|
|
22
|
-
_defineProperty(this, "description", 'Setup MCP integration with VS Code, Cursor, Windsurf, Roo Code, Cline, or other editors');
|
|
23
|
-
_defineProperty(this, "extendedDescription", 'Creates or updates configuration files to integrate Bit MCP server with supported editors. Currently supports VS Code, Cursor, Windsurf, Roo Code, and
|
|
22
|
+
_defineProperty(this, "description", 'Setup MCP integration with VS Code, Cursor, Windsurf, Roo Code, Cline, Claude Code, or other editors');
|
|
23
|
+
_defineProperty(this, "extendedDescription", 'Creates or updates configuration files to integrate Bit MCP server with supported editors. Currently supports VS Code, Cursor, Windsurf, Roo Code, Cline, and Claude Code.');
|
|
24
24
|
_defineProperty(this, "arguments", [{
|
|
25
25
|
name: 'editor',
|
|
26
|
-
description: 'Editor to setup (default: vscode). Available: vscode, cursor, windsurf, roo, cline'
|
|
26
|
+
description: 'Editor to setup (default: vscode). Available: vscode, cursor, windsurf, roo, cline, claude-code'
|
|
27
27
|
}]);
|
|
28
28
|
_defineProperty(this, "options", [['', 'consumer-project', 'Configure for non-Bit workspaces that only consume Bit component packages'], ['', 'include-additional <commands>', 'Add specific commands to the default MCP tools set. Use comma-separated list in quotes'], ['g', 'global', 'Setup global configuration (default: workspace-specific)']]);
|
|
29
29
|
}
|
|
@@ -43,6 +43,11 @@ class McpSetupCmd {
|
|
|
43
43
|
|
|
44
44
|
// Get the config file path based on the editor type
|
|
45
45
|
const configPath = this.mcpServerMain.getEditorConfigPath(editor, isGlobal);
|
|
46
|
+
|
|
47
|
+
// Special message for Claude Code to mention restart requirement
|
|
48
|
+
if (editor.toLowerCase() === 'claude-code') {
|
|
49
|
+
return _chalk().default.green(`✓ Successfully configured ${editorName} MCP integration (${scope})\n` + ` Configuration written to: ${_chalk().default.cyan(configPath)}\n` + ` ${_chalk().default.yellow('Note:')} Restart Claude Code to use the Bit MCP tools.`);
|
|
50
|
+
}
|
|
46
51
|
return _chalk().default.green(`✓ Successfully configured ${editorName} MCP integration (${scope})\n` + ` Configuration written to: ${_chalk().default.cyan(configPath)}`);
|
|
47
52
|
} catch (error) {
|
|
48
53
|
const editorName = this.mcpServerMain.getEditorDisplayName(editor);
|
package/dist/setup-cmd.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["_chalk","data","_interopRequireDefault","require","e","__esModule","default","_defineProperty","r","t","_toPropertyKey","Object","defineProperty","value","enumerable","configurable","writable","i","_toPrimitive","Symbol","toPrimitive","call","TypeError","String","Number","McpSetupCmd","constructor","mcpServerMain","name","description","report","editor","consumerProject","includeAdditional","global","isGlobal","setupEditor","scope","editorName","getEditorDisplayName","configPath","getEditorConfigPath","chalk","green","cyan","error","red","message","exports"],"sources":["setup-cmd.ts"],"sourcesContent":["import { Command, CommandOptions } from '@teambit/cli';\nimport chalk from 'chalk';\nimport { CliMcpServerMain } from './cli-mcp-server.main.runtime';\n\nexport type McpSetupCmdOptions = {\n consumerProject?: boolean;\n includeAdditional?: string;\n global?: boolean;\n};\n\nexport class McpSetupCmd implements Command {\n name = 'setup [editor]';\n description = 'Setup MCP integration with VS Code, Cursor, Windsurf, Roo Code, Cline, or other editors';\n extendedDescription =\n 'Creates or updates configuration files to integrate Bit MCP server with supported editors. Currently supports VS Code, Cursor, Windsurf, Roo Code, and
|
|
1
|
+
{"version":3,"names":["_chalk","data","_interopRequireDefault","require","e","__esModule","default","_defineProperty","r","t","_toPropertyKey","Object","defineProperty","value","enumerable","configurable","writable","i","_toPrimitive","Symbol","toPrimitive","call","TypeError","String","Number","McpSetupCmd","constructor","mcpServerMain","name","description","report","editor","consumerProject","includeAdditional","global","isGlobal","setupEditor","scope","editorName","getEditorDisplayName","configPath","getEditorConfigPath","toLowerCase","chalk","green","cyan","yellow","error","red","message","exports"],"sources":["setup-cmd.ts"],"sourcesContent":["import { Command, CommandOptions } from '@teambit/cli';\nimport chalk from 'chalk';\nimport { CliMcpServerMain } from './cli-mcp-server.main.runtime';\n\nexport type McpSetupCmdOptions = {\n consumerProject?: boolean;\n includeAdditional?: string;\n global?: boolean;\n};\n\nexport class McpSetupCmd implements Command {\n name = 'setup [editor]';\n description = 'Setup MCP integration with VS Code, Cursor, Windsurf, Roo Code, Cline, Claude Code, or other editors';\n extendedDescription =\n 'Creates or updates configuration files to integrate Bit MCP server with supported editors. Currently supports VS Code, Cursor, Windsurf, Roo Code, Cline, and Claude Code.';\n arguments = [\n {\n name: 'editor',\n description: 'Editor to setup (default: vscode). Available: vscode, cursor, windsurf, roo, cline, claude-code',\n },\n ];\n options = [\n ['', 'consumer-project', 'Configure for non-Bit workspaces that only consume Bit component packages'],\n [\n '',\n 'include-additional <commands>',\n 'Add specific commands to the default MCP tools set. Use comma-separated list in quotes',\n ],\n ['g', 'global', 'Setup global configuration (default: workspace-specific)'],\n ] as CommandOptions;\n\n constructor(private mcpServerMain: CliMcpServerMain) {}\n\n async report(\n [editor = 'vscode']: [string],\n { consumerProject, includeAdditional, global: isGlobal = false }: McpSetupCmdOptions\n ): Promise<string> {\n try {\n await this.mcpServerMain.setupEditor(editor, {\n consumerProject,\n includeAdditional,\n isGlobal,\n });\n\n const scope = isGlobal ? 'global' : 'workspace';\n const editorName = this.mcpServerMain.getEditorDisplayName(editor);\n\n // Get the config file path based on the editor type\n const configPath = this.mcpServerMain.getEditorConfigPath(editor, isGlobal);\n\n // Special message for Claude Code to mention restart requirement\n if (editor.toLowerCase() === 'claude-code') {\n return chalk.green(\n `✓ Successfully configured ${editorName} MCP integration (${scope})\\n` +\n ` Configuration written to: ${chalk.cyan(configPath)}\\n` +\n ` ${chalk.yellow('Note:')} Restart Claude Code to use the Bit MCP tools.`\n );\n }\n\n return chalk.green(\n `✓ Successfully configured ${editorName} MCP integration (${scope})\\n` +\n ` Configuration written to: ${chalk.cyan(configPath)}`\n );\n } catch (error) {\n const editorName = this.mcpServerMain.getEditorDisplayName(editor);\n return chalk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I,CAACX,aAAa,CAACY,oBAAoB,CAACR,MAAM,CAAC;MAClE,OAAOY,gBAAK,CAACK,GAAG,CAAC,oBAAoBV,UAAU,iBAAkBS,KAAK,CAAWE,OAAO,EAAE,CAAC;IAC7F;EACF;AACF;AAACC,OAAA,CAAAzB,WAAA,GAAAA,WAAA","ignoreList":[]}
|
package/dist/setup-utils.d.ts
CHANGED
|
@@ -103,4 +103,20 @@ export declare class McpSetupUtils {
|
|
|
103
103
|
* Get Cline prompts path based on global/workspace scope
|
|
104
104
|
*/
|
|
105
105
|
static getClinePromptsPath(isGlobal: boolean, workspaceDir?: string): string;
|
|
106
|
+
/**
|
|
107
|
+
* Get Claude Code mcp.json path based on global/workspace scope
|
|
108
|
+
*/
|
|
109
|
+
static getClaudeCodeSettingsPath(isGlobal: boolean, workspaceDir?: string): string;
|
|
110
|
+
/**
|
|
111
|
+
* Setup Claude Code MCP integration
|
|
112
|
+
*/
|
|
113
|
+
static setupClaudeCode(options: SetupOptions): Promise<void>;
|
|
114
|
+
/**
|
|
115
|
+
* Get Claude Code prompts path based on global/workspace scope
|
|
116
|
+
*/
|
|
117
|
+
static getClaudeCodePromptsPath(isGlobal: boolean, workspaceDir?: string): string;
|
|
118
|
+
/**
|
|
119
|
+
* Write Bit MCP rules file for Claude Code
|
|
120
|
+
*/
|
|
121
|
+
static writeClaudeCodeRules(options: RulesOptions): Promise<void>;
|
|
106
122
|
}
|
package/dist/setup-utils.js
CHANGED
|
@@ -86,6 +86,8 @@ class McpSetupUtils {
|
|
|
86
86
|
return 'Roo Code';
|
|
87
87
|
case 'cline':
|
|
88
88
|
return 'Cline';
|
|
89
|
+
case 'claude-code':
|
|
90
|
+
return 'Claude Code';
|
|
89
91
|
default:
|
|
90
92
|
return editor;
|
|
91
93
|
}
|
|
@@ -498,6 +500,113 @@ class McpSetupUtils {
|
|
|
498
500
|
return _path().default.join(targetDir, '.clinerules', 'bit.instructions.md');
|
|
499
501
|
}
|
|
500
502
|
}
|
|
503
|
+
|
|
504
|
+
/**
|
|
505
|
+
* Get Claude Code mcp.json path based on global/workspace scope
|
|
506
|
+
*/
|
|
507
|
+
static getClaudeCodeSettingsPath(isGlobal, workspaceDir) {
|
|
508
|
+
if (isGlobal) {
|
|
509
|
+
// Global Claude Code MCP configuration
|
|
510
|
+
const platform = process.platform;
|
|
511
|
+
switch (platform) {
|
|
512
|
+
case 'win32':
|
|
513
|
+
return _path().default.join((0, _os().homedir)(), 'AppData', 'Roaming', 'Claude', 'claude_desktop_config.json');
|
|
514
|
+
case 'darwin':
|
|
515
|
+
return _path().default.join((0, _os().homedir)(), 'Library', 'Application Support', 'Claude', 'claude_desktop_config.json');
|
|
516
|
+
case 'linux':
|
|
517
|
+
return _path().default.join((0, _os().homedir)(), '.config', 'claude', 'claude_desktop_config.json');
|
|
518
|
+
default:
|
|
519
|
+
throw new Error(`Unsupported platform: ${platform}`);
|
|
520
|
+
}
|
|
521
|
+
} else {
|
|
522
|
+
// Workspace-specific MCP configuration
|
|
523
|
+
const targetDir = workspaceDir || process.cwd();
|
|
524
|
+
return _path().default.join(targetDir, '.mcp.json');
|
|
525
|
+
}
|
|
526
|
+
}
|
|
527
|
+
|
|
528
|
+
/**
|
|
529
|
+
* Setup Claude Code MCP integration
|
|
530
|
+
*/
|
|
531
|
+
static async setupClaudeCode(options) {
|
|
532
|
+
const {
|
|
533
|
+
isGlobal,
|
|
534
|
+
workspaceDir
|
|
535
|
+
} = options;
|
|
536
|
+
|
|
537
|
+
// Determine mcp.json path
|
|
538
|
+
const mcpConfigPath = this.getClaudeCodeSettingsPath(isGlobal, workspaceDir);
|
|
539
|
+
|
|
540
|
+
// Ensure directory exists
|
|
541
|
+
await _fsExtra().default.ensureDir(_path().default.dirname(mcpConfigPath));
|
|
542
|
+
|
|
543
|
+
// Read existing MCP configuration or create empty object
|
|
544
|
+
const mcpConfig = await this.readJsonFile(mcpConfigPath);
|
|
545
|
+
|
|
546
|
+
// Build MCP server args
|
|
547
|
+
const args = this.buildMcpServerArgs(options);
|
|
548
|
+
|
|
549
|
+
// Create or update MCP configuration for Claude Code
|
|
550
|
+
if (!mcpConfig.mcpServers) {
|
|
551
|
+
mcpConfig.mcpServers = {};
|
|
552
|
+
}
|
|
553
|
+
mcpConfig.mcpServers.bit = {
|
|
554
|
+
command: 'bit',
|
|
555
|
+
args: args
|
|
556
|
+
};
|
|
557
|
+
|
|
558
|
+
// Write updated MCP configuration
|
|
559
|
+
await _fsExtra().default.writeFile(mcpConfigPath, JSON.stringify(mcpConfig, null, 2));
|
|
560
|
+
}
|
|
561
|
+
|
|
562
|
+
/**
|
|
563
|
+
* Get Claude Code prompts path based on global/workspace scope
|
|
564
|
+
*/
|
|
565
|
+
static getClaudeCodePromptsPath(isGlobal, workspaceDir) {
|
|
566
|
+
if (isGlobal) {
|
|
567
|
+
// Global Claude Code rules - using .claude directory
|
|
568
|
+
return _path().default.join((0, _os().homedir)(), '.claude', 'bit.md');
|
|
569
|
+
} else {
|
|
570
|
+
// Workspace-specific rules in .claude directory
|
|
571
|
+
const targetDir = workspaceDir || process.cwd();
|
|
572
|
+
return _path().default.join(targetDir, '.claude', 'bit.md');
|
|
573
|
+
}
|
|
574
|
+
}
|
|
575
|
+
|
|
576
|
+
/**
|
|
577
|
+
* Write Bit MCP rules file for Claude Code
|
|
578
|
+
*/
|
|
579
|
+
static async writeClaudeCodeRules(options) {
|
|
580
|
+
const {
|
|
581
|
+
isGlobal,
|
|
582
|
+
workspaceDir,
|
|
583
|
+
consumerProject = false
|
|
584
|
+
} = options;
|
|
585
|
+
|
|
586
|
+
// Determine prompts file path
|
|
587
|
+
const promptsPath = this.getClaudeCodePromptsPath(isGlobal, workspaceDir);
|
|
588
|
+
|
|
589
|
+
// Ensure directory exists
|
|
590
|
+
await _fsExtra().default.ensureDir(_path().default.dirname(promptsPath));
|
|
591
|
+
|
|
592
|
+
// Get base rules content
|
|
593
|
+
const rulesContent = await this.getDefaultRulesContent(consumerProject);
|
|
594
|
+
|
|
595
|
+
// Add integration instructions at the top
|
|
596
|
+
const integrationInstructions = `<!--
|
|
597
|
+
To use these Bit instructions, add the following to your main CLAUDE.md file:
|
|
598
|
+
|
|
599
|
+
@.claude/bit.md
|
|
600
|
+
|
|
601
|
+
This will automatically include all Bit-specific instructions in your Claude Code context.
|
|
602
|
+
-->
|
|
603
|
+
|
|
604
|
+
`;
|
|
605
|
+
const finalContent = integrationInstructions + rulesContent;
|
|
606
|
+
|
|
607
|
+
// Write rules content with integration instructions
|
|
608
|
+
await _fsExtra().default.writeFile(promptsPath, finalContent);
|
|
609
|
+
}
|
|
501
610
|
}
|
|
502
611
|
exports.McpSetupUtils = McpSetupUtils;
|
|
503
612
|
|
package/dist/setup-utils.js.map
CHANGED
|
@@ -1 +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,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,CAACU,IAAI,CAACE,SAAS,EAAE,aAAa,EAAE,qBAAqB,CAAC;IACnE;EACF;AACF;AAACsC,OAAA,CAAAnE,aAAA,GAAAA,aAAA","ignoreList":[]}
|
|
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","getClaudeCodeSettingsPath","setupClaudeCode","getClaudeCodePromptsPath","writeClaudeCodeRules","integrationInstructions","finalContent","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 case 'claude-code':\n return 'Claude Code';\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 /**\n * Get Claude Code mcp.json path based on global/workspace scope\n */\n static getClaudeCodeSettingsPath(isGlobal: boolean, workspaceDir?: string): string {\n if (isGlobal) {\n // Global Claude Code MCP configuration\n const platform = process.platform;\n switch (platform) {\n case 'win32':\n return path.join(homedir(), 'AppData', 'Roaming', 'Claude', 'claude_desktop_config.json');\n case 'darwin':\n return path.join(homedir(), 'Library', 'Application Support', 'Claude', 'claude_desktop_config.json');\n case 'linux':\n return path.join(homedir(), '.config', 'claude', 'claude_desktop_config.json');\n default:\n throw new Error(`Unsupported platform: ${platform}`);\n }\n } else {\n // Workspace-specific MCP configuration\n const targetDir = workspaceDir || process.cwd();\n return path.join(targetDir, '.mcp.json');\n }\n }\n\n /**\n * Setup Claude Code MCP integration\n */\n static async setupClaudeCode(options: SetupOptions): Promise<void> {\n const { isGlobal, workspaceDir } = options;\n\n // Determine mcp.json path\n const mcpConfigPath = this.getClaudeCodeSettingsPath(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 Claude Code\n if (!mcpConfig.mcpServers) {\n mcpConfig.mcpServers = {};\n }\n\n mcpConfig.mcpServers.bit = {\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 Claude Code prompts path based on global/workspace scope\n */\n static getClaudeCodePromptsPath(isGlobal: boolean, workspaceDir?: string): string {\n if (isGlobal) {\n // Global Claude Code rules - using .claude directory\n return path.join(homedir(), '.claude', 'bit.md');\n } else {\n // Workspace-specific rules in .claude directory\n const targetDir = workspaceDir || process.cwd();\n return path.join(targetDir, '.claude', 'bit.md');\n }\n }\n\n /**\n * Write Bit MCP rules file for Claude Code\n */\n static async writeClaudeCodeRules(options: RulesOptions): Promise<void> {\n const { isGlobal, workspaceDir, consumerProject = false } = options;\n\n // Determine prompts file path\n const promptsPath = this.getClaudeCodePromptsPath(isGlobal, workspaceDir);\n\n // Ensure directory exists\n await fs.ensureDir(path.dirname(promptsPath));\n\n // Get base rules content\n const rulesContent = await this.getDefaultRulesContent(consumerProject);\n\n // Add integration instructions at the top\n const integrationInstructions = `<!--\nTo use these Bit instructions, add the following to your main CLAUDE.md file:\n\n@.claude/bit.md\n\nThis will automatically include all Bit-specific instructions in your Claude Code context.\n-->\n\n`;\n\n const finalContent = integrationInstructions + rulesContent;\n\n // Write rules content with integration instructions\n await fs.writeFile(promptsPath, finalContent);\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,CAAC,oBAAoB,CAAC;IACjC;IAEA,IAAIF,iBAAiB,EAAE;MACrBC,IAAI,CAACC,IAAI,CAAC,sBAAsB,EAAEF,iBAAiB,CAAC;IACtD;IAEA,OAAOC,IAAI;EACb;;EAEA;AACF;AACA;EACE,aAAaE,YAAYA,CAACC,QAAgB,EAAgB;IACxD,IAAI,EAAE,MAAMC,kBAAE,CAACC,UAAU,CAACF,QAAQ,CAAC,CAAC,EAAE;MACpC,OAAO,CAAC,CAAC;IACX;IAEA,IAAI;MACF,MAAMG,OAAO,G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Q,EAAEC,YAAY,CAAC;;IAEzE;IACA,MAAMf,kBAAE,CAACyB,SAAS,CAACjB,eAAI,CAACkB,OAAO,CAACwB,WAAW,CAAC,CAAC;;IAE7C;IACA,MAAMC,YAAY,GAAG,MAAM,IAAI,CAACN,sBAAsB,CAACnD,eAAe,CAAC;;IAEvE;IACA,MAAMoE,uBAAuB,GAAG;AACpC;AACA;AACA;AACA;AACA;AACA;AACA;AACA,CAAC;IAEG,MAAMC,YAAY,GAAGD,uBAAuB,GAAGX,YAAY;;IAE3D;IACA,MAAMnD,kBAAE,CAACgC,SAAS,CAACkB,WAAW,EAAEa,YAAY,CAAC;EAC/C;AACF;AAACC,OAAA,CAAAzE,aAAA,GAAAA,aAAA","ignoreList":[]}
|
package/package.json
CHANGED
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@teambit/cli-mcp-server",
|
|
3
|
-
"version": "0.0.
|
|
3
|
+
"version": "0.0.39",
|
|
4
4
|
"homepage": "https://bit.cloud/teambit/mcp/cli-mcp-server",
|
|
5
5
|
"main": "dist/index.js",
|
|
6
6
|
"componentId": {
|
|
7
7
|
"scope": "teambit.mcp",
|
|
8
8
|
"name": "cli-mcp-server",
|
|
9
|
-
"version": "0.0.
|
|
9
|
+
"version": "0.0.39"
|
|
10
10
|
},
|
|
11
11
|
"dependencies": {
|
|
12
12
|
"comment-json": "4.2.5",
|