0
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?

Codex CLI で Bigquery を操作する

0
Posted at

概要

Codex CLI から Bigquery のテーブル等の情報を取得する際に、MCPを使用して Bigquery と接続する方法を記載する。

手順

Google Cloud の認証情報をローカルに設定する

Google Cloud CLI をインストール

brew install --cask gcloud-cli

インストール後、認証情報を設定

gcloud auth application-default login --disable-quota-project

確認

cat ~/.config/gcloud/application_default_credentials.json

MCPツールボックスをダウンロード

ツールボックスをDL(下記は /Users/ユーザー名/bin フォルダ配下にDLするコマンドの例)

mkdir ~/bin
cd ~/bin
curl -O https://storage.googleapis.com/genai-toolbox/v0.21.0/darwin/arm64/toolbox

権限変更

chmod +x toolbox

インストールを確認

./toolbox --version

Codex CLI コマンドでMCP追加

config.tomlに下記追記

[mcp_servers.bigquery]
command = "/Users/ユーザー名/bin/toolbox"
args = ["--prebuilt","bigquery","--stdio"]
env = { "BIGQUERY_PROJECT" = "myproject" }

Codex起動

codex

MCPが有効か確認

/mcp

参考

0
0
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
0
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?