Bazel MCP Server
@MCP-Mirror
About Bazel MCP Server
Mirror of
Config
Add this server to your MCP-compatible client using the configuration below.
{
"mcpServers": {
"nacgarg_bazel-mcp-server": {
"command": "npx",
"args": [
"-y",
"github:nacgarg/bazel-mcp-server"
]
}
}
}Tools
6Build specified Bazel targets
Query the dependency graph for targets matching a pattern
Run tests for specified targets
List all available targets in the workspace (requires path parameter, use "//" for all targets)
Fetch external dependencies
Change the Bazel workspace path at runtime
Overview
What is Bazel MCP Server?
Bazel MCP Server is a local server that exposes functionality of the Bazel build system to MCP-enabled AI agents. It is designed for environments where the command-line tool is absent or the shell has a misconfigured environment preventing Bazel use.
How to use Bazel MCP Server?
Install and run via npx -y github:nacgarg/bazel-mcp-server or clone the repository and build from source. Configuration can be provided through CLI arguments, environment variables, or a configuration file using keys like --bazel_path, --workspace_path, --workspace_config, and --log_path. The server is invoked automatically by MCP clients such as Cursor (via .cursor/mcp.json) or Claude Desktop.
Key features of Bazel MCP Server
- Build specified Bazel targets with
bazel_build_target - Query the dependency graph for matching targets
- Run tests for specified targets
- List all available targets in the workspace
- Fetch external dependencies
- Change the Bazel workspace path at runtime
Use cases of Bazel MCP Server
- AI agents building Bazel projects without a locally installed Bazel CLI
- Querying Bazel dependency graphs from within an MCP-enabled IDE
- Running Bazel tests and fetching dependencies via natural language commands
FAQ from Bazel MCP Server
Does Bazel MCP Server require a Bazel binary on the system?
Yes, a Bazel binary must be available. It is usually auto-detected, but the path can be explicitly set via --bazel_path or the MCP_BAZEL_PATH environment variable.
Can I change the workspace path without restarting the server?
Yes, the bazel_set_workspace_path tool allows changing the workspace path at runtime.
What clients are supported?
The server works with any MCP-compatible client, including Cursor and Claude Desktop. Note that with Cursor Remote SSH sessions, the server runs locally and may not function as expected.
How is Bazel MCP Server configured?
Configuration is resolved in this order: CLI arguments, environment variables, then a configuration file. Key settings include --bazel_path, --workspace_path, --workspace_config, and --log_path.
Can I pass extra flags to Bazel commands?
Yes, each tool (except bazel_set_workspace_path) supports an additionalArgs parameter for passing flags like --verbose_failures or --test_output=all.
Frequently asked questions
Does Bazel MCP Server require a Bazel binary on the system?
Yes, a Bazel binary must be available. It is usually auto-detected, but the path can be explicitly set via `--bazel_path` or the `MCP_BAZEL_PATH` environment variable.
Can I change the workspace path without restarting the server?
Yes, the `bazel_set_workspace_path` tool allows changing the workspace path at runtime.
What clients are supported?
The server works with any MCP-compatible client, including Cursor and Claude Desktop. Note that with Cursor Remote SSH sessions, the server runs locally and may not function as expected.
How is Bazel MCP Server configured?
Configuration is resolved in this order: CLI arguments, environment variables, then a configuration file. Key settings include `--bazel_path`, `--workspace_path`, `--workspace_config`, and `--log_path`.
Can I pass extra flags to Bazel commands?
Yes, each tool (except `bazel_set_workspace_path`) supports an `additionalArgs` parameter for passing flags like `--verbose_failures` or `--test_output=all`.
Basic information
More Other MCP servers
MCP Toolbox for Databases
googleapisMCP Toolbox for Databases is an open source MCP server for databases.
MaxKB
1Panel-dev🔥 MaxKB is an open-source platform for building enterprise-grade agents. 强大易用的开源企业级智能体平台。
AutoBrowser MCP
autobrowser-aiBrowser MCP is a Model Context Provider (MCP) server that allows AI applications to control your browser
🚀 Model Context Protocol (MCP) Curriculum for Beginners
microsoftThis open-source curriculum introduces the fundamentals of Model Context Protocol (MCP) through real-world, cross-language examples in .NET, Java, TypeScript, JavaScript, Rust and Python. Designed for developers, it focuses on practical techniques for building modular, scalable,
Activepieces
activepiecesAI Agents & MCPs & AI Workflow Automation • (~400 MCP servers for AI agents) • AI Automation / AI Agent with MCPs • AI Workflows & AI Agents • MCPs for AI Agents
Comments