bazel-mcp
Provides tools for interacting with the Bazel build system, enabling AI assistants to run queries, list targets, get dependencies, perform builds and tests, and analyze BUILD files.
Bazel MCP
A Model Context Protocol server that exposes Bazel build system capabilities to AI assistants.
Repo: github.com/saeid-rez/bazel-mcp
Tools
Tool | Description |
| Run arbitrary |
| List targets in a package or subtree |
| Direct or transitive dependencies of a target |
| Reverse dependencies within a scope |
| Rule definition via |
| Run |
| Run |
| Read BUILD file contents for analysis |
Related MCP server: mcp-cli-catalog
Usage
Run against a Bazel workspace. Open that repo in Cursor, then add to .cursor/mcp.json:
{
"mcpServers": {
"bazel": {
"command": "uvx",
"args": ["--from", "git+https://github.com/saeid-rez/bazel-mcp", "bazel-mcp"]
}
}
}Requires uv. Bazel commands run in your open workspace by default.
If your MCP client does not start the server from the Bazel workspace, pass the workspace explicitly:
{
"mcpServers": {
"bazel": {
"command": "uvx",
"args": [
"--from",
"git+https://github.com/saeid-rez/bazel-mcp",
"bazel-mcp",
"--workspace-root",
"/path/to/your/bazel/workspace"
]
}
}
}Other optional flags:
bazel-mcp --bazel-path bazelisk --timeout 600 --max-output-chars 64000Development
Clone the repo and run tests locally:
git clone https://github.com/saeid-rez/bazel-mcp
cd bazel-mcp
uv sync --group dev
uv run pytestMaintenance
Resources
Unclaimed servers have limited discoverability.
Looking for Admin?
If you are the server author, to access and configure the admin panel.
Latest Blog Posts
MCP directory API
We provide all the information about MCP servers via our MCP API.
curl -X GET 'https://glama.ai/api/mcp/v1/servers/saeid-rez/bazel-mcp'
If you have feedback or need assistance with the MCP directory API, please join our Discord server