Basic information
About Bazel Mcp Server
A local MCP server that exposes Bazel build system capabilities to AI assistants.
Bazel Mcp is a MCP server in the Other category listed in the AddMCP.net directory, published by saeid-rez. Supported transport: stdio. Runtime: Python. License: MIT. The repository has 2 GitHub stars. Source code is hosted on github.com. Related topics: bazel, build, local.
Setup
{
"mcpServers": {
"bazel": {
"command": "uvx",
"args": [
"--from",
"git+https://github.com/saeid-rez/bazel-mcp",
"bazel-mcp"
]
}
}
}
{
"mcpServers": {
"bazel": {
"command": "uvx",
"args": [
"--from",
"git+https://github.com/saeid-rez/bazel-mcp",
"bazel-mcp"
]
}
}
}
{
"servers": {
"bazel": {
"command": "uvx",
"args": [
"--from",
"git+https://github.com/saeid-rez/bazel-mcp",
"bazel-mcp"
]
}
}
}
Bazel Mcp config
Add this server to your MCP-compatible client using the configuration below.
{
"mcpServers": {
"bazel": {
"command": "uvx",
"args": [
"--from",
"git+https://github.com/saeid-rez/bazel-mcp",
"bazel-mcp"
]
}
}
}
Bazel Mcp tools
Tool list not available yet
This listing does not currently have a tool list to display. This does not mean the server has no tools; check its documentation for supported capabilities.
We auto-extract tools from the README. The maintainer can list them under a ## Tools heading to populate this section.
Overview
What is Bazel Mcp?
Bazel Mcp is a Model Context Protocol server that exposes Bazel build system capabilities to AI assistants. It is designed for developers who want to interact with a Bazel workspace through an MCP-enabled client such as Cursor.
How to use Bazel Mcp?
Install the server with uvx and add a configuration entry to your MCP client’s JSON file (e.g., .cursor/mcp.json). Bazel commands run in your open workspace by default; if your client does not start from that directory, pass the workspace root explicitly with the --workspace-root flag.
Key features of Bazel Mcp
- Run arbitrary
bazel queryexpressions - List targets in a package or subtree
- Get direct or transitive dependencies of a target
- Get reverse dependencies within a scope
- Show rule definition via
query --output=build - Run
bazel buildandbazel test - Read BUILD file contents for analysis
Use cases of Bazel Mcp
- Ask an AI assistant for the dependencies of a specific Bazel target
- Let an AI assistant build or test a target and return structured results
- Have an AI assistant explain the contents of a BUILD file
- Query the build graph for reverse dependencies during refactoring
Frequently asked questions
1 What does Bazel Mcp do?
It provides tools (bazel_query, list_targets, get_deps, get_rdeps, show_target_info, bazel_build, bazel_test, explain_build_file) that an AI assistant can invoke to inspect and control a Bazel workspace.
2 What runtime does it require?
The server requires uv to run.
3 Where are Bazel commands executed?
Commands run in the Bazel workspace that is open in your MCP client by default. If the client does not start the server from the workspace, you must supply the workspace root path via the --workspace-root flag.
4 Are there any optional configuration flags?
Yes. You can set --bazel-path to specify the Bazel binary (e.g., bazelisk), --timeout to change the command timeout in seconds, and --max-output-chars to limit the number of characters in command output.
Comments
No comments yet
Be the first to share feedback about this listing. Sign in to leave a comment.
Sign In