@teambit/cli-mcp-server 0.0.12 → 0.0.14
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 +57 -43
- package/dist/README.docs.mdx +57 -43
- package/dist/cli-mcp-server.main.runtime.d.ts +5 -2
- package/dist/cli-mcp-server.main.runtime.js +176 -119
- package/dist/cli-mcp-server.main.runtime.js.map +1 -1
- package/dist/cli-mcp-server.spec.d.ts +1 -0
- package/dist/cli-mcp-server.spec.js +532 -0
- package/dist/cli-mcp-server.spec.js.map +1 -0
- package/dist/mcp-server.cmd.d.ts +15 -2
- package/dist/mcp-server.cmd.js +29 -2
- package/dist/mcp-server.cmd.js.map +1 -1
- package/dist/{preview-1748661443929.js → preview-1749093562468.js} +1 -1
- package/dist/setup-cmd.d.ts +23 -0
- package/dist/setup-cmd.js +58 -0
- package/dist/setup-cmd.js.map +1 -0
- package/dist/setup-utils.d.ts +53 -0
- package/dist/setup-utils.js +259 -0
- package/dist/setup-utils.js.map +1 -0
- package/package.json +17 -6
package/README.docs.mdx
CHANGED
|
@@ -34,45 +34,64 @@ Options:
|
|
|
34
34
|
- `-e, --extended`: Enable the full set of Bit CLI commands as MCP tools
|
|
35
35
|
- `--consumer-project`: For non-Bit workspaces that only consume Bit component packages. Enables only "schema", "show", and "remote-search" tools and automatically adds the "--remote" flag to relevant commands.
|
|
36
36
|
- `--include-only <commands>`: Specify a subset of commands to expose as MCP tools (comma-separated list)
|
|
37
|
-
- `--include-additional <commands>`: Add specific commands to the
|
|
37
|
+
- `--include-additional <commands>`: Add specific commands to the available tools (comma-separated list)
|
|
38
38
|
- `--exclude <commands>`: Prevent specific commands from being exposed (comma-separated list)
|
|
39
39
|
|
|
40
|
-
### Integrating with
|
|
40
|
+
### Integrating with IDEs
|
|
41
41
|
|
|
42
|
-
|
|
42
|
+
The easiest way to integrate the MCP server with your IDE is to use the `setup` command:
|
|
43
43
|
|
|
44
|
-
|
|
45
|
-
|
|
44
|
+
```bash
|
|
45
|
+
# Basic setup for VS Code (default)
|
|
46
|
+
bit mcp-server setup
|
|
47
|
+
```
|
|
46
48
|
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
}
|
|
56
|
-
}
|
|
57
|
-
}
|
|
49
|
+
This will automatically configure your VS Code settings to use the Bit MCP server. See the [Automatic Setup](#automatic-integration-setup) section below for more options.
|
|
50
|
+
|
|
51
|
+
### Automatic Integration Setup
|
|
52
|
+
|
|
53
|
+
The **recommended way** to integrate the MCP server with your IDE is using the `setup` command:
|
|
54
|
+
|
|
55
|
+
```bash
|
|
56
|
+
bit mcp-server setup [vscode|cursor|windsurf] [options]
|
|
58
57
|
```
|
|
59
58
|
|
|
60
|
-
|
|
59
|
+
This command automatically configures the MCP server settings in your chosen editor. If no editor is specified, it defaults to VS Code.
|
|
61
60
|
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
61
|
+
#### Supported Editors
|
|
62
|
+
|
|
63
|
+
- **VS Code**: `bit mcp-server setup vscode` (or just `bit mcp-server setup`)
|
|
64
|
+
- **Cursor**: `bit mcp-server setup cursor`
|
|
65
|
+
- **Windsurf**: `bit mcp-server setup windsurf`
|
|
66
|
+
|
|
67
|
+
#### Configuration Options
|
|
68
|
+
|
|
69
|
+
- `--global`: Apply configuration globally (user settings) instead of workspace settings
|
|
70
|
+
- `--extended`: Configure with extended mode enabled
|
|
71
|
+
- `--consumer-project`: Configure for consumer projects
|
|
72
|
+
- `--include-only <commands>`: Specify subset of commands to expose
|
|
73
|
+
- `--include-additional <commands>`: Add specific commands to the available tools
|
|
74
|
+
- `--exclude <commands>`: Prevent specific commands from being exposed
|
|
75
|
+
|
|
76
|
+
#### Examples
|
|
77
|
+
|
|
78
|
+
```bash
|
|
79
|
+
# Basic VS Code setup (workspace level)
|
|
80
|
+
bit mcp-server setup
|
|
81
|
+
|
|
82
|
+
# Global setup for Cursor with extended mode
|
|
83
|
+
bit mcp-server setup cursor --global --extended
|
|
84
|
+
|
|
85
|
+
# Setup for Windsurf with consumer project mode
|
|
86
|
+
bit mcp-server setup windsurf --consumer-project
|
|
73
87
|
```
|
|
74
88
|
|
|
75
|
-
|
|
89
|
+
#### Manual Configuration
|
|
90
|
+
|
|
91
|
+
If you need to manually configure the settings, here's a basic example for VS Code:
|
|
92
|
+
|
|
93
|
+
1. Open VS Code settings (JSON) by pressing `Ctrl + Shift + P` (or `Cmd + Shift + P` on macOS) and typing `Preferences: Open Settings (JSON)`
|
|
94
|
+
2. Add the following configuration:
|
|
76
95
|
|
|
77
96
|
```json
|
|
78
97
|
{
|
|
@@ -80,7 +99,7 @@ For consumer projects that only use Bit component packages:
|
|
|
80
99
|
"servers": {
|
|
81
100
|
"bit-cli": {
|
|
82
101
|
"command": "bit",
|
|
83
|
-
"args": ["mcp-server"
|
|
102
|
+
"args": ["mcp-server"]
|
|
84
103
|
}
|
|
85
104
|
}
|
|
86
105
|
}
|
|
@@ -110,23 +129,19 @@ The Bit CLI MCP Server operates in three modes and provides several specialized
|
|
|
110
129
|
|
|
111
130
|
### Default Mode
|
|
112
131
|
|
|
113
|
-
In default mode, the server exposes a minimal set of essential tools focused on
|
|
132
|
+
In default mode, the server exposes a minimal set of essential tools focused on core functionality. This ensures optimal performance and safety:
|
|
114
133
|
|
|
115
|
-
- **
|
|
134
|
+
- **Always Available Tools:**
|
|
116
135
|
|
|
117
|
-
- `bit_create`: Generate components from templates
|
|
118
|
-
- `bit_schema`: Retrieve component API schema from workspace or remote scopes
|
|
119
136
|
- `bit_remote_search`: Search for components in remote scopes
|
|
120
|
-
|
|
121
|
-
- **Specialized Composite Tools:**
|
|
122
|
-
|
|
123
137
|
- `bit_workspace_info`: Get comprehensive workspace information including status, components list, apps, templates, and dependency graph
|
|
124
138
|
- `bit_component_details`: Get detailed information about a specific component including basic info and optionally its public API schema
|
|
125
|
-
- `bit_commands_info`: Get information about available Bit commands and their groups
|
|
126
|
-
|
|
127
|
-
- **Generic Execution Tools:**
|
|
128
139
|
- `bit_query`: Execute read-only Bit commands that safely inspect workspace and component state without making modifications
|
|
129
140
|
- `bit_execute`: Execute any Bit command, including those that modify workspace or repository state (use with caution)
|
|
141
|
+
- `bit_commands_list`: Get all available Bit commands with descriptions and groups (for command discovery)
|
|
142
|
+
- `bit_command_help`: Get detailed help for a specific Bit command including syntax, arguments, flags, and usage examples
|
|
143
|
+
|
|
144
|
+
> **Command Discovery vs. Command Help**: Use `bit_commands_list` to discover what commands are available in Bit, then use `bit_command_help` with a specific command name to get detailed usage information including arguments, flags, and examples.
|
|
130
145
|
|
|
131
146
|
### Consumer Project Mode (--consumer-project)
|
|
132
147
|
|
|
@@ -134,7 +149,6 @@ This mode is designed for applications or projects that are not Bit workspaces b
|
|
|
134
149
|
|
|
135
150
|
- `bit_schema`: Retrieves component API schema from remote scopes (automatically adds `--remote` flag)
|
|
136
151
|
- `bit_show`: Displays component information from remote scopes (automatically adds `--remote` flag)
|
|
137
|
-
- `bit_remote_search`: Searches for components in remote scopes
|
|
138
152
|
|
|
139
153
|
In this mode:
|
|
140
154
|
|
|
@@ -179,8 +193,8 @@ To customize the available tools beyond the default set or extended mode:
|
|
|
179
193
|
# Include only specific tools
|
|
180
194
|
bit mcp-server --include-only "status,show,tag,snap,import,export"
|
|
181
195
|
|
|
182
|
-
# Add specific tools to the
|
|
183
|
-
bit mcp-server --include-additional "build,lint,format"
|
|
196
|
+
# Add specific tools to the available tools
|
|
197
|
+
bit mcp-server --include-additional "build,lint,format,create,schema"
|
|
184
198
|
|
|
185
199
|
# For consumer projects (non-Bit workspaces)
|
|
186
200
|
bit mcp-server --consumer-project
|
package/dist/README.docs.mdx
CHANGED
|
@@ -34,45 +34,64 @@ Options:
|
|
|
34
34
|
- `-e, --extended`: Enable the full set of Bit CLI commands as MCP tools
|
|
35
35
|
- `--consumer-project`: For non-Bit workspaces that only consume Bit component packages. Enables only "schema", "show", and "remote-search" tools and automatically adds the "--remote" flag to relevant commands.
|
|
36
36
|
- `--include-only <commands>`: Specify a subset of commands to expose as MCP tools (comma-separated list)
|
|
37
|
-
- `--include-additional <commands>`: Add specific commands to the
|
|
37
|
+
- `--include-additional <commands>`: Add specific commands to the available tools (comma-separated list)
|
|
38
38
|
- `--exclude <commands>`: Prevent specific commands from being exposed (comma-separated list)
|
|
39
39
|
|
|
40
|
-
### Integrating with
|
|
40
|
+
### Integrating with IDEs
|
|
41
41
|
|
|
42
|
-
|
|
42
|
+
The easiest way to integrate the MCP server with your IDE is to use the `setup` command:
|
|
43
43
|
|
|
44
|
-
|
|
45
|
-
|
|
44
|
+
```bash
|
|
45
|
+
# Basic setup for VS Code (default)
|
|
46
|
+
bit mcp-server setup
|
|
47
|
+
```
|
|
46
48
|
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
}
|
|
56
|
-
}
|
|
57
|
-
}
|
|
49
|
+
This will automatically configure your VS Code settings to use the Bit MCP server. See the [Automatic Setup](#automatic-integration-setup) section below for more options.
|
|
50
|
+
|
|
51
|
+
### Automatic Integration Setup
|
|
52
|
+
|
|
53
|
+
The **recommended way** to integrate the MCP server with your IDE is using the `setup` command:
|
|
54
|
+
|
|
55
|
+
```bash
|
|
56
|
+
bit mcp-server setup [vscode|cursor|windsurf] [options]
|
|
58
57
|
```
|
|
59
58
|
|
|
60
|
-
|
|
59
|
+
This command automatically configures the MCP server settings in your chosen editor. If no editor is specified, it defaults to VS Code.
|
|
61
60
|
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
61
|
+
#### Supported Editors
|
|
62
|
+
|
|
63
|
+
- **VS Code**: `bit mcp-server setup vscode` (or just `bit mcp-server setup`)
|
|
64
|
+
- **Cursor**: `bit mcp-server setup cursor`
|
|
65
|
+
- **Windsurf**: `bit mcp-server setup windsurf`
|
|
66
|
+
|
|
67
|
+
#### Configuration Options
|
|
68
|
+
|
|
69
|
+
- `--global`: Apply configuration globally (user settings) instead of workspace settings
|
|
70
|
+
- `--extended`: Configure with extended mode enabled
|
|
71
|
+
- `--consumer-project`: Configure for consumer projects
|
|
72
|
+
- `--include-only <commands>`: Specify subset of commands to expose
|
|
73
|
+
- `--include-additional <commands>`: Add specific commands to the available tools
|
|
74
|
+
- `--exclude <commands>`: Prevent specific commands from being exposed
|
|
75
|
+
|
|
76
|
+
#### Examples
|
|
77
|
+
|
|
78
|
+
```bash
|
|
79
|
+
# Basic VS Code setup (workspace level)
|
|
80
|
+
bit mcp-server setup
|
|
81
|
+
|
|
82
|
+
# Global setup for Cursor with extended mode
|
|
83
|
+
bit mcp-server setup cursor --global --extended
|
|
84
|
+
|
|
85
|
+
# Setup for Windsurf with consumer project mode
|
|
86
|
+
bit mcp-server setup windsurf --consumer-project
|
|
73
87
|
```
|
|
74
88
|
|
|
75
|
-
|
|
89
|
+
#### Manual Configuration
|
|
90
|
+
|
|
91
|
+
If you need to manually configure the settings, here's a basic example for VS Code:
|
|
92
|
+
|
|
93
|
+
1. Open VS Code settings (JSON) by pressing `Ctrl + Shift + P` (or `Cmd + Shift + P` on macOS) and typing `Preferences: Open Settings (JSON)`
|
|
94
|
+
2. Add the following configuration:
|
|
76
95
|
|
|
77
96
|
```json
|
|
78
97
|
{
|
|
@@ -80,7 +99,7 @@ For consumer projects that only use Bit component packages:
|
|
|
80
99
|
"servers": {
|
|
81
100
|
"bit-cli": {
|
|
82
101
|
"command": "bit",
|
|
83
|
-
"args": ["mcp-server"
|
|
102
|
+
"args": ["mcp-server"]
|
|
84
103
|
}
|
|
85
104
|
}
|
|
86
105
|
}
|
|
@@ -110,23 +129,19 @@ The Bit CLI MCP Server operates in three modes and provides several specialized
|
|
|
110
129
|
|
|
111
130
|
### Default Mode
|
|
112
131
|
|
|
113
|
-
In default mode, the server exposes a minimal set of essential tools focused on
|
|
132
|
+
In default mode, the server exposes a minimal set of essential tools focused on core functionality. This ensures optimal performance and safety:
|
|
114
133
|
|
|
115
|
-
- **
|
|
134
|
+
- **Always Available Tools:**
|
|
116
135
|
|
|
117
|
-
- `bit_create`: Generate components from templates
|
|
118
|
-
- `bit_schema`: Retrieve component API schema from workspace or remote scopes
|
|
119
136
|
- `bit_remote_search`: Search for components in remote scopes
|
|
120
|
-
|
|
121
|
-
- **Specialized Composite Tools:**
|
|
122
|
-
|
|
123
137
|
- `bit_workspace_info`: Get comprehensive workspace information including status, components list, apps, templates, and dependency graph
|
|
124
138
|
- `bit_component_details`: Get detailed information about a specific component including basic info and optionally its public API schema
|
|
125
|
-
- `bit_commands_info`: Get information about available Bit commands and their groups
|
|
126
|
-
|
|
127
|
-
- **Generic Execution Tools:**
|
|
128
139
|
- `bit_query`: Execute read-only Bit commands that safely inspect workspace and component state without making modifications
|
|
129
140
|
- `bit_execute`: Execute any Bit command, including those that modify workspace or repository state (use with caution)
|
|
141
|
+
- `bit_commands_list`: Get all available Bit commands with descriptions and groups (for command discovery)
|
|
142
|
+
- `bit_command_help`: Get detailed help for a specific Bit command including syntax, arguments, flags, and usage examples
|
|
143
|
+
|
|
144
|
+
> **Command Discovery vs. Command Help**: Use `bit_commands_list` to discover what commands are available in Bit, then use `bit_command_help` with a specific command name to get detailed usage information including arguments, flags, and examples.
|
|
130
145
|
|
|
131
146
|
### Consumer Project Mode (--consumer-project)
|
|
132
147
|
|
|
@@ -134,7 +149,6 @@ This mode is designed for applications or projects that are not Bit workspaces b
|
|
|
134
149
|
|
|
135
150
|
- `bit_schema`: Retrieves component API schema from remote scopes (automatically adds `--remote` flag)
|
|
136
151
|
- `bit_show`: Displays component information from remote scopes (automatically adds `--remote` flag)
|
|
137
|
-
- `bit_remote_search`: Searches for components in remote scopes
|
|
138
152
|
|
|
139
153
|
In this mode:
|
|
140
154
|
|
|
@@ -179,8 +193,8 @@ To customize the available tools beyond the default set or extended mode:
|
|
|
179
193
|
# Include only specific tools
|
|
180
194
|
bit mcp-server --include-only "status,show,tag,snap,import,export"
|
|
181
195
|
|
|
182
|
-
# Add specific tools to the
|
|
183
|
-
bit mcp-server --include-additional "build,lint,format"
|
|
196
|
+
# Add specific tools to the available tools
|
|
197
|
+
bit mcp-server --include-additional "build,lint,format,create,schema"
|
|
184
198
|
|
|
185
199
|
# For consumer projects (non-Bit workspaces)
|
|
186
200
|
bit mcp-server --consumer-project
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import { CLIMain } from '@teambit/cli';
|
|
2
2
|
import { Logger, LoggerMain } from '@teambit/logger';
|
|
3
3
|
import { Http } from '@teambit/scope.network';
|
|
4
|
+
import { SetupOptions } from './setup-utils';
|
|
4
5
|
export declare class CliMcpServerMain {
|
|
5
6
|
private cli;
|
|
6
7
|
private logger;
|
|
@@ -43,11 +44,11 @@ export declare class CliMcpServerMain {
|
|
|
43
44
|
private buildCommandArgs;
|
|
44
45
|
private getToolName;
|
|
45
46
|
private registerToolForCommand;
|
|
46
|
-
private registerToolForRemote;
|
|
47
47
|
private registerRemoteSearchTool;
|
|
48
48
|
private registerWorkspaceInfoTool;
|
|
49
49
|
private registerComponentDetailsTool;
|
|
50
|
-
private
|
|
50
|
+
private registerCommandsListTool;
|
|
51
|
+
private registerCommandHelpTool;
|
|
51
52
|
private registerQueryTool;
|
|
52
53
|
private registerExecuteTool;
|
|
53
54
|
private processSubCommands;
|
|
@@ -68,6 +69,8 @@ export declare class CliMcpServerMain {
|
|
|
68
69
|
* Helper method to safely execute a bit command with error handling
|
|
69
70
|
*/
|
|
70
71
|
private safeBitCommandExecution;
|
|
72
|
+
getEditorDisplayName(editor: string): string;
|
|
73
|
+
setupEditor(editor: string, options: SetupOptions, workspaceDir?: string): Promise<void>;
|
|
71
74
|
static slots: never[];
|
|
72
75
|
static dependencies: import("@teambit/harmony").Aspect[];
|
|
73
76
|
static runtime: import("@teambit/harmony").RuntimeDefinition;
|