A local MCP server that exposes Bazel build system capabilities to AI assistants.
## Tools
| Tool | Description |
|------|-------------|
| `bazel_query` | Run arbitrary `bazel query` expressions |
| `list_targets` | List targets in a package or subtree |
| `get_deps` | Direct or transitive dependencies of a target |
| `get_rdeps` | Reverse dependencies within a scope |
| `show_target_info` | Rule definition via `query --output=build` |
| `bazel_build` | Run `bazel build` |
| `bazel_test` | Run `bazel test` with structured results |
| `explain_build_file` | Read BUILD file contents for analysis |
Server Config
{
"mcpServers": {
"bazel": {
"command": "uvx",
"args": [
"--from",
"git+https://github.com/saeid-rez/bazel-mcp",
"bazel-mcp"
]
}
}
}