@teambit/cli-mcp-server 0.0.11 → 0.0.13

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 CHANGED
@@ -37,42 +37,61 @@ Options:
37
37
  - `--include-additional <commands>`: Add specific commands to the default set (comma-separated list)
38
38
  - `--exclude <commands>`: Prevent specific commands from being exposed (comma-separated list)
39
39
 
40
- ### Integrating with VS Code
40
+ ### Integrating with IDEs
41
41
 
42
- To use this MCP server in VS Code:
42
+ The easiest way to integrate the MCP server with your IDE is to use the `setup` command:
43
43
 
44
- 1. Open VS Code settings (JSON) by pressing `Ctrl + Shift + P` and typing `Preferences: Open Settings (JSON)`
45
- 2. Add the following JSON block:
44
+ ```bash
45
+ # Basic setup for VS Code (default)
46
+ bit mcp-server setup
47
+ ```
46
48
 
47
- ```json
48
- {
49
- "mcp": {
50
- "servers": {
51
- "bit-cli": {
52
- "command": "bit",
53
- "args": ["mcp-server"]
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
- For extended mode with all commands available:
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
- ```json
63
- {
64
- "mcp": {
65
- "servers": {
66
- "bit-cli": {
67
- "command": "bit",
68
- "args": ["mcp-server", "--extended"]
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 default set
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
- For consumer projects that only use Bit component packages:
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", "--consumer-project"]
102
+ "args": ["mcp-server"]
84
103
  }
85
104
  }
86
105
  }
@@ -122,7 +141,10 @@ In default mode, the server exposes a minimal set of essential tools focused on
122
141
 
123
142
  - `bit_workspace_info`: Get comprehensive workspace information including status, components list, apps, templates, and dependency graph
124
143
  - `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
144
+ - `bit_commands_list`: Get all available Bit commands with descriptions and groups (for command discovery)
145
+ - `bit_command_help`: Get detailed help for a specific Bit command including syntax, arguments, flags, and usage examples
146
+
147
+ > **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.
126
148
 
127
149
  - **Generic Execution Tools:**
128
150
  - `bit_query`: Execute read-only Bit commands that safely inspect workspace and component state without making modifications
@@ -37,42 +37,61 @@ Options:
37
37
  - `--include-additional <commands>`: Add specific commands to the default set (comma-separated list)
38
38
  - `--exclude <commands>`: Prevent specific commands from being exposed (comma-separated list)
39
39
 
40
- ### Integrating with VS Code
40
+ ### Integrating with IDEs
41
41
 
42
- To use this MCP server in VS Code:
42
+ The easiest way to integrate the MCP server with your IDE is to use the `setup` command:
43
43
 
44
- 1. Open VS Code settings (JSON) by pressing `Ctrl + Shift + P` and typing `Preferences: Open Settings (JSON)`
45
- 2. Add the following JSON block:
44
+ ```bash
45
+ # Basic setup for VS Code (default)
46
+ bit mcp-server setup
47
+ ```
46
48
 
47
- ```json
48
- {
49
- "mcp": {
50
- "servers": {
51
- "bit-cli": {
52
- "command": "bit",
53
- "args": ["mcp-server"]
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
- For extended mode with all commands available:
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
- ```json
63
- {
64
- "mcp": {
65
- "servers": {
66
- "bit-cli": {
67
- "command": "bit",
68
- "args": ["mcp-server", "--extended"]
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 default set
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
- For consumer projects that only use Bit component packages:
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", "--consumer-project"]
102
+ "args": ["mcp-server"]
84
103
  }
85
104
  }
86
105
  }
@@ -122,7 +141,10 @@ In default mode, the server exposes a minimal set of essential tools focused on
122
141
 
123
142
  - `bit_workspace_info`: Get comprehensive workspace information including status, components list, apps, templates, and dependency graph
124
143
  - `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
144
+ - `bit_commands_list`: Get all available Bit commands with descriptions and groups (for command discovery)
145
+ - `bit_command_help`: Get detailed help for a specific Bit command including syntax, arguments, flags, and usage examples
146
+
147
+ > **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.
126
148
 
127
149
  - **Generic Execution Tools:**
128
150
  - `bit_query`: Execute read-only Bit commands that safely inspect workspace and component state without making modifications
@@ -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;
@@ -22,6 +23,14 @@ export declare class CliMcpServerMain {
22
23
  * Call bit-server API endpoint using cli-raw route
23
24
  */
24
25
  private callBitServerAPI;
26
+ /**
27
+ * Call bit-server API endpoint using IDE route
28
+ */
29
+ private callBitServerIDEAPI;
30
+ /**
31
+ * Generic method to call bit-server API with different routes
32
+ */
33
+ private callBitServerAPIWithRoute;
25
34
  runMcpServer(options: {
26
35
  extended?: boolean;
27
36
  includeOnly?: string;
@@ -39,7 +48,8 @@ export declare class CliMcpServerMain {
39
48
  private registerRemoteSearchTool;
40
49
  private registerWorkspaceInfoTool;
41
50
  private registerComponentDetailsTool;
42
- private registerCommandsInfoTool;
51
+ private registerCommandsListTool;
52
+ private registerCommandHelpTool;
43
53
  private registerQueryTool;
44
54
  private registerExecuteTool;
45
55
  private processSubCommands;
@@ -60,6 +70,8 @@ export declare class CliMcpServerMain {
60
70
  * Helper method to safely execute a bit command with error handling
61
71
  */
62
72
  private safeBitCommandExecution;
73
+ getEditorDisplayName(editor: string): string;
74
+ setupEditor(editor: string, options: SetupOptions, workspaceDir?: string): Promise<void>;
63
75
  static slots: never[];
64
76
  static dependencies: import("@teambit/harmony").Aspect[];
65
77
  static runtime: import("@teambit/harmony").RuntimeDefinition;