GCP Bucket MCP Server
Read-only MCP server exposing GCPBucketClient to AI agents: list objects in a Google Cloud Storage bucket.
| Tool | Description |
|---|
list_objects(prefix: str | None = None) -> list[str] | List object names in the configured bucket, optionally filtered by prefix |
read_object_text(remote_path: str, max_bytes: int = 1_000_000) -> str | Read an object's content as UTF-8 text. Refuses (raises) objects larger than max_bytes rather than truncating. |
get_signed_url(remote_path: str, expires_in_seconds: int = 300) -> str | Time-limited, read-only URL — for content beyond read_object_text's inline cap. Requires GOOGLE_APPLICATION_CREDENTIALS to point at a real service account key file (signing needs a private key, not metadata-server ADC). |
upload()/download() are write/local-filesystem-shaped and aren't exposed.
The client is cached at module scope rather than rebuilt per call — GCPBucketClient's constructor makes a real network call (an SSL capability probe) plus Application Default Credentials resolution, and neither changes within a running server process.
Tested against a real fake-gcs-server container, not mocks.
Environment Variables
| Variable | Required | Notes |
|---|
GCP_BUCKET_NAME | yes | GCS bucket name |
GOOGLE_APPLICATION_CREDENTIALS | yes | Path to a service account JSON key (read-only storage role recommended). Read by the underlying google-auth library via Application Default Credentials, not by this server directly. |
Run locally
pip install "data-connectors-ai[gcp,mcp]"
data-connectors-gcp-bucket-mcp
Use with an MCP client
{
"mcpServers": {
"gcp-bucket": {
"command": "uvx",
"args": ["--from", "data-connectors-ai[gcp,mcp]", "data-connectors-gcp-bucket-mcp"],
"env": {
"GCP_BUCKET_NAME": "your-bucket",
"GOOGLE_APPLICATION_CREDENTIALS": "/path/to/service-account.json"
}
}
}
}
Registry
Published at io.github.nagarjunr/data-connectors-gcp-bucket on the official MCP registry.