Bazel Mcp
@saeid-rez
Bazel Mcp について
A local MCP server that exposes Bazel build system capabilities to AI assistants.
基本情報
設定
以下の設定を使って、このサーバーを MCP 対応クライアントに追加してください。
{
"mcpServers": {
"bazel": {
"command": "uvx",
"args": [
"--from",
"git+https://github.com/saeid-rez/bazel-mcp",
"bazel-mcp"
]
}
}
}ツール
8Run arbitrary `bazel query` expressions
List targets in a package or subtree
Direct or transitive dependencies of a target
Reverse dependencies within a scope
Rule definition via `query --output=build`
Run `bazel build`
Run `bazel test` with structured results
Read BUILD file contents for analysis
概要
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.
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
FAQ from Bazel Mcp
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.
What runtime does it require?
The server requires uv to run.
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.
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.
「その他」の他のコンテンツ
Unity MCP ✨
justinpbarnettUnity MCP acts as a bridge between AI assistants and your Unity Editor. Give your LLM tools to manage assets, control scenes, edit scripts, and automate tasks within Unity.
Nginx UI
0xJackyYet another WebUI for Nginx
Awesome Mcp Servers
punkpeyeA collection of MCP servers.
XcodeBuildMCP
cameroncookeA Model Context Protocol (MCP) server and CLI that provides tools for agent use when working on iOS and macOS projects.
Mcp
browsermcpBrowser MCP is a Model Context Provider (MCP) server that allows AI applications to control your browser
コメント