Skip to main content
Glama
erayguner

GCP BigQuery MCP Server

by erayguner

GCP BigQuery MCP 서버

CI MegaLinter TypeScript Node MCP SDK OpenTelemetry License: MIT PRs Welcome

Workload Identity Federation 인증을 사용하는 Google Cloud Platform BigQuery용 엔터프라이즈급 MCP(Model Context Protocol) 서버입니다. Model Context Protocol을 통해 BigQuery에 대한 안전한 키리스(keyless) 액세스를 제공합니다.

주요 기능

  • 서비스 계정 키 없음 - 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-central1

MCP 도구

서버는 다음과 같은 MCP 도구를 제공합니다:

도구

설명

query_bigquery

BigQuery 데이터 세트에서 SQL 쿼리 실행

list_datasets

사용 가능한 모든 BigQuery 데이터 세트 나열

list_tables

특정 데이터 세트의 테이블 나열

get_table_schema

테이블의 스키마 정보 가져오기

서버 기능:

  • 리소스: 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

핵심 구성 요소

  1. Workload Identity Federation - OIDC 공급자가 포함된 개발/스테이징/프로덕션용 ID 풀

  2. 보안 미들웨어 - 속도 제한, 프롬프트 주입 탐지, SQL 주입 방지

  3. BigQuery 통합 - 연결 풀링, 쿼리 최적화, 데이터 세트 검색

  4. 모니터링 - 상태 확인, OpenTelemetry 추적, Cloud Monitoring 통합

문서

문서

설명

사용 가이드

로컬 개발, 테스트 및 프로덕션을 위한 전체 가이드

아키텍처

시스템 설계 및 구성 요소 문서

보안

보안 미들웨어 및 모범 사례

WIF 가이드

Workload Identity Federation 세부 정보

배포

전체 프로덕션 배포 가이드

Docker

컨테이너 구성

모니터링

관측 가능성 설정

문서 인덱스

전체 문서 맵

테스트

# 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 checking

CI/CD

GitHub Actions 워크플로우는 자동으로 다음을 수행합니다:

  1. 풀 리퀘스트 시 테스트 실행

  2. Docker 이미지 빌드 및 푸시

  3. 메인 브랜치에 Cloud Run으로 배포

  4. Workload Identity Federation 사용 (키 없음)

모니터링

  • Cloud Monitoring: mcp.tool.calls.totalmcp.tool.call.durationtenant_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.

Maintenance

ActivitySlowing
ResponsivenessNo issues

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

Related MCP Servers

  • A
    license
    Not graded
    quality
    B
    maintenance
    A 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.
    1
    MIT
  • A
    license
    A
    quality
    C
    maintenance
    A 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.
    6
    MIT
  • A
    license
    Not graded
    quality
    D
    maintenance
    Production-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.
    237
    MIT
  • A
    license
    Not graded
    quality
    D
    maintenance
    MCP server for secure BigQuery access across multiple Google Cloud projects, enabling querying, schema exploration, and data analysis with SQL validation and read-only controls.
    2
    MIT

Latest Blog Posts

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