Overview
What is Bazel MCP Server?
Bazel MCP Server is a local server that exposes the functionality of the Bazel build system to MCP-enabled AI agents, facilitating the use of Bazel in environments lacking a command-line tool or with misconfigured shells.
How to use Bazel MCP Server?
To use the Bazel MCP Server, you can either integrate it with tools like Cursor or Claude Desktop by adding specific configurations, or run it directly from GitHub without installation using the command: npx -y github:nacgarg/bazel-mcp-server.
Key features of Bazel MCP Server?
- Build specified Bazel targets with
bazel_build_target - Query dependency graphs with
bazel_query_target - Run tests for specified targets with
bazel_test_target - List all available targets with
bazel_list_targets - Fetch external dependencies with
bazel_fetch_dependencies - Change workspace path at runtime with
bazel_set_workspace_path
Use cases of Bazel MCP Server?
- Enabling Bazel functionality in AI agents without direct command-line access.
- Facilitating builds and tests in environments with misconfigured shells.
- Providing a local server for Bazel commands in various development setups.
FAQ from Bazel MCP Server?
- Can I run Bazel MCP Server without installation?
Yes! You can run it directly using
npxcommand.
- What if I need to specify the Bazel binary path?
You can provide the path using the
--bazel_pathflag in your configuration.
- Is there a way to enable verbose logging?
Yes, set the
DEBUG=trueenvironment variable to enable verbose logging.