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

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -0,0 +1,250 @@
1
+ # Bit CLI MCP Server
2
+
3
+ The Bit CLI MCP Server provides a [Model Context Protocol (MCP)](https://github.com/modelcontextprotocol/mcp) interface to Bit's command-line functionality, enabling programmatic access to Bit workspace and component management operations. This server exposes Bit CLI commands as MCP tools, making it possible to automate, script, or integrate Bit operations with other tools and platforms.
4
+
5
+ ## Overview
6
+
7
+ This server acts as a bridge between MCP clients (such as VS Code, AI tools, or your own applications) and the Bit CLI. It leverages the Bit server API for efficient communication and provides both individual CLI command tools and specialized composite tools for common workflows. The server automatically manages a Bit server instance in the background for optimal performance.
8
+
9
+ ## Installation
10
+
11
+ ### Prerequisites
12
+
13
+ - Node.js (v18 or later recommended)
14
+ - Bit CLI installed and available in your PATH
15
+
16
+ ### Getting Started
17
+
18
+ The Bit CLI MCP Server is included with Bit. If you have Bit installed, you can run the server using:
19
+
20
+ ```
21
+ bit mcp-server start
22
+ ```
23
+
24
+ ## Usage
25
+
26
+ ### Command-Line Options
27
+
28
+ ```
29
+ bit mcp-server start [options]
30
+ ```
31
+
32
+ Options:
33
+
34
+ - `--consumer-project`: For non-Bit workspaces that only consume Bit component packages. Enables only "bit_remote_search" and "bit_remote_component_details" tools and automatically adds the "--remote" flag to relevant commands.
35
+ - `--include-additional <commands>`: Add specific commands to the available tools (comma-separated list)
36
+
37
+ ### Integrating with IDEs
38
+
39
+ The easiest way to integrate the MCP server with your IDE is to use the `setup` command:
40
+
41
+ ```bash
42
+ # Basic setup for VS Code (default)
43
+ bit mcp-server setup
44
+ ```
45
+
46
+ 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.
47
+
48
+ ### Automatic Integration Setup
49
+
50
+ The **recommended way** to integrate the MCP server with your IDE is using the `setup` command:
51
+
52
+ ```bash
53
+ bit mcp-server setup [vscode|cursor|windsurf] [options]
54
+ ```
55
+
56
+ This command automatically configures the MCP server settings in your chosen editor. If no editor is specified, it defaults to VS Code.
57
+
58
+ #### Supported Editors
59
+
60
+ - **VS Code**: `bit mcp-server setup vscode` (or just `bit mcp-server setup`)
61
+ - **Cursor**: `bit mcp-server setup cursor`
62
+ - **Windsurf**: `bit mcp-server setup windsurf`
63
+
64
+ #### Configuration Options
65
+
66
+ - `--global`: Apply configuration globally (user settings) instead of workspace settings
67
+ - `--consumer-project`: Configure for consumer projects
68
+ - `--include-additional <commands>`: Add specific commands to the available tools
69
+
70
+ #### Examples
71
+
72
+ ```bash
73
+ # Basic VS Code setup (workspace level)
74
+ bit mcp-server setup
75
+
76
+ # Global setup for Cursor
77
+ bit mcp-server setup cursor --global
78
+
79
+ # Setup with consumer project mode
80
+ bit mcp-server setup --consumer-project
81
+ ```
82
+
83
+ #### Manual Configuration
84
+
85
+ If you need to manually configure the settings, here's how to set up VS Code MCP integration:
86
+
87
+ **For workspace-specific configuration:**
88
+
89
+ 1. Create a `.vscode/mcp.json` file in your workspace folder
90
+ 2. Add the following configuration:
91
+
92
+ ```json
93
+ {
94
+ "servers": {
95
+ "bit-cli": {
96
+ "type": "stdio",
97
+ "command": "bit",
98
+ "args": ["mcp-server", "start"]
99
+ }
100
+ }
101
+ }
102
+ ```
103
+
104
+ **For global configuration:**
105
+
106
+ 1. Open VS Code settings (JSON) by pressing `Ctrl + Shift + P` (or `Cmd + Shift + P` on macOS) and typing `Preferences: Open Settings (JSON)`
107
+ 2. Add the following configuration:
108
+
109
+ ```json
110
+ {
111
+ "mcp": {
112
+ "servers": {
113
+ "bit-cli": {
114
+ "type": "stdio",
115
+ "command": "bit",
116
+ "args": ["mcp-server", "start"]
117
+ }
118
+ }
119
+ }
120
+ }
121
+ ```
122
+
123
+ ### Programmatic Usage
124
+
125
+ ```javascript
126
+ import { McpClient } from '@modelcontextprotocol/sdk/client';
127
+
128
+ async function example() {
129
+ const client = await McpClient.spawn('bit', ['mcp-server', 'start']);
130
+
131
+ // Call a Bit CLI tool via MCP
132
+ const result = await client.callTool('bit_status', { cwd: '/path/to/workspace' });
133
+ console.log(result.content[0].text);
134
+
135
+ // Close the connection when done
136
+ await client.close();
137
+ }
138
+ ```
139
+
140
+ ## Available Tools
141
+
142
+ The Bit CLI MCP Server operates in two modes and provides several specialized tools:
143
+
144
+ ### Default Mode
145
+
146
+ In default mode, the server exposes a minimal set of essential tools focused on core functionality. This ensures optimal performance and safety:
147
+
148
+ - **Always Available Tools:**
149
+
150
+ - `bit_remote_search`: Search for components in remote scopes
151
+ - `bit_workspace_info`: Get comprehensive workspace information including status, components list, apps, templates, and dependency graph
152
+ - `bit_component_details`: Get detailed information about a specific component including basic info and optionally its public API schema
153
+ - `bit_query`: Execute read-only Bit commands that safely inspect workspace and component state without making modifications
154
+ - `bit_execute`: Execute any Bit command, including those that modify workspace or repository state (use with caution)
155
+ - `bit_commands_list`: Get all available Bit commands with descriptions and groups (for command discovery)
156
+ - `bit_command_help`: Get detailed help for a specific Bit command including syntax, arguments, flags, and usage examples
157
+
158
+ > **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.
159
+
160
+ ### Consumer Project Mode (--consumer-project)
161
+
162
+ This mode is designed for applications or projects that are not Bit workspaces but need to consume or work with Bit components as packages. It provides a minimal set of tools focused on component discovery and information:
163
+
164
+ - `bit_remote_search`: Search for components in remote scopes
165
+ - `bit_remote_component_details`: Get detailed information about a remote component including basic info and its public API schema (combines the functionality of show and schema commands)
166
+
167
+ In this mode:
168
+
169
+ 1. You don't need a Bit workspace initialization
170
+ 2. Only these 2 tools are available (no workspace-specific tools)
171
+ 3. The `--remote` flag is automatically added to component detail queries
172
+ 4. The `cwd` parameter is still required but can be any directory (not necessarily a Bit workspace)
173
+ 5. You can still add additional tools with the `--include-additional` flag
174
+
175
+ ## Tool Parameters
176
+
177
+ All tools accept a `cwd` parameter specifying the workspace path. Additional parameters vary by command.
178
+
179
+ Example tool call for `bit_status`:
180
+
181
+ ```json
182
+ {
183
+ "cwd": "/path/to/workspace",
184
+ "warnings": true,
185
+ "json": true
186
+ }
187
+ ```
188
+
189
+ ## Custom Tool Selection
190
+
191
+ To customize the available tools:
192
+
193
+ ```
194
+ # Add specific tools to the available tools
195
+ bit mcp-server start --include-additional "build,lint,format,create,schema"
196
+
197
+ # For consumer projects (non-Bit workspaces)
198
+ bit mcp-server start --consumer-project
199
+
200
+ # Add specific tools to the consumer project set
201
+ bit mcp-server start --consumer-project --include-additional "deps,get,preview"
202
+ ```
203
+
204
+ ### Writing AI Assistant Rules
205
+
206
+ The MCP server provides a `rules` command to create instruction files for AI assistants:
207
+
208
+ ```bash
209
+ bit mcp-server rules [vscode|cursor|windsurf|cline] [options]
210
+ ```
211
+
212
+ 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.
213
+
214
+ #### Supported Editors
215
+
216
+ - **VS Code**: `bit mcp-server rules vscode` (or just `bit mcp-server rules`)
217
+ - **Cursor**: `bit mcp-server rules cursor`
218
+ - **Windsurf**: `bit mcp-server rules windsurf`
219
+ - **Cline**: `bit mcp-server rules cline`
220
+
221
+ #### Configuration Options
222
+
223
+ - `--global`: Write rules to global configuration (default: workspace-specific)
224
+ - `--print`: Print rules content to screen instead of writing to file
225
+ - `--consumer-project`: Generate rules for consumer projects that only use Bit components as packages
226
+
227
+ #### Examples
228
+
229
+ ```bash
230
+ # Basic VS Code rules (workspace level)
231
+ bit mcp-server rules
232
+
233
+ # Global rules for Cursor
234
+ bit mcp-server rules cursor --global
235
+
236
+ # Consumer project rules for VS Code
237
+ bit mcp-server rules --consumer-project
238
+
239
+ # Global rules for Cline (macOS only)
240
+ bit mcp-server rules cline --global
241
+
242
+ # Workspace-specific rules for Cline
243
+ bit mcp-server rules cline
244
+
245
+ # Print rules content to screen for manual setup
246
+ bit mcp-server rules --print
247
+
248
+ # Print consumer project content for Windsurf (requires manual addition to .windsurfrules)
249
+ bit mcp-server rules windsurf --print --consumer-project
250
+ ```
@@ -0,0 +1,11 @@
1
+ ---
2
+ applyTo: '**'
3
+ ---
4
+
5
+ ## How to Install and Use Bit Components
6
+
7
+ - Bit Components are reusable pieces of code in the form of node packages.
8
+ - Search for Bit Components using `bit_remote_search` tool.
9
+ - Use `bit_remote_component_details` only on Bit Components to get information like package name (to use when installing, e.g. `npm install <package-name>`), APIs and documentation (to use when using in code).
10
+ - If a user is requesting functionality, you can search if there are available components that implement it using `bit_remote_search`.
11
+ - Filter my search with my account name "ACCOUNT" to find components you have created or are a maintainer of.
@@ -0,0 +1,115 @@
1
+ ---
2
+ applyTo: '**'
3
+ ---
4
+
5
+ # Bit MCP Agent Instructions
6
+
7
+ ## Core Objectives
8
+
9
+ - Your goal is to efficiently automate Bit workflows and help users manage and reuse components.
10
+ - You will achieve this by using the provided MCP tools and adhering strictly to the following rules and workflows.
11
+
12
+ ## Core Philosophy for Building with Bit
13
+
14
+ - **Deconstruct to Compose:** Build applications by composing independent and reusable components, with each component being developed, tested, and versioned in isolation.
15
+ - **Autonomous Components:** Use the Bit MCP to make these components truly autonomous, allowing them to be managed and shared from any codebase without being coupled to a specific project's architecture.
16
+ - **Scalable Collaboration:** The ultimate goal is to create a shared "component economy" where teams can collaborate, accelerate development, and ensure consistency by assembling applications from this distributed system of components.
17
+
18
+ ## Critical Rules of Engagement - do these steps before any tool or command execution!!!
19
+
20
+ 1. **Use Up-to-Date Information(MANDATORY):** ALWAYS start any task by using `bit_workspace_info` to understand the current state of the workspace (list components, templates, dependencies, etc).
21
+ 2. **MCP Tools First:** You MUST use the provided MCP tools to interact with Bit. Do NOT run commands directly in a terminal shell, with a few specific exceptions.
22
+ 3. **Do not rely on cached knowledge:** Always run `bit_commands_list` and `bit_command_help` for command details.
23
+ 4. **Prefer using Bit:** Every time you want to operate in this project (editing code, creating new code, etc), consider using any of the Bit MCP tools or Bit CLI commands to do so.
24
+
25
+ ## Core Principles of Building with Bit
26
+
27
+ - **Reuse Before Creating or Modifying(MANDATORY):** Before creating _any_ new component or modify _any_ file, you MUST first search for existing components.
28
+ - Use `bit_workspace_info` to check for local and existing components.
29
+ - Use `bit_remote_search` to find components on the remote scope.
30
+ - Present findings to the user, even if you think creating a new component is simpler.
31
+ - **No Relative Imports To Components:** Always import a component using the package name, so it is used through `node_modules`.
32
+ - You should always aim to code APIs in the dependent component and use them in the dependency (e.g. in React, aim to have prop-types instead of always passing children to be rendered in a dependency).
33
+
34
+ ## Tooling & Command Execution Hierarchy
35
+
36
+ This is the decision-making process for executing any Bit operation.
37
+
38
+ ### Step 1: Choose the Correct Generic Execution Tool
39
+
40
+ - If no dedicated tool exists, you must use one of the generic execution tools. Use the `bit_commands_list` output to help you decide:
41
+ - **For Read-Only Operations, use `bit_query`**: Use this for operations that inspect state but do not change the workspace.
42
+ - **For Write Operations, use `bit_execute`**: Use this for operations that modify the workspace, components, or dependencies.
43
+
44
+ ### Step 2: Check for Terminal Exceptions
45
+
46
+ - The following commands have rich, interactive, or streaming output and should be run directly in the user's terminal. You should construct the command and advise the user to run it.
47
+ - `bit test`
48
+ - `bit build`
49
+ - `bit start` (long-running processes)
50
+ - `bit watch` (long-running processes)
51
+ - `bit lint`
52
+ - `bit check-types`
53
+ - `bit run` (long-running processes)
54
+ - any command when `--build` flag is used. (build can take long)
55
+
56
+ ## Core Workflows
57
+
58
+ ### Workflow: Error Diagnosis in a Bit Workspace
59
+
60
+ - `bit_workspace_info` with the "warnings" option to detect errors. Output includes possible solutions, follow them.
61
+ - Rerun `bit_workspace_info` to validate fixes. If error persists, use `bit_component_details` on relevant component(s) for more information.
62
+
63
+ ### Workflow: In-Component Code Issues
64
+
65
+ - For code issues (compile, lint, test, type checking), run the relevant terminal command and pass the component ID (e.g. `bit test COMPONENT_ID`).
66
+ - To get complete report for code issues on all components, do not provide component ID (e.g. `bit test`).
67
+ - Adding `--log` CLI option gives more details on errors.
68
+
69
+ ### Workflow: Generating New Components, Feature or Apps
70
+
71
+ - **Follow Core Principle #1 Reuse Before Creating or Modifying.**
72
+ - `bit_workspace_info` lists templates for new components.
73
+ - If a new component is necessary, clarify the TEMPLATE and combination of NAMESPACE(s) (optional) and NAME with the user.
74
+ - Run `bit_component_details` on new components gives information on them, this is useful for making code changes or composing the component into another (as a dependency).
75
+ - After generating a new component or app, ask the user what they want to be implemented in the new component or app.
76
+
77
+ ### Workflow: Adding Functionality (feature, page, module, function, etc) to Bit Components and Apps
78
+
79
+ - **Follow Critical Principle #1 Reuse Before Creating or Modifying.**
80
+ - If a potentially reusable component is found, use it as a dependency in the component you want to modify.
81
+ **Hint:** use `bit_component_details` to get API references and documentation.
82
+ **Follow Critical Principle #2 No Relative Imports Between Components**.
83
+ - After modifying component implementation, always consider updating the following component files `*.composition.*`, `*.docs.mdx`, `*.spec.*`.
84
+
85
+ ### Workflow: USE or DEVELOP a Component
86
+
87
+ - Use `bit_component_details` to get the component location.
88
+ - If the component is not in the workspace, and you want to USE it as a dependency, you must first install it (then you can infer to it by its package name).
89
+ - If the component is not in the workspace, and you want to DEVELOP it (modify its source), you must first import it.
90
+
91
+ ### Workflow: Collaboration, Change Management and Version Control
92
+
93
+ - Bit uses a concept called "Lanes" to manage changes across components, this is similar to Git branches.
94
+ - Use `bit_workspace_info` to identify the current active lane.
95
+ - You must not snap or export components directly to the `main` lane.
96
+ - Use `bit_execute` for "Bit Lane" commands.
97
+ - If not already on a suitable development lane, suggest a name for the new lane to be created and validate with the user.
98
+ - The workspace automatically switches to a new lane once created.
99
+ - It is good practice to validate code before taking a snapshot (`bit lint`, `bit test`, `bit check-types`).
100
+ - Take a snapshot of all components with a relevant message (similar to `git commit`).
101
+ - Export the snap to the remote scope for review and collaboration (similar to `git push`).
102
+
103
+ ## Glossary
104
+
105
+ - **Bit Component:** An extensible, portable software container. Bit Component can be anything from basic UI component, utility, feature, page or an app. Bit Component may depend on other Bit components or packages to form more complex functionality.
106
+ - **Workspace:** A Bit-initialized directory containing components.
107
+ - **Scope:** A collaboration server for components that defines ownership.
108
+ - **Application (App):** A Bit Component with its own runtime. It is usually composed from various features and components.
109
+ - **Development Environment (Env):** A component that bundles development tools (compiler, tester, etc.).
110
+ - **Lane:** A mechanism for managing and releasing modifications across components. `main` is the default lane. Lane is similar in concept to a Git Branch.
111
+
112
+ ## Pointers to remember:
113
+
114
+ - For generating ESlint or TypeScript configuration files execute the command `bit ws-config write --clean`
115
+ - User may use different terms to describe components. Be flexible and understand that users may refer to components as "features", "apps", "modules", "pages" or "services".
@@ -0,0 +1,250 @@
1
+ # Bit CLI MCP Server
2
+
3
+ The Bit CLI MCP Server provides a [Model Context Protocol (MCP)](https://github.com/modelcontextprotocol/mcp) interface to Bit's command-line functionality, enabling programmatic access to Bit workspace and component management operations. This server exposes Bit CLI commands as MCP tools, making it possible to automate, script, or integrate Bit operations with other tools and platforms.
4
+
5
+ ## Overview
6
+
7
+ This server acts as a bridge between MCP clients (such as VS Code, AI tools, or your own applications) and the Bit CLI. It leverages the Bit server API for efficient communication and provides both individual CLI command tools and specialized composite tools for common workflows. The server automatically manages a Bit server instance in the background for optimal performance.
8
+
9
+ ## Installation
10
+
11
+ ### Prerequisites
12
+
13
+ - Node.js (v18 or later recommended)
14
+ - Bit CLI installed and available in your PATH
15
+
16
+ ### Getting Started
17
+
18
+ The Bit CLI MCP Server is included with Bit. If you have Bit installed, you can run the server using:
19
+
20
+ ```
21
+ bit mcp-server start
22
+ ```
23
+
24
+ ## Usage
25
+
26
+ ### Command-Line Options
27
+
28
+ ```
29
+ bit mcp-server start [options]
30
+ ```
31
+
32
+ Options:
33
+
34
+ - `--consumer-project`: For non-Bit workspaces that only consume Bit component packages. Enables only "bit_remote_search" and "bit_remote_component_details" tools and automatically adds the "--remote" flag to relevant commands.
35
+ - `--include-additional <commands>`: Add specific commands to the available tools (comma-separated list)
36
+
37
+ ### Integrating with IDEs
38
+
39
+ The easiest way to integrate the MCP server with your IDE is to use the `setup` command:
40
+
41
+ ```bash
42
+ # Basic setup for VS Code (default)
43
+ bit mcp-server setup
44
+ ```
45
+
46
+ 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.
47
+
48
+ ### Automatic Integration Setup
49
+
50
+ The **recommended way** to integrate the MCP server with your IDE is using the `setup` command:
51
+
52
+ ```bash
53
+ bit mcp-server setup [vscode|cursor|windsurf] [options]
54
+ ```
55
+
56
+ This command automatically configures the MCP server settings in your chosen editor. If no editor is specified, it defaults to VS Code.
57
+
58
+ #### Supported Editors
59
+
60
+ - **VS Code**: `bit mcp-server setup vscode` (or just `bit mcp-server setup`)
61
+ - **Cursor**: `bit mcp-server setup cursor`
62
+ - **Windsurf**: `bit mcp-server setup windsurf`
63
+
64
+ #### Configuration Options
65
+
66
+ - `--global`: Apply configuration globally (user settings) instead of workspace settings
67
+ - `--consumer-project`: Configure for consumer projects
68
+ - `--include-additional <commands>`: Add specific commands to the available tools
69
+
70
+ #### Examples
71
+
72
+ ```bash
73
+ # Basic VS Code setup (workspace level)
74
+ bit mcp-server setup
75
+
76
+ # Global setup for Cursor
77
+ bit mcp-server setup cursor --global
78
+
79
+ # Setup with consumer project mode
80
+ bit mcp-server setup --consumer-project
81
+ ```
82
+
83
+ #### Manual Configuration
84
+
85
+ If you need to manually configure the settings, here's how to set up VS Code MCP integration:
86
+
87
+ **For workspace-specific configuration:**
88
+
89
+ 1. Create a `.vscode/mcp.json` file in your workspace folder
90
+ 2. Add the following configuration:
91
+
92
+ ```json
93
+ {
94
+ "servers": {
95
+ "bit-cli": {
96
+ "type": "stdio",
97
+ "command": "bit",
98
+ "args": ["mcp-server", "start"]
99
+ }
100
+ }
101
+ }
102
+ ```
103
+
104
+ **For global configuration:**
105
+
106
+ 1. Open VS Code settings (JSON) by pressing `Ctrl + Shift + P` (or `Cmd + Shift + P` on macOS) and typing `Preferences: Open Settings (JSON)`
107
+ 2. Add the following configuration:
108
+
109
+ ```json
110
+ {
111
+ "mcp": {
112
+ "servers": {
113
+ "bit-cli": {
114
+ "type": "stdio",
115
+ "command": "bit",
116
+ "args": ["mcp-server", "start"]
117
+ }
118
+ }
119
+ }
120
+ }
121
+ ```
122
+
123
+ ### Programmatic Usage
124
+
125
+ ```javascript
126
+ import { McpClient } from '@modelcontextprotocol/sdk/client';
127
+
128
+ async function example() {
129
+ const client = await McpClient.spawn('bit', ['mcp-server', 'start']);
130
+
131
+ // Call a Bit CLI tool via MCP
132
+ const result = await client.callTool('bit_status', { cwd: '/path/to/workspace' });
133
+ console.log(result.content[0].text);
134
+
135
+ // Close the connection when done
136
+ await client.close();
137
+ }
138
+ ```
139
+
140
+ ## Available Tools
141
+
142
+ The Bit CLI MCP Server operates in two modes and provides several specialized tools:
143
+
144
+ ### Default Mode
145
+
146
+ In default mode, the server exposes a minimal set of essential tools focused on core functionality. This ensures optimal performance and safety:
147
+
148
+ - **Always Available Tools:**
149
+
150
+ - `bit_remote_search`: Search for components in remote scopes
151
+ - `bit_workspace_info`: Get comprehensive workspace information including status, components list, apps, templates, and dependency graph
152
+ - `bit_component_details`: Get detailed information about a specific component including basic info and optionally its public API schema
153
+ - `bit_query`: Execute read-only Bit commands that safely inspect workspace and component state without making modifications
154
+ - `bit_execute`: Execute any Bit command, including those that modify workspace or repository state (use with caution)
155
+ - `bit_commands_list`: Get all available Bit commands with descriptions and groups (for command discovery)
156
+ - `bit_command_help`: Get detailed help for a specific Bit command including syntax, arguments, flags, and usage examples
157
+
158
+ > **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.
159
+
160
+ ### Consumer Project Mode (--consumer-project)
161
+
162
+ This mode is designed for applications or projects that are not Bit workspaces but need to consume or work with Bit components as packages. It provides a minimal set of tools focused on component discovery and information:
163
+
164
+ - `bit_remote_search`: Search for components in remote scopes
165
+ - `bit_remote_component_details`: Get detailed information about a remote component including basic info and its public API schema (combines the functionality of show and schema commands)
166
+
167
+ In this mode:
168
+
169
+ 1. You don't need a Bit workspace initialization
170
+ 2. Only these 2 tools are available (no workspace-specific tools)
171
+ 3. The `--remote` flag is automatically added to component detail queries
172
+ 4. The `cwd` parameter is still required but can be any directory (not necessarily a Bit workspace)
173
+ 5. You can still add additional tools with the `--include-additional` flag
174
+
175
+ ## Tool Parameters
176
+
177
+ All tools accept a `cwd` parameter specifying the workspace path. Additional parameters vary by command.
178
+
179
+ Example tool call for `bit_status`:
180
+
181
+ ```json
182
+ {
183
+ "cwd": "/path/to/workspace",
184
+ "warnings": true,
185
+ "json": true
186
+ }
187
+ ```
188
+
189
+ ## Custom Tool Selection
190
+
191
+ To customize the available tools:
192
+
193
+ ```
194
+ # Add specific tools to the available tools
195
+ bit mcp-server start --include-additional "build,lint,format,create,schema"
196
+
197
+ # For consumer projects (non-Bit workspaces)
198
+ bit mcp-server start --consumer-project
199
+
200
+ # Add specific tools to the consumer project set
201
+ bit mcp-server start --consumer-project --include-additional "deps,get,preview"
202
+ ```
203
+
204
+ ### Writing AI Assistant Rules
205
+
206
+ The MCP server provides a `rules` command to create instruction files for AI assistants:
207
+
208
+ ```bash
209
+ bit mcp-server rules [vscode|cursor|windsurf|cline] [options]
210
+ ```
211
+
212
+ 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.
213
+
214
+ #### Supported Editors
215
+
216
+ - **VS Code**: `bit mcp-server rules vscode` (or just `bit mcp-server rules`)
217
+ - **Cursor**: `bit mcp-server rules cursor`
218
+ - **Windsurf**: `bit mcp-server rules windsurf`
219
+ - **Cline**: `bit mcp-server rules cline`
220
+
221
+ #### Configuration Options
222
+
223
+ - `--global`: Write rules to global configuration (default: workspace-specific)
224
+ - `--print`: Print rules content to screen instead of writing to file
225
+ - `--consumer-project`: Generate rules for consumer projects that only use Bit components as packages
226
+
227
+ #### Examples
228
+
229
+ ```bash
230
+ # Basic VS Code rules (workspace level)
231
+ bit mcp-server rules
232
+
233
+ # Global rules for Cursor
234
+ bit mcp-server rules cursor --global
235
+
236
+ # Consumer project rules for VS Code
237
+ bit mcp-server rules --consumer-project
238
+
239
+ # Global rules for Cline (macOS only)
240
+ bit mcp-server rules cline --global
241
+
242
+ # Workspace-specific rules for Cline
243
+ bit mcp-server rules cline
244
+
245
+ # Print rules content to screen for manual setup
246
+ bit mcp-server rules --print
247
+
248
+ # Print consumer project content for Windsurf (requires manual addition to .windsurfrules)
249
+ bit mcp-server rules windsurf --print --consumer-project
250
+ ```
@@ -0,0 +1,11 @@
1
+ ---
2
+ applyTo: '**'
3
+ ---
4
+
5
+ ## How to Install and Use Bit Components
6
+
7
+ - Bit Components are reusable pieces of code in the form of node packages.
8
+ - Search for Bit Components using `bit_remote_search` tool.
9
+ - Use `bit_remote_component_details` only on Bit Components to get information like package name (to use when installing, e.g. `npm install <package-name>`), APIs and documentation (to use when using in code).
10
+ - If a user is requesting functionality, you can search if there are available components that implement it using `bit_remote_search`.
11
+ - Filter my search with my account name "ACCOUNT" to find components you have created or are a maintainer of.