loading…
Search for a command to run...
loading…
Enables management of Google Cloud services including BigQuery, Cloud Logging, Cloud Storage, and Compute Engine via MCP tools.
Enables management of Google Cloud services including BigQuery, Cloud Logging, Cloud Storage, and Compute Engine via MCP tools.
A comprehensive Model Context Protocol (MCP) server for Google Cloud Platform services. This project provides Python wrapper modules and MCP tools for managing various GCP services including BigQuery, Cloud Logging, Cloud Storage, and Compute Engine.
uv tool install google-cloud-mcp
git clone https://github.com/lockon-n/google-cloud-mcp.git
cd google-cloud-mcp
pip install -e .
service-account-key.json in your project rootgcloud auth application-default login
uv run main.py
google-cloud-bigquery_execute_queryExecute SQL queries with optional cost estimation.
{
"query": "SELECT * FROM dataset.table LIMIT 10",
"dry_run": false,
"max_results": 1000
}
google-cloud-bigquery_create_datasetCreate a new BigQuery dataset.
{
"dataset_id": "my_dataset",
"description": "My dataset description",
"location": "US"
}
google-cloud-bigquery_create_tableCreate a new table with schema.
{
"dataset_id": "my_dataset",
"table_id": "my_table",
"schema": [
{"name": "id", "type": "INTEGER", "mode": "REQUIRED"},
{"name": "name", "type": "STRING", "mode": "NULLABLE"}
]
}
google-cloud-bigquery_load_data_from_csvLoad data from CSV file into BigQuery table.
{
"dataset_id": "my_dataset",
"table_id": "my_table",
"csv_file_path": "/path/to/data.csv",
"write_disposition": "WRITE_APPEND"
}
google-cloud-bigquery_export_to_storageExport BigQuery table to Cloud Storage.
{
"dataset_id": "my_dataset",
"table_id": "my_table",
"bucket_name": "my-bucket",
"file_path": "exports/data.csv"
}
google-cloud-bigquery_list_datasetsList all datasets in the project.
google-cloud-bigquery_list_tablesList all tables in a dataset.
{
"dataset_id": "my_dataset"
}
google-cloud-bigquery_get_job_statusGet the status of a BigQuery job.
{
"job_id": "job_12345"
}
google-cloud-logging_write_logWrite log entries (text or structured).
{
"log_name": "my-application",
"message": "Application started successfully",
"severity": "INFO",
"labels": {"component": "backend"}
}
google-cloud-logging_read_logsRead and filter log entries.
{
"filter_string": "severity>=ERROR",
"max_results": 100,
"time_range_hours": 24
}
google-cloud-logging_list_logsList all log names in the project.
google-cloud-logging_delete_logDelete all entries in a specific log.
{
"log_name": "old-application"
}
google-cloud-logging_create_log_bucketCreate a new log bucket for retention management.
{
"bucket_id": "my-log-bucket",
"retention_days": 90,
"description": "Application logs bucket",
"locked": false
}
google-cloud-logging_update_log_bucketUpdate log bucket configuration.
{
"bucket_id": "my-log-bucket",
"retention_days": 120,
"description": "Updated description"
}
google-cloud-logging_delete_log_bucketDelete a log bucket.
{
"bucket_id": "my-log-bucket"
}
google-cloud-logging_clear_log_bucketClear all logs from a bucket while keeping the bucket.
{
"bucket_id": "my-log-bucket"
}
google-cloud-logging_list_log_bucketsList all log buckets in the project.
google-cloud-logging_create_log_sinkCreate a log sink for exporting logs.
{
"sink_name": "my-sink",
"destination": "storage.googleapis.com/my-export-bucket",
"filter_string": "severity>=WARNING"
}
google-cloud-logging_list_log_sinksList all log sinks in the project.
google-cloud-logging_delete_log_sinkDelete a log sink.
{
"sink_name": "my-sink"
}
google-cloud-logging_create_exclusionCreate a log exclusion filter.
{
"exclusion_name": "debug-exclusion",
"filter_string": "severity<INFO"
}
google-cloud-logging_list_exclusionsList all log exclusions.
google-cloud-logging_delete_exclusionDelete a log exclusion.
{
"exclusion_name": "debug-exclusion"
}
google-cloud-logging_search_logsSearch logs with simplified parameters.
{
"search_query": "error occurred",
"time_range_hours": 12,
"severity_levels": ["ERROR", "CRITICAL"]
}
google-cloud-logging_export_logs_to_storageCreate a sink to export logs to Cloud Storage.
{
"sink_name": "storage-export",
"bucket_name": "my-log-exports"
}
google-cloud-logging_export_logs_to_bigqueryCreate a sink to export logs to BigQuery.
{
"sink_name": "bigquery-export",
"dataset_id": "log_analysis"
}
google-cloud-storage_create_bucketCreate a new Cloud Storage bucket.
{
"bucket_name": "my-new-bucket",
"location": "US",
"storage_class": "STANDARD"
}
google-cloud-storage_delete_bucketDelete a bucket.
{
"bucket_name": "my-bucket"
}
google-cloud-storage_list_bucketsList all buckets in the project.
google-cloud-storage_upload_fileUpload a file to a bucket.
{
"bucket_name": "my-bucket",
"local_file_path": "/path/to/file.txt",
"blob_name": "uploads/file.txt"
}
google-cloud-storage_download_fileDownload a file from a bucket.
{
"bucket_name": "my-bucket",
"blob_name": "uploads/file.txt",
"local_file_path": "/path/to/download/file.txt"
}
google-cloud-storage_delete_fileDelete a file from a bucket.
{
"bucket_name": "my-bucket",
"blob_name": "uploads/file.txt"
}
google-cloud-storage_list_filesList files in a bucket.
{
"bucket_name": "my-bucket",
"prefix": "uploads/",
"max_results": 100
}
google-cloud-storage_copy_fileCopy a file within or between buckets.
{
"source_bucket": "source-bucket",
"source_blob": "file.txt",
"destination_bucket": "dest-bucket",
"destination_blob": "backup/file.txt"
}
google-cloud-storage_move_fileMove a file within or between buckets.
{
"source_bucket": "source-bucket",
"source_blob": "file.txt",
"destination_bucket": "dest-bucket",
"destination_blob": "moved/file.txt"
}
google-cloud-storage_generate_signed_urlGenerate a signed URL for temporary access.
{
"bucket_name": "my-bucket",
"blob_name": "private/file.txt",
"expiration_hours": 24,
"method": "GET"
}
google-cloud-storage_set_bucket_lifecycleSet lifecycle management policies.
{
"bucket_name": "my-bucket",
"rules": [
{
"action": "Delete",
"conditions": {"age": 365}
}
]
}
google-cloud-storage_batch_uploadUpload multiple files to a bucket.
{
"bucket_name": "my-bucket",
"file_mappings": [
{
"local_path": "/path/file1.txt",
"blob_name": "uploads/file1.txt"
}
]
}
google-cloud-storage_batch_downloadDownload multiple files from a bucket.
{
"bucket_name": "my-bucket",
"file_mappings": [
{
"blob_name": "uploads/file1.txt",
"local_path": "/path/download/file1.txt"
}
]
}
google-cloud-storage_search_filesSearch for files using patterns.
{
"bucket_name": "my-bucket",
"name_pattern": "*.log",
"size_range": {"min_bytes": 1024, "max_bytes": 1048576}
}
google-cloud-compute_create_instanceCreate a new VM instance.
{
"instance_name": "my-vm",
"zone": "us-central1-a",
"machine_type": "e2-medium",
"image_family": "ubuntu-2004-lts",
"image_project": "ubuntu-os-cloud"
}
google-cloud-compute_delete_instanceDelete a VM instance.
{
"instance_name": "my-vm",
"zone": "us-central1-a"
}
google-cloud-compute_start_instanceStart a stopped VM instance.
{
"instance_name": "my-vm",
"zone": "us-central1-a"
}
google-cloud-compute_stop_instanceStop a running VM instance.
{
"instance_name": "my-vm",
"zone": "us-central1-a"
}
google-cloud-compute_restart_instanceRestart a VM instance.
{
"instance_name": "my-vm",
"zone": "us-central1-a"
}
google-cloud-compute_list_instancesList all VM instances in a zone.
{
"zone": "us-central1-a"
}
google-cloud-compute_get_instanceGet detailed information about a VM instance.
{
"instance_name": "my-vm",
"zone": "us-central1-a"
}
google-cloud-compute_list_zonesList all available zones in the project.
google-cloud-compute_get_operation_statusGet the status of a Compute Engine operation.
{
"operation_name": "operation-123456",
"zone": "us-central1-a"
}
Add the following configuration to your Claude Desktop MCP settings file:
{
"mcpServers": {
"google-cloud-mcp": {
"command": "uvx",
"args": [
"google-cloud-mcp",
"--project-id", "your-project-id",
"--service-account-path", "/path/to/your/service-account-key.json"
"--allowed-buckets", "bucket1,bucket2,bucket3",
"--allowed-datasets", "dataset1,dataset2",
"--allowed-log-buckets", "log-bucket1",
"--allowed-instances", "vm1,vm2"
],
}
}
}
your-project-id with your actual Google Cloud Project ID/path/to/your/service-account-key.json with the path to your service account JSON fileThe project follows a modular architecture with separate managers for each GCP service:
src/big_query.py): Data warehouse operations including query execution, data loading/exporting, job management, and cost estimationsrc/cloud_logging.py): Log management operations including reading/writing logs, managing buckets, sinks, exclusions, and metricssrc/cloud_storage.py): Bucket and object management including CRUD operations, lifecycle management, and batch operationssrc/compute_engine.py): Virtual machine management including instance lifecycle operations and zone managementEach manager class follows a consistent pattern:
project_id and optional service_account_pathRun the test server:
uv run test_server.py
This will test all available MCP tools and verify their functionality.
google-cloud-mcp/
├── src/
│ ├── __init__.py
│ ├── server.py # MCP server implementation
│ ├── big_query.py # BigQuery manager
│ ├── cloud_logging.py # Cloud Logging manager
│ ├── cloud_storage.py # Cloud Storage manager
│ └── compute_engine.py # Compute Engine manager
├── main.py # Entry point
├── test_server.py # Test runner
├── pyproject.toml # Package configuration
├── CLAUDE.md # Development guidelines
└── README.md # This file
google-cloud-bigquerygoogle-cloud-logging google-cloud-storagegoogle-cloud-computemcpgit checkout -b feature/amazing-feature)git commit -m 'Add amazing feature')git push origin feature/amazing-feature)This project is licensed under the MIT License - see the LICENSE file for details.
Note: This project is designed to work seamlessly with AI models through the MCP protocol, providing a comprehensive interface for Google Cloud Platform operations.
Выполни в терминале:
claude mcp add google-cloud-mcp -- npx Безопасность
Низкий рискАвтоматическая эвристика по публичным данным — не гарантия безопасности.