/google-cloud-storage:google-cloud-storage-okf-bucketfrom google-cloud-storage
Discovers, inventories, triages, and searches across GCS buckets/prefixes using Open Knowledge Format (OKF). Aggregates per-object OKF status, summaries, and metadata without downloading payloads. Use for bucket-level discovery, index health audits, cross-object comparison, or batch indexing.
Ships in google-cloud-storage. Installing the plugin adds it to Claude Code.
What the skill costs in Claude's context, stage by stage
Name and description: Claude knows it exists.
SKILL.md joins the conversation and stays.
Read when SKILL.md points to them; scripts run unread.
Use the google-cloud-storage-okf-bucket skill to discover, inventory, triage,
compare, and batch-index unstructured datasets across Google Cloud Storage
(gs://) buckets and folder prefixes via 4-tier progressive disclosure, without
polling individual objects or downloading full payloads into the context window.
For single-object navigation when a specific gs://bucket/object path is
already known, see the companion google-cloud-storage-okf skill.
The
Open Knowledge Format (OKF)
establishes an open standard for attaching self-describing, AI-ready semantic
knowledge directly to data assets without mutating raw content. While
google-cloud-storage-okf navigates inside a single blob (peek ->
list_regions -> expand), google-cloud-storage-okf-bucket extends OKF to
whole buckets and prefixes:
peek_bucket): Aggregates every object's
GCS Object Context (custom_contexts) in a single HTTP objects.list
metadata call (projection="noAcl") with zero object payload downloads (0
bytes read) and zero per-object objects.get round-trips.peek_bucket ->
list_regions -> expand) before reading a single byte of object content.fresh, stale, or unindexed, and computes
candidates_to_index using the 20 KB (20,480 bytes) minimum indexable
size threshold.In Google Cloud Storage (GCS), Object Context (custom_contexts /
contexts.custom) is returned inline by the GCS JSON API objects.list
endpoint when requested via a partial response field mask:
peek_bucket requests
items(name,size,generation,updated,contentType,contentEncoding,contexts,metadata),nextPageToken
with projection="noAcl", extracting each object's summary (okf.sum or
okf.sum.000..N), decoded region titles and deduplicated keywords
(okf.r.000..M), provenance (okf.src_generation vs. generation), and
non-OKF contexts.peek(gs_uri) in
a loop across N objects issues N sequential objects.get RPCs and
clutters the agent context with N separate tool responses. peek_bucket
replaces all N calls with a single structured JSON bucket card.name ending with / and size == 0) are automatically
skipped so total_objects and counts reflect real data objects.blob.contexts attributes on
newer google-cloud-storage SDKs and raw blob._properties["contexts"]
dicts on older releases, capping decoded region entries at 8 KB.Bucket-level GCS-OKF adds Tier -1 (peek_bucket) above the object-level
progressive disclosure hierarchy:
peek_bucket): Single-request bucket/prefix OKF card
aggregating object status counts (fresh, stale, unindexed),
candidates_to_index, and per-object summary, region_titles,
keywords, and custom_contexts.peek): Single-object summary and OKF_NOT_FOUND capacity
diagnostic (used when inspecting an individual unindexed object's context
budget prior to indexing; skipped when peek_bucket already returned a
fresh summary).list_regions): Per-object Table of Contents with exact
inclusive [start_byte, end_byte] boundaries for each semantic region.expand): Targeted byte-range slice reader fetching only the
relevant region(s).write_okf): Persists newly generated or refreshed
OKF manifests into GCS Object Context with if_generation_match Optimistic
Concurrency Control (OCC).1. peek_bucket(gs_uri, max_results=100) -> Bucket card (counts, candidates_to_index, objects)
2. Filter candidate objects from card (match summary, region_titles, keywords; skip peek() on fresh)
3. list_regions(candidate_gs_uri) -> [start_byte, end_byte]
4. expand(candidate_gs_uri, start_byte, end_byte) -> Read targeted byte slice(s)
Every OKF verb is served by the google-cloud-storage-okf MCP server. If that
server is not registered with your MCP client, the tools do not exist in your
session and no OKF work is possible.
Before the first OKF step of any task, you MUST confirm that the MCP tools
peek_bucket, peek, list_regions, expand, and write_okf are all
present (either as direct or server-prefixed tools, or under <mcp_servers>
as lazy-loaded MCP tools invoked via call_mcp_tool — both count as present).
google-cloud-storage-okf MCP server is not registered with this client (or
points to the 4-tool object server if only peek_bucket is missing), relay
the One-Time Setup steps below, and STOP. Do not resume OKF work
until all five tools are bound.NEVER import or execute scripts/bucket.py, scripts/core.py, or
scripts/mcp_server.py directly as a substitute for the MCP tools — for example
python3 -c "import bucket; bucket.peek_bucket(...)", or launching
mcp_server.py as a module in a subshell and driving it by hand. Do NOT
read sibling skills, internal eval files, scripts/bucket.py, or
scripts/core.py — all tool schemas and workflows are documented below so you
can invoke the MCP tools (peek_bucket, peek, list_regions, expand,
write_okf) directly. Furthermore, do NOT fall back to gcloud storage ls,
gsutil ls, gcloud storage cat, or raw google.cloud.storage Python scripts
to list or read bucket objects when the MCP server is missing or returns an
error. Every OKF call MUST go through MCP.
Install the whole google-cloud-storage-okf-bucket skill directory
(including scripts/) wherever your harness discovers skills. A
SKILL.md-only copy cannot run the server.
Install the server's two Python dependencies, the MCP SDK and the GCS client
library, using the python3 that will run the server:
python3 -m pip install mcp google-cloud-storage
Authenticate and pick a project. The server reads Application Default Credentials and needs a Google Cloud project to bill and quota its requests:
gcloud auth application-default login
gcloud config set project <project-id>
Instead of a machine-wide project, you can pass one to this server only
through the env block in step 4.
Register the canonical server command with your MCP client, then restart the
client. Use an absolute path for <abs google-cloud-storage-okf-bucket dir>
and the same python3 as in step 2; the env block is optional:
{
"mcpServers": {
"google-cloud-storage-okf": {
"command": "python3",
"args": ["<abs google-cloud-storage-okf-bucket dir>/scripts/mcp_server.py"],
"env": {"GOOGLE_CLOUD_PROJECT": "<project-id>"}
}
}
}
If the client reports that the server failed to connect, run the command from step 4 by hand and read the traceback for missing dependencies.
If any OKF tool returns an error about credentials, a missing project (for
example
Project was not passed and could not be determined from the environment), or
permission denied (401 or 403), the environment is not set up, not the request.
Relay the error and its Fix: line verbatim and STOP:
gcloud auth application-default login.gcloud config set project <project-id>, or the env
block in step 4.Fix: (--disable-quota-project or
set-quota-project for serviceusage.services.use, or grant
storage.objects.list, storage.objects.get, and storage.objects.update
on the bucket).Do NOT change the user's gcloud configuration or credentials yourself, do
NOT guess a project, and do NOT retry the operation through gcloud storage,
gsutil, or client libraries as a workaround.
peek_bucket)Retrieves a bucket- or prefix-level OKF card aggregated from inline GCS Object
Contexts in a single metadata listing (0 payload bytes downloaded).
gs_uri (target GCS bucket or prefix URI, e.g.,
'gs://my-bucket' or 'gs://my-bucket/logs/2026-08/'), max_results
(maximum non-placeholder objects to inspect, 1 to 500, default 100).gs_uri, bucket, prefix: Normalized target bucket and prefix.total_objects, total_bytes, truncated: Inventory totals and
whether additional objects exist beyond max_results. When truncated
is true, either raise max_results (up to 500) or narrow gs_uri
to a more specific gs://bucket/subprefix/, and note the cap in
inventory reports.counts: Object count breakdown by okf_status
({"fresh": N, "stale": M, "unindexed": K}).candidates_to_index: List of gs:// URIs where needs_indexing is
true (stale objects, objects with corrupt_warning, plus clean
unindexed objects with size >= 20480 bytes).unindexed_uris, stale_uris: Lists of gs:// URIs by status.objects: Per-object card entries containing gs_uri, name, size,
okf_status ("fresh", "stale", "unindexed"), needs_indexing
(bool), content_type, content_encoding (when set, e.g. "gzip"),
generation, updated, and (when present) summary, region_count,
region_titles, keywords (for fresh objects), stale_warning (for
stale objects), corrupt_warning (for corrupt or incomplete OKF
metadata), custom_contexts, and custom_metadata.peek)Retrieves the Tier 0 summary or OKF_NOT_FOUND capacity diagnostic for a single
GCS object (gs://bucket/object).
gs_uri (target GCS object URI, e.g.,
'gs://my-bucket/app.log').Stale OKF index warning if okf.src_generation mismatches live
generation, or an OKF_NOT_FOUND diagnostic detailing remaining
Object Context Capacity (out of 50 keys / 25,600 bytes),
Existing Object Contexts, Existing Custom Metadata, and
Object Attributes.peek After peek_bucket: If peek_bucket already
returned okf_status: "fresh" and summary for an object, do NOT call
peek(gs_uri) on that object again — proceed directly to
list_regions(gs_uri).list_regions)Retrieves the Tier 1/2 Table of Contents (region index) for a candidate object.
gs_uri (target GCS object URI).id, inclusive start_byte
and end_byte, title, and keywords), a
{"warning": "Stale OKF index...", "regions": []} object, or an
OKF_NOT_FOUND diagnostic.expand)Fetches a targeted inclusive byte-range slice [start_byte, end_byte] from a
GCS object payload.
gs_uri (target GCS object URI), start_byte (0-indexed
inclusive start offset), end_byte (0-indexed inclusive end offset,
0 <= start_byte <= end_byte < size for uncompressed objects; when
content_encoding is "gzip" or "x-gzip", size reflects stored
compressed bytes while expand and write_okf use decompressed offsets).[Base64-encoded binary data] for binary
data). If the object's OKF index is stale, returns the Stale OKF index
warning with Current object size: and the requested live byte slice so you
can inspect the updated payload and refresh the index.write_okf)Writes a generated or refreshed OKF manifest into an object's GCS Object Context
(okf.sum, okf.r.000..N, okf.src_generation) with atomic
if_generation_match OCC protection.
gs_uri (target GCS object URI), summary (concise Tier 0
overview string, ~200-250 bytes optimal; must be non-empty, start with a
letter or digit, and omit single quotes, double quotes, backslashes, and
forward slashes per GCS Object Context rules), regions_json (JSON array
string of region descriptors with id, start_byte, end_byte, title,
keywords satisfying 0 <= start_byte <= end_byte < object_size—using
decompressed size for content_encoding "gzip"/"x-gzip"—in strictly
ascending, non-overlapping order next start_byte >= previous end_byte + 1,
e.g., '[{"id": 0, "start_byte": 0, "end_byte": 8191, "title": "Schema", "keywords": ["parquet"]}]'), and optional created_at (ISO 8601 UTC).Calling peek_bucket on a mixed-status bucket or prefix returns a structured
JSON card summarizing every object's OKF state:
{"gs_uri": "gs://acme-telemetry/etl/", "bucket": "acme-telemetry", "prefix": "etl/",
"total_objects": 3, "total_bytes": 100352, "truncated": false,
"counts": {"fresh": 1, "stale": 1, "unindexed": 1},
"candidates_to_index": ["gs://acme-telemetry/etl/watermark_checkpoint.json", "gs://acme-telemetry/etl/raw_clickstream_batch.ndjson"],
"unindexed_uris": ["gs://acme-telemetry/etl/raw_clickstream_batch.ndjson"],
"stale_uris": ["gs://acme-telemetry/etl/watermark_checkpoint.json"],
"objects": [
{"gs_uri": "gs://acme-telemetry/etl/spark_driver_2026.log", "name": "etl/spark_driver_2026.log", "size": 65536,
"okf_status": "fresh", "needs_indexing": false, "region_count": 3,
"summary": "Spark ETL driver log for analytics-east covering JVM GC initialization, shuffle throughput, and executor OOM traces.",
"region_titles": ["JVM Heap & GC Initialization", "Shuffle Stage Throughput", "Executor OOM & ShuffleFetchFailedException"],
"keywords": ["gc", "shuffle", "ShuffleFetchFailedException", "ExecutorRunner.scala"],
"custom_contexts": {"cluster": "analytics-east", "job": "daily-rollup"}},
{"gs_uri": "gs://acme-telemetry/etl/watermark_checkpoint.json", "name": "etl/watermark_checkpoint.json", "size": 2048,
"okf_status": "stale", "needs_indexing": true,
"stale_warning": "Stale OKF index: Index created for object generation 1710000000000000, but current generation is 1710050000000000."},
{"gs_uri": "gs://acme-telemetry/etl/raw_clickstream_batch.ndjson", "name": "etl/raw_clickstream_batch.ndjson", "size": 32768,
"okf_status": "unindexed", "needs_indexing": true}]}
When the user asks an open-ended question about a bucket or prefix (for example,
"Which job in gs://acme-telemetry/etl/ failed with a shuffle error and what
was the root cause?"):
peek_bucket(gs_uri) directly (or
on large buckets with > 30 objects when invoke_subagent is available,
delegate peek_bucket to an isolated search sub-agent that returns only
shortlisted matching URIs plus counts and candidates_to_index).summary, region_titles, keywords, custom_contexts, and
custom_metadata. Eliminate unrelated distractor objects immediately.peek Calls: For each matching fresh
object, skip peek(gs_uri) and call list_regions(gs_uri) to obtain exact
[start_byte, end_byte] offsets for the relevant region(s).expand(gs_uri, start_byte, end_byte)
only on the matching region(s). Never call list_regions or expand on
unrelated distractor objects.When the user asks for an inventory, readiness audit, or OKF status summary of a bucket or prefix:
peek_bucket(gs_uri) and report the
inventory directly from the card without calling list_regions or expand
on any object.total_objects, total_bytes, and counts (fresh, stale,
unindexed), plus each object's gs_uri, size, okf_status,
needs_indexing, and summary / region_titles (or stale_warning).20 KB (20,480 bytes) indexing threshold:
candidates_to_index includes all stale objects, objects carrying
corrupt_warning, and clean unindexed objects with size >= 20480.
Clean uncompressed unindexed objects with size < 20480 have
needs_indexing: false because they fit in context via
expand(gs_uri, 0, size - 1) (for content_encoding "gzip" or
"x-gzip", size is compressed, so decompressed size may exceed
20 KB).When comparing metrics, configurations, or sections across two or more objects
in a bucket (for example, comparing analytics-east vs. analytics-west
shuffle throughput):
peek_bucket(gs_uri) to locate the target objects and verify their
region_titles and custom_contexts.list_regions on each compared object to find the byte boundaries of
the specific section being compared (e.g., the throughput region).expand only on that matching region in each compared object, omitting
unrelated sections (such as initialization headers or crash dumps) and
untouched distractor files.Real-world buckets frequently contain a mix of fresh, stale, small
unindexed (< 20 KB), and large unindexed (>= 20 KB) objects:
fresh objects via list_regions -> expand. For a relevant unindexed
or stale object with size < 20480 and no "gzip"/"x-gzip"
content_encoding, read expand(gs_uri, 0, size - 1). When
content_encoding is "gzip" or "x-gzip" (size is compressed), read
expand(gs_uri, 0, 20479) first and probe start_byte = 20480 if EOF is
not obvious; if data continues, treat it as >= 20 KB. For relevant
>= 20 KB unindexed or stale objects, read targeted slices via expand
without calling write_okf. Deliver the answer before indexing.candidates_to_index:
write_okf (and do NOT expand unrelated
candidates_to_index objects). After answering, report
candidates_to_index (list all candidate URIs with okf_status and
size when <= 20 objects are non-fresh, or report exact counts plus
up to 10 sample candidate URIs when > 20 are non-fresh, noting why
< 20 KB unindexed objects are excluded) and ask a single yes/no
question offering to index or refresh them.yes), index only
candidates_to_index (stale, corrupt_warning, and >= 20 KB
unindexed objects), skipping fresh and clean < 20 KB unindexed
objects unless small-file indexing was explicitly requested.size and content_encoding from peek_bucket. Read
uncompressed size < 20480 objects via expand(gs_uri, 0, size - 1); for
size >= 20480 or "gzip"/"x-gzip" objects (reading 0..20479 first and
probing 20480 if needed), inspect structural offsets via expand, build
ascending non-overlapping regions bounded by decompressed object size
(0 <= start_byte <= end_byte < decompressed_size), and commit via
write_okf(gs_uri, summary, regions_json).When sub-agent delegation (invoke_subagent) is available, use sub-agents to
isolate large bucket discovery cards and parallelize batch indexing:
For targeted search or cross-object triage on large buckets (> 30 objects),
delegate peek_bucket(gs_uri) to an isolated search sub-agent via
invoke_subagent that returns only shortlisted matching URIs (with okf_status
and region_titles), counts, and candidates_to_index (or up to 10 sample
URIs when > 20 are non-fresh), keeping the full bucket card out of the main
context. Call peek_bucket directly for full inventories or smaller prefixes.
peek_bucket: Call peek_bucket(gs_uri) once
and read candidates_to_index (stale, corrupt_warning, and >= 20 KB
unindexed).candidates_to_index (listing all
when <= 20 non-fresh, or counts + up to 10 sample URIs above 20) and
ask a single yes/no confirmation question before dispatching workers.invoke_subagent):
>= 3 candidates when invoke_subagent is available, partition
candidates_to_index into balanced batches (5-10 URIs per worker) and
dispatch parallel sub-agents with confirmation already granted.invoke_subagent), index each candidate
URI directly (expand -> write_okf).write_okf results (or re-run
peek_bucket(gs_uri)) confirming the candidates are now fresh.The google-cloud-storage-okf MCP server automatically stamps outbound GCS API
calls with User-Agent: gcs-skills/1.0 (skill:google-cloud-storage-okf).
peek_bucket: Never poll peek(gs_uri)
across every object in a bucket when peek_bucket(gs_uri) can aggregate the
entire bucket or prefix in a single metadata listing.peek on fresh Objects: When peek_bucket
returns okf_status: "fresh" and summary, go straight to list_regions
on matching objects.peek_bucket, peek, list_regions, expand, write_okf); never run or
import scripts/bucket.py, scripts/core.py, or scripts/mcp_server.py
directly or fall back to gcloud storage / gsutil (see Setup).candidates_to_index: Unless the user has
explicitly requested or approved OKF indexing/refresh, answer read/search
questions immediately (using list_regions -> expand on fresh objects
and targeted expand slices on relevant unindexed objects), report
candidates_to_index, and ask once for confirmation before calling
write_okf.custom_contexts). Never delete or
overwrite the original GCS objects.50 Object Context keys (~45-50 OKF regions), 25,600 total bytes,
and 256 bytes per value.What SKILL.md sets; muted values are Claude Code's defaults
Three short reads, in order
npx claudepluginhub googlecloudplatform/google-cloud-storage-plugin --plugin google-cloud-storage7 skills in this plugin
/gcs-security-assessmentAssesses the security posture of Google Cloud Storage (GCS) buckets and projects. Grounds every finding in gathered telemetry, evaluates buckets against Google security best practices (public access, IAM over-granting, CMEK, VPC Service Controls, audit logging), and correlates signals to flag toxic combinations of individually low-risk settings, with actionable remediation. Use whenever a user asks for a security scan, audit, review, vulnerability check, or compliance assessment (including SAIF) — or simply asks whether their buckets, project, or data are secure, exposed, public, or misconfigured, who can access their data, or wants storage hardened or locked down, e.g. before a launch. Don't use for diagnosing a specific access failure or 403, managing or configuring storage, investigating a live outage, or non-GCS resources (Compute Engine, GKE, etc.)./google-cloud-storage-basicsStores, retrieves, and manages data as objects in Cloud Storage on Google Cloud (also known colloquially as GCS) buckets. Use when you need to interact with Cloud Storage — set up a Storage MCP server (remote or local Toolbox), create or configure buckets, upload, download, stream, or transfer data, organize objects with folders, generate signed URLs, control access (IAM, ACLs, public access prevention), set storage classes (Standard, Nearline, Coldline, Archive), manage lifecycle and cost, protect data (versioning, CMEK, retention, Bucket Lock, holds, soft delete), host static websites, trigger Pub/Sub notifications, mount buckets (gcsfuse), or optimize performance. Covers gcloud storage / gsutil, JSON/XML APIs, client libraries, Terraform, and Cloud Storage MCP servers. Don't use for generic MCP setup that doesn't mention Cloud Storage, other MCP servers, block storage (Persistent Disk), BigQuery, or databases (Cloud SQL, Spanner, Bigtable, Firestore).Other plugins' skills for the same job