scopes/mcp/cli-mcp-server/README.docs.mdx
The Bit CLI MCP Server provides a Model Context Protocol (MCP) interface to Bit's command-line functionality. It acts as a bridge between MCP clients (such as VS Code, AI tools, or your own applications) and the Bit CLI, enabling programmatic access to Bit workspace and component management operations.
The Bit CLI MCP Server is included with Bit. To set it up with your IDE, run:
# Basic setup for VS Code (default)
bit mcp-server setup
# Other supported editors
bit mcp-server setup [vscode|cursor|windsurf|roo|cline|claude-code]
# For consumer projects (non-Bit workspaces that only consume Bit components)
bit mcp-server setup --consumer-project
After installation, consider these helpful setup steps:
For new workspaces: Set your default scope so the search tool knows which organization to search:
bit scope set <your-org.your-scope>
Generate rules/instructions (if you haven't already):
bit mcp-server rules
This provides the AI agent with comprehensive guidance about Bit and MCP server functionality.
VS Code users: Make sure to select "agent" mode instead of "ask" mode in the chat interface. For first-time users, open the command palette and search for "MCP: List servers" to find and start the Bit server.
For IDEs not supported by the automatic setup, add this MCP server configuration:
{
"servers": {
"bit-cli": {
"type": "stdio",
"command": "bit",
"args": ["mcp-server", "start"]
}
}
}
--global: Apply configuration globally (user settings) instead of workspace settings--consumer-project: For non-Bit workspaces that only consume Bit components as packages--include-additional <commands>: Add specific commands to the available tools (comma-separated list)To manually start the server:
bit mcp-server start [options]
Options:
--consumer-project: For non-Bit workspaces that only consume Bit component packages--include-additional <commands>: Add specific commands to the available tools (comma-separated list)Create instruction files for AI assistants:
bit mcp-server rules [vscode|cursor|windsurf|roo|cline|claude-code] [options]
Options:
--global: Write rules to global configuration--consumer-project: Generate rules for consumer projects--print: Print rules content to screenThe Bit CLI MCP Server operates in two modes and provides several specialized tools:
In default mode, the server exposes a minimal set of essential tools focused on core functionality:
bit_remote_search: Search for components with automatic organization detection from workspace's defaultScope (e.g., "teambit" from "teambit.defender"). Executes multiple queries in parallel and deduplicates results. Use arrays of related terms or synonyms for better results.bit_workspace_info: Get comprehensive workspace information by combining multiple data sources (status, components, apps, templates, dependency graph). Includes current lane information.bit_component_details: Get detailed information about multiple components in parallel (up to 5 max to prevent context overload). Includes documentation from .docs.mdx files, example usage from composition files, and optionally the component's public API schema with exported functions/types. Returns partial results with detailed failure information if some components fail.bit_create: Create components using templates with batch support. Supports multiple component names in single call and extensive configuration options (namespace, scope, environment). Validates template existence and prevents conflicts.bit_query: Execute read-only Bit commands from a curated whitelist of safe commands (status, list, show, info, diff, log, graph, etc.). Prevents accidental workspace modifications.bit_execute: Execute any Bit command including those that modify workspace state. Use with caution as it allows all operations including destructive ones.bit_commands_list: Get all available Bit commands with descriptions, grouping, and subcommand discovery for comprehensive command exploration.bit_command_help: Get detailed help for specific commands including arguments metadata, flag types, usage examples, and subcommand relationships.Command Discovery vs. Command Help: Use
bit_commands_listto discover what commands are available in Bit, then usebit_command_helpwith a specific command name to get detailed usage information including arguments, flags, and examples.
For projects that consume Bit components as packages but aren't Bit workspaces:
bit_remote_search: Search for components across all organizations available to the logged-in user (requires bit login). Executes multiple queries in parallel and deduplicates results.bit_remote_component_details: Get comprehensive remote component information by combining show and schema commands. Gracefully handles schema failures while providing basic component details.