Skip to content

feat: support multiple Storage buckets with runtime switching - #14

Merged
KoblerS merged 1 commit into
mainfrom
feat/storage-buckets
Oct 18, 2026
Merged

KoblerS merged 1 commit into
mainfrom
feat/storage-buckets

Conversation

@KoblerS

@KoblerS KoblerS commented Oct 18, 2026

Copy link
Copy Markdown
Owner

Summary

Adds first-class support for working with multiple Cloud Storage buckets, including a runtime switch for the default bucket — mirroring the existing project-switch tools.

New tools

Tool Description
storage_list_buckets List the Cloud Storage buckets in the active project (GCS API)
storage_current_bucket Show which bucket operations currently default to
storage_switch_bucket Set the default bucket for subsequent calls; empty resets to the project default

Bucket resolution

Every existing file tool already accepts an optional bucket argument. Resolution order is now:

  1. explicit per-call bucket argument
  2. the active bucket set via storage_switch_bucket
  3. the project default (<project-id>.firebasestorage.app)

The active bucket is scoped per project and resets automatically when you switch projects (switchProject), so you never accidentally keep targeting another project's bucket.

Details

  • resolveBucketName() centralizes the resolution; getBucket() in storage.ts now uses it.
  • listStorageBuckets() calls the GCS JSON API with the active credentials (local gcloud/ADC session or service account) — no new dependency.
  • Same concurrency note as project switching applies: the active bucket is shared mutable state within one server process, so a switch fired in parallel with other calls in the same turn has undefined ordering. Serial usage (the normal case) is deterministic.

Testing

Verified live against a local gcloud session (serial client harness):

  • storage_list_buckets returns the project's buckets with an active flag.
  • storage_switch_bucket → storage_current_bucket reflects the new bucket; storage_list_files then operates against it.
  • Switching with an empty bucket resets to the project default, and subsequent storage_list_files targets the default again.

Add an active-bucket concept alongside the per-call bucket override:

- storage_list_buckets: list the project's Cloud Storage buckets
- storage_current_bucket: show the bucket operations default to
- storage_switch_bucket: set the default bucket for subsequent calls
  (empty resets to the project default)

Bucket resolution order is: explicit per-call bucket -> active bucket
-> project default (<project-id>.firebasestorage.app). The active
bucket is scoped per project and resets on switchProject.
@KoblerS
KoblerS merged commit 33a5b0a into main Oct 18, 2026
2 checks passed
@KoblerS
KoblerS deleted the feat/storage-buckets branch October 18, 2026 17:28
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant