mcp-bazel
An MCP server providing common Bazel actions like build, test, and dependency analysis.
claude mcp add --transport stdio aaomidi-mcp-bazel go install github.com/aaomidi/mcp-bazel@latest \ --env GOPATH="Path to your Go workspace (optional if using default)"
How to use
The Bazel MCP Server exposes a set of tools to interact with Bazel projects via the Model Context Protocol. It provides capabilities to build targets, inspect dependencies and reverse dependencies, locate the sources of a target, and run tests. These utilities are designed to be used as a tool provider within applications such as Claude Desktop, enabling programmatic queries against a Bazel workspace. Each tool accepts a Bazel target or path (and optional parameters) and returns structured results that you can display, parse, or feed into other workflows.
To use the server, install the binary and configure your MCP client to point at the mcp-bazel server. Once running, invoke the available commands (build, deps, rdeps, sources, test) through the MCP interface provided by your client. Results typically include details like target names, file paths, dependency graphs, and test outcomes, allowing you to navigate and modify Bazel workspaces efficiently.
How to install
Prerequisites:
- Go installed (1.20+ recommended)
- Internet access to fetch the mcp-bazel module
Install the MCP server:
# Ensure Go environment is set up (GOPATH, GOBIN, etc.)
go install github.com/aaomidi/mcp-bazel@latest
Verify installation:
# The binary should be available in GOPATH/bin or $HOME/go/bin
mcp-bazel --help
Configure your client (Claude Desktop or other MCP client) to point to the installed binary. If the binary is not in your PATH, provide the full path to the executable in your client configuration, for example:
{
"mcpServers": {
"mcp-bazel": {
"command": "/path/to/go/bin/mcp-bazel"
}
}
}
Additional notes
Notes and tips:
- Ensure your Bazel workspace is accessible to the mcp-bazel binary (correct permissions, network access, and workspace layout).
- The toolset may evolve during active development; verify you’re using a compatible version if you integrate into automation.
- For large workspaces, the deps and rdeps queries can be resource-intensive; consider limiting depth or caching results for repeated queries.
- If you encounter path or permission errors, verify that the mcp-bazel binary has execute permission and that the target Bazel workspace paths are correctly mounted or accessible by the process.
Related MCP Servers
mcp-language
mcp-language-server gives MCP enabled clients access semantic tools like get definition, references, rename, and diagnostics.
kodit
👩💻 MCP server to index external repositories
github-brain
An experimental GitHub MCP server with local database.
bgg
BGG MCP provides access to BoardGameGeek and a variety of board game related data through the Model Context Protocol. Enabling retrieval and filtering of board game data, user collections, and profiles.
mcp
Teamwork.com MCP server
chromedp
MCP server for browser automation using chromedp