MCP server for interacting with Bazel
If you already use Bazel, the bazel mcp server is the piece that lets your assistant work with it directly. MCP server for interacting with Bazel.
A local MCP server that exposes functionality of the Bazel build system to MCP-enabled AI agents.
The server ships on npm as github, so your MCP client can launch it on demand — there is no separate build step. Add the server block to your client's configuration, restart it, and the tools register themselves.
The toolset is worth reading before you wire it up, because it tells you what the integration is really for:
bazel_build_target — Build specified Bazel targetsbazel_query_target — Query the dependency graph for targets matching a patternbazel_test_target — Run tests for specified targetsbazel_list_targets — List all available targets in the workspace (requires path parameter, use "//" for all targets)bazel_fetch_dependencies — Fetch external dependenciesbazel_set_workspace_path — Change the Bazel workspace path at runtimeInstallation — The Installation tool exposed by this serverConfiguration — This MCP server allows a couple different configuration methods. They will be used in the following order:Configuration is passed through the environment: MCP_BAZEL_PATH, MCP_WORKSPACE_PATH, MCP_LOG_PATH. Treat anything key-shaped as a real credential — scope it to the minimum the server needs, and rotate it if it ever lands in a shared config.
This sits in the developer tooling group, where several servers overlap in what they claim to do but differ sharply once you actually set them up. Bazel's toolset — bazel_build_target, bazel_query_target, bazel_test_target and 5 more — is a fair guide to whether it matches your workflow. It is maintained by nacgarg; worth a glance at recent repository activity before you build anything load-bearing on it.
This entry was verified against Bazel's own documentation before publication; SyncDev keeps the directory reviewed rather than auto-generated.
| Tool | What it does |
|---|---|
| bazel_build_target | Build specified Bazel targets |
| bazel_query_target | Query the dependency graph for targets matching a pattern |
| bazel_test_target | Run tests for specified targets |
| bazel_list_targets | List all available targets in the workspace (requires path parameter, use "//" for all targets) |
| bazel_fetch_dependencies | Fetch external dependencies |
| bazel_set_workspace_path | Change the Bazel workspace path at runtime |
| Installation | The Installation tool exposed by this server. |
| Configuration | This MCP server allows a couple different configuration methods. They will be used in the following order: |
{
"mcpServers": {
"bazel": {
"command": "npx",
"args": [
"-y",
"github:nacgarg/bazel-mcp-server",
// If you need to specify the bazel binary path
"--bazel_path",
"/absolute/path/to/your/bazel/binary",
// If you need to specify the workspace path
"--workspace_path",
"/absolute/path/to/your/bazel/workspace"
// See Configuration Table below for more options
]
}
}
}Configuration as documented by the project. Restart the client after saving.
| Variable | Description | Required |
|---|---|---|
| MCP_BAZEL_PATH | Filesystem location the server is allowed to use. | Optional |
| MCP_WORKSPACE_PATH | Filesystem location the server is allowed to use. | Optional |
| MCP_LOG_PATH | Filesystem location the server is allowed to use. | Optional |
Kill hallucinated APIs — version-accurate, up-to-date library documentation injected straight into context.
Microsoft's official browser automation server — drive a real browser through the accessibility tree, no screenshots needed.
GitHub's official server — repos, issues, pull requests, Actions and code security, straight from your assistant.
Issue tracking at the speed of conversation — Linear's official hosted server with OAuth and zero install.
Local repository surgery — status, diffs, commits, branches and history for any repo on disk.
Timezone sanity for AI — current time anywhere and correct conversions, without the model doing date math.