GCP BigQuery MCP Server
GCP BigQuery MCP サーバー
Google Cloud Platform BigQuery向けのエンタープライズグレードMCP(Model Context Protocol)サーバー。Workload Identity Federation認証を使用し、Model Context Protocolを通じてBigQueryへの安全なキーレスアクセスを提供します。
主な機能
サービスアカウントキー不要 - 100% Workload Identity Federationを採用
Google Workspace統合 - OIDCユーザー認証
MCPプロトコル準拠 - 公式MCP SDKのベストプラクティスに準拠
マルチテナント対応 - YAML許可リスト + BigQueryデータセットのIAM条件
セキュリティミドルウェア - レート制限、プロンプトインジェクション検知、データマスキング
Model Armorプリフライト - ツール実行前のオプションのコンテンツ安全性チェック
Private Service Connect - エンタープライズ消費者向けのオプションのプライベートイングレス
顧客管理暗号化 - BigQueryデータセット向けのCMEK
包括的な監査ログ - コンプライアンスのための7年間の保持期間
Terraformインフラストラクチャ - 再現可能なデプロイのための完全なIaC
Cloud Runデプロイ - サーバーレス、自動スケーリングアーキテクチャ
OpenTelemetry - 分散トレーシングとテナントごとのメトリクス
Related MCP server: bq_mcp_server
プロジェクト構造
db-mcp/
├── src/ # TypeScript source code
│ ├── auth/ # WIF authentication modules
│ ├── bigquery/ # BigQuery client, discovery, optimization
│ ├── mcp/ # MCP protocol handlers and tools
│ ├── security/ # Security middleware
│ ├── monitoring/ # Health checks and monitoring
│ ├── telemetry/ # OpenTelemetry instrumentation
│ ├── config/ # Configuration management
│ └── utils/ # Logging utilities
├── tests/ # Unit, integration, and performance tests
├── terraform/ # Infrastructure as Code
│ └── modules/ # Reusable Terraform modules
├── docs/ # Comprehensive documentation
├── scripts/ # Deployment and utility scripts
├── examples/ # Usage examples
├── .github/workflows/ # CI/CD automation
└── Dockerfile # Production container imageセキュリティアーキテクチャ
従来のアプローチ(回避済み)
ファイルやシークレットに保存されたサービスアカウントキー
有効期限のない永続的な認証情報
手動でのキーローテーションが必要
認証情報漏洩のリスクが高い
Workload Identity Federation(実装済み)
システム内にキーを一切保持しない
自動ローテーション付きの1時間トークン有効期限
きめ細かな制御のための属性ベースのアクセス
すべてのアクセスに対する完全な監査証跡
攻撃対象領域を90%削減
クイックスタート
前提条件
課金が有効なGCPプロジェクト
Terraform >= 1.5.0
Node.js >= 22.0.0
Docker(コンテナ化用)
インストール
# Clone and install dependencies
npm install
# Copy environment configuration
cp .env.example .env
# Build the project
npm run buildローカル開発
# Development mode with hot reload
npm run dev
# Run tests
npm test
# Type checking
npm run typecheck本番環境へのデプロイ
# Build Docker image
docker build -t mcp-bigquery-server .
# Deploy infrastructure with Terraform
cd terraform
terraform init
terraform apply
# Deploy to Cloud Run
gcloud run deploy mcp-bigquery-server \
--image gcr.io/YOUR_PROJECT/mcp-bigquery-server \
--region us-central1MCPツール
サーバーは以下のMCPツールを提供します:
ツール | 説明 |
| BigQueryデータセットに対してSQLクエリを実行 |
| 利用可能なすべてのBigQueryデータセットを一覧表示 |
| 特定のデータセット内のテーブルを一覧表示 |
| テーブルのスキーマ情報を取得 |
サーバー機能:
リソース:BigQueryデータセットの一覧表示
ツール:クエリ実行およびスキーマ検査
Stderrログ:すべてのログをstderrに出力(JSON-RPC互換)
グレースフルシャットダウン:SIGTERM/SIGINT処理
アーキテクチャ
Client Request
↓
MCP Protocol Layer (JSON-RPC)
↓
Security Middleware (rate limiting, injection detection)
↓
Workload Identity Federation
↓ (OIDC Token)
Identity Pool
↓ (Attribute Mapping)
Service Account Impersonation
↓ (1-hour access token)
BigQuery APIコアコンポーネント
Workload Identity Federation - OIDCプロバイダーを使用した開発/ステージング/本番環境用のIDプール
セキュリティミドルウェア - レート制限、プロンプトインジェクション検知、SQLインジェクション防止
BigQuery統合 - コネクションプーリング、クエリ最適化、データセット検出
モニタリング - ヘルスチェック、OpenTelemetryトレーシング、Cloud Monitoring統合
ドキュメント
ドキュメント | 説明 |
ローカル開発、テスト、本番環境向けの完全ガイド | |
システム設計およびコンポーネントドキュメント | |
セキュリティミドルウェアとベストプラクティス | |
Workload Identity Federationの詳細 | |
完全な本番環境デプロイガイド | |
コンテナ設定 | |
可観測性の設定 | |
完全なドキュメントマップ |
テスト
# Run all tests
npm test
# Run specific test suites
npm run test:unit
npm run test:integration
npm run test:performance
# Run with coverage
npm run test:coverage
# Watch mode
npm run test:watch開発コマンド
npm run build # Build TypeScript
npm run dev # Development with hot reload
npm run start # Start production server
npm run lint # Run ESLint
npm run lint:fix # Fix linting issues
npm run format # Format with Prettier
npm run typecheck # TypeScript type checkingCI/CD
GitHub Actionsワークフローが自動的に以下を実行します:
プルリクエストに対するテストの実行
Dockerイメージのビルドとプッシュ
メインブランチへのCloud Runデプロイ
Workload Identity Federationの使用(キーなし)
モニタリング
Cloud Monitoring:
mcp.tool.calls.totalおよびmcp.tool.call.durationにtenant_idディメンションを設定した事前構成済みダッシュボードCloud Logging: 構造化JSONログ
Cloud Trace:
tenant.idスパン属性を使用したOpenTelemetryによる分散トレーシング監査ログ: BigQueryでの7年間の保持
アラート: メール/Slack通知
コンプライアンス
GDPR: データの保存場所とアクセスログ
HIPAA: アクセス制御と監査証跡
SOC 2: ID管理とモニタリング
PCI-DSS: 認証と認可
貢献
貢献を歓迎します!ガイドラインについては CONTRIBUTING.md を参照してください。
ライセンス
MITライセンス - 詳細は LICENSE を参照してください
謝辞
ステータス: 本番環境対応 バージョン: 1.0.0 最終更新日: 2026年4月
Tool Schema Changelog
Recent tool additions, removals, and schema changes observed during successful MCP inspections. Dates show when Glama detected each change.
No tool schema history has been recorded yet.
This server cannot be installed
Maintenance
Resources
Unclaimed servers have limited discoverability.
Looking for Admin?
If you are the server author, to access and configure the admin panel.
Related MCP Connectors
The BigQuery remote MCP server is a fully managed service that uses the Model Context Protocol to connect AI applications and LLMs to BigQuery data sources. It provides secure, standardized tools for AI agents to list datasets and tables, retrieve schemas, generate and execute SQL queries through natural language, and analyze data—enabling direct access to enterprise analytics data without requiring manual SQL coding.
Governed MCP gateway: one endpoint for your tools, with credential custody and audit log.
Cloud-hosted MCP server for secure AI access to enterprise data sources via CData Connect AI.
Query your warehouse or a CSV with Claude/ChatGPT over MCP, governed by table-level ACL + audit.
Related MCP Servers
- AlicenseNot gradedqualityBmaintenanceA read-only BigQuery MCP server with auto-LIMIT injection, dry-run cost guard, and ADC authentication. Allows safe SQL querying of BigQuery by LLMs without risk of data modification or unexpected costs.1MIT
- AlicenseAqualityCmaintenanceA Python MCP server that retrieves and caches BigQuery metadata (datasets, tables, columns) and enables secure SQL query execution with cost control, file export, and keyword search.6MIT
- AlicenseNot gradedqualityDmaintenanceProduction-ready MCP server for BigQuery that translates natural language questions to SQL, executes queries securely, and delivers results via stdio or HTTP for integration with GitHub Copilot, Power BI, and web applications.237MIT
- AlicenseNot gradedqualityDmaintenanceMCP server for secure BigQuery access across multiple Google Cloud projects, enabling querying, schema exploration, and data analysis with SQL validation and read-only controls.2MIT
Appeared in Searches
Latest Blog Posts
- Who's Calling? MCP Hosts Are an Identity Blind Spot (And the Spec Knows It)By Om-Shree-0709 on .mcpAgent IdentityOAuth 2.1
- Your AI Chatbot Just Exposed Your CEO's Salary to an InternBy Om-Shree-0709 on .Agent IdentityMCP SecurityOAuth Delegation
- Why MCP Servers Need Execution Sandboxing (And Why Your Current Stack Isn't Enough)By Om-Shree-0709 on .Agentic AiPrompt InjectionWebAssembly
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/erayguner/db-mcp'
If you have feedback or need assistance with the MCP directory API, please join our Discord server