/google-cloud-storage:google-cloud-storage-okffrom google-cloud-storage
Token-efficient search and progressive disclosure of unstructured objects (PDFs, logs, JSON/CSV, media) in GCS using Open Knowledge Format. Enables point-queries, cross-document synthesis, and temporal reasoning without full downloads.
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 skill to efficiently navigate, inspect, and
extract targeted byte ranges from unstructured Google Cloud Storage (gs://)
objects via progressive disclosure, instead of reading or dumping entire files
into the context window. For bucket- or prefix-level discovery, health
inventories, and open-ended cross-object triage (gs://bucket or
gs://bucket/prefix/), see the companion google-cloud-storage-okf-bucket
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 OKF at the catalog/dataset level organizes knowledge across tables into
concept documents, google-cloud-storage-okf adapts OKF to object storage:
custom_contexts), eliminating disconnected sidecar
files.peek → list_regions → expand) so AI agents can navigate and extract
information from multi-GB files with minimal context window overhead.In Google Cloud Storage (GCS), there is a fundamental distinction between Object Context and Custom Metadata:
custom_contexts / contexts.custom): A dedicated,
structured context layer in GCS designed for AI agent knowledge, semantic
indices, and progressive disclosure manifests. OKF manifests are targeted
primarily at GCS Object Context.metadata / x-goog-meta-*): Traditional
key-value pairs used for generic user tagging and legacy object attributes.
Custom metadata is separate from Object Context.OKF keys (such as okf.sum, okf.r.000, okf.created_at, and
okf.src_generation) are written directly to GCS Object Contexts
(custom_contexts).
The skill provides dual-layer compatibility across different versions of the
google-cloud-storage Python SDK:
ObjectContexts, ObjectCustomContextPayload), the skill
uses them to populate and read blob.contexts.blob._properties["contexts"] / blob._patch_property) and
signals blob._changes. When blob.patch() executes, the SDK transmits the
standard HTTP REST PATCH request to GCS.blob.contexts and raw
server response fields in blob._properties["contexts"], guaranteeing that
Object Contexts remain 100% readable and writable across all customer
environments without startup import failures.GCS-OKF stores lightweight, self-contained Table of Contents (TOC) metadata directly inside GCS Object Context on the original blob itself without modifying or duplicating the underlying object data:
peek): High-level summary card to quickly gauge relevance.list_regions): Semantic Table of Contents detailing
contiguous regions with inclusive byte ranges, titles, and keywords.expand): Precise byte-range reader retrieving targeted
slices based on region boundaries.write_okf): Persists newly generated OKF indices
into GCS Object Context.+-------------------------------------------------------------+
| 1. peek(gs_uri) |
| -> Evaluate relevance & inspect existing Object Contexts |
+-------------------------------------------------------------+
|
v
+-------------------------------------------------------------+
| 2. list_regions(gs_uri) |
| -> Locate specific chapters/sections and byte boundaries |
+-------------------------------------------------------------+
|
v
+-------------------------------------------------------------+
| 3. expand(gs_uri, start_byte, end_byte) |
| -> Read exact byte-range slice into context |
+-------------------------------------------------------------+
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, 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).
NEVER import or execute scripts/core.py or scripts/mcp_server.py
directly as a substitute for the MCP tools — for example python3 -c "import core; core.peek(...)", or launching mcp_server.py as a module in a subshell
and driving it by hand. The server MUST be registered with the harness so that
every OKF call goes through MCP.
Install the whole 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 skill_dir> and the same python3 as
in step 2; the env block is optional:
{
"mcpServers": {
"google-cloud-storage-okf": {
"command": "python3",
"args": ["<abs skill_dir>/scripts/mcp_server.py"],
"env": {"GOOGLE_CLOUD_PROJECT": "<project-id>"}
}
}
}
Each harness has its own place for this snippet, and your harness knows where that is.
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.get / storage.objects.update on the object).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)Retrieves the Tier 0 summary of the GCS object from its Object Context.
gs_uri (target GCS URI, e.g.,
'gs://my-bucket/documents/report.pdf').OKF_NOT_FOUND error detailing remaining Object Context
capacity, pre-existing Object Context entries, and Object Attributes
(including content_encoding when set).list_regions)Retrieves the Tier 1/2 Table of Contents (region index) stored in the object's Object Context.
gs_uri (target GCS URI).id: Region identifier (e.g., 'r0', 'r1').start_byte: 0-indexed starting byte offset (inclusive).end_byte: 0-indexed ending byte offset (inclusive).title: Descriptive section/chapter title.keywords: List of relevant keywords/tags.{"warning": "...", "regions": []}) if
generation changed.OKF_NOT_FOUND error if regions are missing.expand)Fetches a specific byte-range slice from the GCS object payload.
gs_uri (target GCS URI), start_byte (0-indexed inclusive start
offset), end_byte (0-indexed inclusive end offset; for content_encoding
"gzip" or "x-gzip" objects, size is stored compressed bytes while
expand and write_okf use decompressed byte offsets).[Base64-encoded binary data] for binary data.write_okf)Writes an OKF manifest into GCS Object Context (okf.r.000, okf.sum, etc.).
gs_uri: Target GCS URI.summary: High-level overview string of the object. Must be non-empty,
start with a letter or digit, and omit single quotes, double quotes,
backslashes, and forward slashes (GCS Object Context value rule; e.g.,
write application octet-stream or p50 and p99).regions_json: JSON array string of region descriptors (e.g., '[{"id": "r0", "start_byte": 0, "end_byte": 1024, "title": "Introduction", "keywords": ["overview"]}]').
0 <= start_byte <= end_byte < object_size (using
decompressed size when content_encoding is "gzip" or
"x-gzip"). Regions MUST be listed in ascending order by
start_byte and cannot overlap
(next start_byte >= previous end_byte + 1). write_okf rejects
inverted, negative, out-of-order, overlapping, or out-of-bounds byte
ranges.created_at: (Optional) ISO 8601 timestamp string (defaults to current
UTC time).OKF_NOT_FOUND)When calling peek or list_regions on an object that lacks OKF Object
Contexts, the tool returns a comprehensive OKF_NOT_FOUND diagnostic payload
including Object Context capacity, existing contexts, custom metadata, and
object attributes:
OKF_NOT_FOUND: Manifest summary missing for 'gs://my-bucket/archive.log'.
Object Context Capacity: 25530 bytes remaining (out of 25600 total, 70 bytes used across 3 keys).
Existing Object Contexts:
{
"source": "ingestion-pipeline",
"log-type": "application-debug",
"environment": "production"
}
Existing Custom Metadata:
{
"category": "system-logs",
"retention": "30d"
}
Object Attributes:
{
"size": 1048576,
"content_type": "text/plain",
"generation": 1723334400000000,
"updated": "2026-08-10T12:00:00Z"
}
Generating an OKF index reads slices of the object to compute semantic
boundaries (consuming time and tokens) and mutates the live object's GCS
Object Context (custom_contexts) via write_okf. Before scanning an object
to split it into regions or calling write_okf, apply this gate:
< 20 KB) on Read Queries: If the user only asked a
read, search, or diagnostic question and Object Attributes.size < 20480
without content_encoding "gzip" or "x-gzip", do NOT generate an
OKF index — read directly with expand(gs_uri, 0, size - 1) and answer.
When content_encoding is "gzip" or "x-gzip" (size is compressed),
read expand(gs_uri, 0, 20479) first and probe
expand(gs_uri, 20480, 20480) if EOF is not obvious; if data continues,
treat the object as >= 20 KB and apply the Confirmation Gate below before
scanning or calling write_okf.peek or
list_regions returns OKF_NOT_FOUND on an object >= 20 KB (or returns a
Stale OKF index warning) and the user has not already explicitly
requested or approved generating/writing the OKF index:
expand to scan or segment the object and do NOT
call write_okf.size and
remaining Object Context Capacity from the peek/list_regions
diagnostic.expand
to determine semantic region boundaries → write_okf), then complete
the user's original request.write_okf; leave the object's GCS Object
Context untouched.Leverage Pre-existing Object Context, Custom Metadata & Attributes:
Existing Object Contexts,
Existing Custom Metadata, and Object Attributes (environment,
category, log-type, content_type, content_encoding, size) to
enrich your generated summary, region titles, and keywords.Evaluate Splitting Heuristics:
< 20 KB,
read directly via expand(gs_uri, 0, size - 1) (or
expand(gs_uri, 0, 20479) + probe start_byte = 20480 when
content_encoding is "gzip" or "x-gzip") without forcing OKF
indexing unless explicitly requested.object_size (decompressed size for "gzip"/"x-gzip"). Group
semantically related paragraphs into cohesive Table of Contents regions
rather than splitting naively by paragraph, using available parsers
(such as PDF parsers or local models) since the index is written once
and reused by all downstream agents.Format and Commit OKF Manifest to Object Context:
Create a concise summary string (under ~200-250 bytes is optimal).
Assemble the region list into valid JSON:
[
{
"id": "r0",
"start_byte": 0,
"end_byte": 4095,
"title": "Header & Config",
"keywords": ["config", "init", "schema"]
},
{
"id": "r1",
"start_byte": 4096,
"end_byte": 18432,
"title": "Main Execution Trace",
"keywords": ["trace", "rpc", "errors"]
}
]
Call write_okf(gs_uri=gs_uri, summary=summary, regions_json=regions_json).
When processing multi-file buckets or directories with multiple unindexed
objects, agents should avoid single-threaded sequential processing and
instead invoke parallel worker sub-agents via invoke_subagent:
When indexing multiple objects under a GCS prefix or bucket:
invoke_subagent:
peek -> inspect
attributes -> generate semantic regions -> write_okf).Outbound Google Cloud Storage API calls from the skill, MCP server, cURL, or custom scripts are stamped with the standard GCS Skills User-Agent telemetry header:
User-Agent: gcs-skills/1.0 (skill:google-cloud-storage-okf)
When integrating via the gcloud storage CLI, pass the standard metrics
environment variable:
CLOUDSDK_METRICS_ENVIRONMENT="gcs-skills gcs-skills/1.0 (skill:google-cloud-storage-okf)"
scripts/core.py or scripts/mcp_server.py directly as
a substitute (see Setup).peek or list_regions returns
OKF_NOT_FOUND on an object >= 20 KB (or a Stale OKF index warning) and
the user has not explicitly requested or pre-approved OKF generation, report
the object's size and remaining Object Context capacity, ask once for
confirmation, and wait for a yes before scanning the object or calling
write_okf.list_regions followed by
targeted expand calls.50 Object Context keys across all
entries (limits an object to ~45–50 OKF regions maximum).25,600 bytes across all Object
Context keys.256 bytes (encoding & fallback
truncation are handled automatically by write_okf).peek or list_regions returns a Stale OKF index warning (indicating the underlying blob generation changed since
indexing), confirm with the user (unless already granted) before
re-evaluating and re-generating the OKF index.What SKILL.md sets; muted values are Claude Code's defaults
Three short reads, in order
7 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).npx claudepluginhub googlecloudplatform/google-cloud-storage-plugin --plugin google-cloud-storageOther plugins' skills for the same job