Skip to main content
Glama

Bazel MCP Server

by nacgarg

Bazel MCP サーバー

Bazelビルド システムの機能を MCP 対応 AI エージェントに公開するローカル MCP サーバー。

これは、MCP 環境に既存のコマンドライン ツールがない場合、または呼び出されたシェルの環境が誤って構成されていて Bazel を使用できない場合に役立ちます。

ツール

Bazel MCP サーバーは次のツールを提供します。

  • bazel_build_target : 指定されたBazelターゲットをビルドする
  • bazel_query_target : パターンに一致するターゲットの依存関係グラフを照会する
  • bazel_test_target : 指定されたターゲットのテストを実行する
  • bazel_list_targets : ワークスペース内の利用可能なすべてのターゲットを一覧表示します (パスパラメータが必要、すべてのターゲットには "//" を使用します)
  • bazel_fetch_dependencies : 外部依存関係を取得する
  • bazel_set_workspace_path : 実行時にBazelワークスペースパスを変更する

各コマンド( bazel_set_workspace_pathを除く)は、オプションのadditionalArgsパラメータをサポートしており、これにより、基盤となるBazelコマンドに追加の引数を渡すことができます。これは、 --verbose_failures--test_output=allなどのフラグを指定する場合に便利です。

使用法

インストール

カーソルの使用

.cursor/mcp.jsonに以下を追加します。

LLM はset_workspace_pathを使用して実行時にワークスペース パスを変更できるため、ワークスペース パスを指定する必要はありません。

通常、bazel バイナリは自動的に選択されますが、問題が発生した場合は、 --bazel_pathフラグを使用して bazel バイナリへのパスを指定できます。

:warning: カーソルをリモート SSH セッションで使用する場合、MCP サーバーがローカルで実行されるため、これは機能しないことに注意してください。

{ "mcpServers": { "bazel": { "command": "npx", "args": [ "-y", "github:nacgarg/bazel-mcp-server", // If you need to specify the bazel binary path "--bazel_path", "/absolute/path/to/your/bazel/binary", // If you need to specify the workspace path "--workspace_path", "/absolute/path/to/your/bazel/workspace" // See Configuration Table below for more options ] } } }
Claude Desktopでの使用

Claude Desktop でも上記と同じ構成を使用できます。

スタンドアロンの起動
# Run directly from GitHub (no installation needed) npx -y github:nacgarg/bazel-mcp-server # From source git clone https://github.com/nacgarg/bazel-mcp-server.git cd bazel-mcp-server npm install npm run build dist/index.js

構成

このMCPサーバーでは、いくつかの異なる設定方法が可能です。それらは以下の順序で使用されます。

  1. コマンドライン引数
  2. 環境変数
  3. 設定ファイル

構成表

CLI引数環境変数設定ファイルキー説明
--bazel_pathMCP_BAZEL_PATHbazel_path使用する Bazel バイナリへのパス。
--workspace_pathMCP_WORKSPACE_PATHworkspace_path使用する Bazel ワークスペースへのパス。
--workspace_configMCP_WORKSPACE_CONFIGworkspace_config使用するワークスペースの設定。デフォルトでは、ワークスペースのルートにある.bazelrcファイルが使用されます。
--log_pathMCP_LOG_PATHlog_pathサーバー ログを書き込むパス。

デバッグ

コンソールへの詳細なログ記録を有効にするにはDEBUG=true環境変数を設定します。

ログ パスを設定すると、コンソールにログを出力しないクライアント (Cursor を参照) でのデバッグにも役立ちます。

ライセンス

このプロジェクトはMITライセンスの下で提供されています。詳細はLICENSEファイルをご覧ください。

-
security - not tested
A
license - permissive license
-
quality - not tested

local-only server

The server can only run on the client's local machine because it depends on local resources.

Bazel ビルド システム機能を AI エージェントに公開するローカル MCP サーバー。これにより、Bazel に直接アクセスできない環境でも、自然言語を使用して Bazel プロジェクトをビルド、テスト、クエリ、管理できます。

  1. ツール
    1. 使用法
      1. インストール
      2. 構成
      3. 構成表
    2. デバッグ
      1. ライセンス

        Related MCP Servers

        • -
          security
          A
          license
          -
          quality
          An MCP server implementation that standardizes how AI applications access tools and context, providing a central hub that manages tool discovery, execution, and context management with a simplified configuration system.
          Last updated -
          9
          Python
          MIT License
        • -
          security
          A
          license
          -
          quality
          An MCP server that implements Claude Code-like functionality, allowing the AI to analyze codebases, modify files, execute commands, and manage projects through direct file system interactions.
          Last updated -
          179
          Python
          MIT License
          • Apple
          • Linux
        • -
          security
          F
          license
          -
          quality
          An MCP server that allows AI models to execute system commands on local machines or remote hosts via SSH, supporting persistent sessions and environment variables.
          Last updated -
          10
          1
          TypeScript
        • A
          security
          A
          license
          A
          quality
          A Model Context Protocol server that enables AI assistants to interact with Linear project management systems, allowing users to retrieve, create, and update issues, projects, and teams through natural language.
          Last updated -
          32
          80
          5
          TypeScript
          MIT License
          • Apple

        View all related MCP servers

        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/nacgarg/bazel-mcp-server'

        If you have feedback or need assistance with the MCP directory API, please join our Discord server