bazel-mcp MCP Server

A Model Context Protocol server that exposes Bazel build system capabilities to AI assistants.

Local serverstdio

What is the bazel-mcp Server?

bazel-mcp is an MCP project maintained in the saeid-rez/bazel-mcp repository. The maintainer describes its purpose as “A Model Context Protocol server that exposes Bazel build system capabilities to AI assistants”. Read the project documentation for the complete scope.

Local setup

The project provides a local client configuration using uvx. Follow the repository’s build and installation steps before copying it, and replace example paths with the paths on your own computer.

Source

Project documentation · Repository · Discovery listing. This profile records the public documentation checked on 2026-10-08.

Recorded tools

Check the linked publisher documentation and your connected client's tool list. Names and availability can vary with the server version and account permissions.

ToolWhat it does
bazel_queryRun arbitrary bazel query expressions
bazel_cqueryRun configured bazel cquery expressions (select() and platforms)
bazel_aqueryRun action bazel aquery expressions (compiler flags, commands)
list_targetsList targets in a package or subtree
get_depsDirect or transitive dependencies of a target
get_rdepsReverse dependencies within a scope
show_target_infoRule definition via query --output=build
find_affected_targetsFind targets affected by changed files
bazel_buildRun bazel build with structured failure diagnostics
bazel_testRun bazel test with structured target and failed-case results
bazel_runRun bazel run with arguments, environment variables, and working directory controls
explain_build_fileRead BUILD file contents for analysis

How to install the bazel-mcp Server

{
  "mcpServers": {
    "bazel": {
      "command": "uvx",
      "args": [
        "--from",
        "git+https://github.com/saeid-rez/bazel-mcp",
        "bazel-mcp-server"
      ]
    }
  }
}

From the project documentation. Replace placeholders and example paths before connecting.