BigQuery MCP Server for SAP Data Analysis
Provides tools to list the tables in a BigQuery dataset, describe the schema of any table, and run SQL queries against SAP Cortex data stored in BigQuery, returning results with proper date/time/numeric serialization.
This server does not currently have a deployable release on Glama. Follow the repository's setup instructions to install and configure it for your MCP client, including any required credentials and local dependencies.
BigQuery MCP Server for SAP Data Analysis
A Model Context Protocol (MCP) server that provides Claude Code and Claude Desktop with direct access to SAP data stored in Google BigQuery. This enables natural language querying and analysis of enterprise SAP data.
Overview
This project demonstrates how to build an MCP server that:
Connects Claude AI to Google BigQuery datasets
Enables natural language SQL queries on SAP Cortex data
Deploys as a serverless Google Cloud Run Function
Integrates with both Claude Code CLI and Claude Desktop
Related MCP server: bigquery-mcp
Features
3 MCP Tools:
list_tables- List all tables in the BigQuery datasetdescribe_table- Get schema information for any tablequery_bigquery- Execute SQL queries and return results
Dual Deployment:
Local MCP server for Claude Code/Desktop
Cloud-hosted HTTP endpoint on Google Cloud Run
Enterprise Ready:
Handles complex SAP data structures
Supports date/time/numeric serialization
CORS-enabled for web integrations
Architecture
┌─────────────────┐
│ Claude Code │
│ Claude Desktop │
└────────┬────────┘
│
├─────────────────┐
│ │
┌────▼─────┐ ┌────▼──────────────┐
│ MCP │ │ Cloud Run │
│ Wrapper │ │ Function │
│ (Local) │ │ (HTTP Endpoint) │
└────┬─────┘ └────┬──────────────┘
│ │
└────────┬───────┘
│
┌──────▼───────┐
│ BigQuery │
│ Dataset │
└──────────────┘Prerequisites
Required
Python 3.13+
Node.js 18+ and npm
Google Cloud account with billing enabled
Google Cloud SDK (
gcloudCLI)BigQuery dataset with data
Optional
Claude Code CLI (
npm install -g @anthropic-ai/claude-code)Claude Desktop application
Installation
1. Clone the Repository
git clone https://github.com/yourusername/mcp-bigquery-server.git
cd mcp-bigquery-server2. Install Python Dependencies
pip install -r requirements.txt3. Configure Google Cloud
# Set your project
gcloud config set project YOUR_PROJECT_ID
# Authenticate
gcloud auth login
gcloud auth application-default login
# Create service account (optional but recommended)
gcloud iam service-accounts create bigquery-mcp-server \
--display-name="BigQuery MCP Server"
# Grant BigQuery permissions
gcloud projects add-iam-policy-binding YOUR_PROJECT_ID \
--member="serviceAccount:bigquery-mcp-server@YOUR_PROJECT_ID.iam.gserviceaccount.com" \
--role="roles/bigquery.user"4. Update Configuration
Edit server.py and main.py to set your project and dataset:
PROJECT_ID = "your-project-id"
DATASET_ID = "your-dataset-name"Update mcp_wrapper.js with your Cloud Run URL (after deployment):
const MCP_SERVER_URL = 'your-region-your-project.cloudfunctions.net';
const MCP_SERVER_PATH = '/bigquery-mcp-server';Deployment
Deploy to Google Cloud Run
gcloud functions deploy bigquery-mcp-server \
--gen2 \
--runtime=python313 \
--region=us-west1 \
--source=. \
--entry-point=bigquery_mcp_handler \
--trigger-http \
--allow-unauthenticated \
--service-account=bigquery-mcp-server@YOUR_PROJECT_ID.iam.gserviceaccount.com \
--set-env-vars GCP_PROJECT_ID=YOUR_PROJECT_ID,DATASET_ID=YOUR_DATASET_NAMENote: The function will output a URL like:
https://REGION-PROJECT_ID.cloudfunctions.net/bigquery-mcp-serverSave this URL - you'll need it for the MCP wrapper configuration.
Configuration
For Claude Code CLI
Add the MCP server:
claude mcp add bigquery-sap node /path/to/mcp_wrapper.jsVerify connection:
claude mcp listFor Claude Desktop
Edit %APPDATA%\Claude\claude_desktop_config.json (Windows) or ~/Library/Application Support/Claude/claude_desktop_config.json (Mac):
{
"mcpServers": {
"bigquery-sap": {
"command": "node",
"args": ["/absolute/path/to/mcp_wrapper.js"]
}
}
}Restart Claude Desktop to load the configuration.
Usage
In Claude Desktop
Ask Claude natural language questions:
"List all tables in the BigQuery dataset"
"Query the SalesOrders table and show me the top 10 orders by value"
"Analyze sales trends by month from the AccountingDocuments table"In Claude Code CLI
claude "Use the list_tables tool to show all available tables"
claude "Query the inventory data and identify slow-moving items"Direct HTTP API
# List tables
curl -X POST https://YOUR-FUNCTION-URL/bigquery-mcp-server \
-H "Content-Type: application/json" \
-d '{"action": "list_tables"}'
# Query data
curl -X POST https://YOUR-FUNCTION-URL/bigquery-mcp-server \
-H "Content-Type: application/json" \
-d '{"action": "query", "query": "SELECT * FROM dataset.table LIMIT 10"}'Project Structure
mcp-bigquery-server/
├── server.py # Core MCP server logic
├── main.py # Cloud Function HTTP handler
├── mcp_wrapper.js # Local MCP protocol wrapper
├── requirements.txt # Python dependencies
├── .gcloudignore # Files to exclude from deployment
├── .gitignore # Git ignore rules
├── README.md # This file
├── CLAUDE_CODE_USAGE.md # Detailed usage guide
└── LICENSE # MIT licenseSecurity Considerations
⚠️ Important Security Notes:
Never commit service account keys - They're excluded via
.gitignoreUse IAM roles instead of service account keys in production
Restrict BigQuery access to only necessary datasets/tables
Consider authentication for the Cloud Run endpoint in production
Use VPC Service Controls for additional security in enterprise environments
Troubleshooting
MCP Server Not Connecting
# Check server health
claude mcp list
# Test MCP wrapper directly
node mcp_wrapper.js
{"jsonrpc":"2.0","id":1,"method":"tools/list","params":{}}BigQuery Permission Errors
# Verify service account permissions
gcloud projects get-iam-policy YOUR_PROJECT_ID \
--flatten="bindings[].members" \
--filter="bindings.members:YOUR_SERVICE_ACCOUNT"Cloud Function Deployment Issues
# View function logs
gcloud functions logs read bigquery-mcp-server --region=us-west1
# Check function status
gcloud functions describe bigquery-mcp-server --region=us-west1Use Cases
Financial Analysis: Query P&L statements, balance sheets, and accounting documents
Sales Analytics: Analyze order trends, customer behavior, and revenue metrics
Inventory Management: Track stock levels, movements, and turnover rates
Procurement: Monitor vendor performance, PO fulfillment, and spend analysis
Executive Dashboards: Create real-time KPI reports from live SAP data
Contributing
Contributions are welcome! Please feel free to submit a Pull Request.
License
This project is licensed under the MIT License - see the LICENSE file for details.
Acknowledgments
Built with Anthropic's Model Context Protocol
Designed for Google Cloud BigQuery
Integrates with Claude Code and Claude Desktop
Resources
Author
Julien Delvat
Support
For issues and questions:
Open an issue on GitHub
Check the CLAUDE_CODE_USAGE.md for detailed examples
Note: This is a reference implementation. Please review and adjust security settings, IAM permissions, and configurations according to your organization's requirements before deploying to production.
Tool Schema Changelog
Recent tool additions, removals, and schema changes observed during successful MCP inspections.
Loading tool schema changelog…
This server cannot be deployed
Maintenance
Related MCP Connectors
Read-only Google Ads, GA4 and Search Console data for Claude, with no Google Cloud setup.
GA4, Google Ads and Search Console in Claude. Read-only OAuth, multi-account for agencies.
Hosted BigQuery MCP server for Claude, ChatGPT and Cursor, with each action switched per account.
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.
Related MCP Servers
- AlicenseNot gradedqualityDmaintenanceEnables Claude to connect to and interact with SQLite, SQL Server, PostgreSQL, and MySQL databases through natural language. Supports executing queries, managing tables, exporting data, and storing business insights with authentication options including AWS IAM.MIT
- AlicenseNot gradedqualityDmaintenanceEnables AI assistants to query and analyze Google BigQuery data, including schema browsing, running queries, and comparing datasets through natural language.MIT
- AlicenseNot gradedqualityFmaintenanceEnables connecting to any SQL database, exploring schemas, running queries, and visualizing results with interactive charts from Claude Desktop.MIT
- FlicenseNot gradedqualityBmaintenanceEnables Claude Code to connect to SAP systems via ADT, allowing it to search ABAP objects, read source code, run read-only SQL queries, and check connection status.-