GCP BigQuery MCP Server
GCP BigQuery MCP-Server
MCP-Server (Model Context Protocol) auf Enterprise-Niveau für Google Cloud Platform BigQuery mit Workload Identity Federation-Authentifizierung. Bietet sicheren, schlüssellosen Zugriff auf BigQuery über das Model Context Protocol.
Hauptfunktionen
Keine Service-Account-Schlüssel - 100% Workload Identity Federation
Google Workspace-Integration - OIDC-Benutzerauthentifizierung
MCP-Protokoll-konform - Befolgt die Best Practices des offiziellen MCP SDK
Multi-Mandanten-fähig - YAML-Allowlist + IAM-Bedingungen für BigQuery-Datasets
Sicherheits-Middleware - Ratenbegrenzung, Erkennung von Prompt-Injection, Daten-Schwärzung
Model Armor Pre-flight - Optionale Inhaltsprüfung vor der Tool-Ausführung
Private Service Connect - Optionaler privater Ingress für Unternehmenskunden
Kundenseitig verwaltete Verschlüsselung - CMEK für BigQuery-Datasets
Umfassende Audit-Protokollierung - 7 Jahre Aufbewahrungsfrist für Compliance
Terraform-Infrastruktur - Vollständiges IaC für reproduzierbare Bereitstellungen
Cloud Run-Bereitstellung - Serverlose, automatisch skalierende Architektur
OpenTelemetry - Verteiltes Tracing und Metriken pro Mandant
Related MCP server: bq_mcp_server
Projektstruktur
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 imageSicherheitsarchitektur
Traditioneller Ansatz (vermieden)
Service-Account-Schlüssel in Dateien/Geheimnissen gespeichert
Permanente Anmeldedaten, die nie ablaufen
Manuelle Schlüsselrotation erforderlich
Hohes Risiko von Anmeldedaten-Lecks
Workload Identity Federation (implementiert)
Keine Schlüssel im System
1-Stunden-Token-Lebensdauer mit automatischer Rotation
Attributbasierter Zugriff für fein abgestufte Kontrolle
Vollständiger Audit-Pfad für alle Zugriffe
90% Reduzierung der Angriffsfläche
Schnellstart
Voraussetzungen
GCP-Projekt mit aktivierter Abrechnung
Terraform >= 1.5.0
Node.js >= 22.0.0
Docker (für Containerisierung)
Installation
# Clone and install dependencies
npm install
# Copy environment configuration
cp .env.example .env
# Build the project
npm run buildLokale Entwicklung
# Development mode with hot reload
npm run dev
# Run tests
npm test
# Type checking
npm run typecheckProduktionsbereitstellung
# 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-Tools
Der Server stellt diese MCP-Tools bereit:
Tool | Beschreibung |
| SQL-Abfragen auf BigQuery-Datasets ausführen |
| Alle verfügbaren BigQuery-Datasets auflisten |
| Tabellen in einem bestimmten Dataset auflisten |
| Schema-Informationen für eine Tabelle abrufen |
Server-Funktionen:
Ressourcen: Auflistung von BigQuery-Datasets
Tools: Abfrageausführung und Schema-Inspektion
Stderr-Protokollierung: Alle Protokolle an stderr (JSON-RPC-kompatibel)
Graceful Shutdown: SIGTERM/SIGINT-Behandlung
Architektur
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 APIKernkomponenten
Workload Identity Federation - Identitätspools für Dev/Staging/Prod mit OIDC-Anbietern
Sicherheits-Middleware - Ratenbegrenzung, Erkennung von Prompt-Injection, SQL-Injection-Prävention
BigQuery-Integration - Verbindungspooling, Abfrageoptimierung, Dataset-Erkennung
Überwachung - Gesundheitsprüfungen, OpenTelemetry-Tracing, Cloud Monitoring-Integration
Dokumentation
Dokument | Beschreibung |
Vollständige Anleitung für lokale Entwicklung, Tests und Produktion | |
Systemdesign und Komponentendokumentation | |
Sicherheits-Middleware und Best Practices | |
Details zur Workload Identity Federation | |
Vollständige Anleitung zur Produktionsbereitstellung | |
Container-Konfiguration | |
Einrichtung der Beobachtbarkeit | |
Vollständige Dokumentationsübersicht |
Tests
# 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:watchEntwicklungsbefehle
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
Der GitHub Actions-Workflow führt automatisch Folgendes aus:
Führt Tests bei Pull Requests aus
Erstellt und pusht das Docker-Image
Stellt auf dem Haupt-Branch auf Cloud Run bereit
Verwendet Workload Identity Federation (keine Schlüssel)
Überwachung
Cloud Monitoring: Vorkonfigurierte Dashboards mit
tenant_id-Dimension fürmcp.tool.calls.totalundmcp.tool.call.durationCloud Logging: Strukturierte JSON-Protokolle
Cloud Trace: Verteiltes Tracing über OpenTelemetry mit
tenant.id-Span-AttributAudit-Protokolle: 7 Jahre Aufbewahrungsfrist in BigQuery
Warnungen: E-Mail/Slack-Benachrichtigungen
Compliance
GDPR: Datenresidenz und Zugriffsprotokollierung
HIPAA: Zugriffskontrollen und Audit-Pfade
SOC 2: Identitätsmanagement und Überwachung
PCI-DSS: Authentifizierung und Autorisierung
Mitwirken
Beiträge sind willkommen! Siehe CONTRIBUTING.md für Richtlinien.
Lizenz
MIT-Lizenz - siehe LICENSE für Details
Danksagungen
Erstellt mit MCP SDK
Unterstützt durch Google Cloud BigQuery
Infrastruktur durch Terraform
Status: Produktionsbereit Version: 1.0.0 Zuletzt aktualisiert: April 2026
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