Gcs

com.pulsemcp由 pulsemcp.com 發布v0.1.14更新於 Oct 24, 2026

MCP server for Google Cloud Storage with fine-grained tool access control.

概覽

AI 產生的概覽

針對 Google Cloud Storage 的本機 MCP 伺服器,讓助理列出、讀取、上傳、複製和刪除值區與物件,並可用工具群組限制權限。

可以做什麼
列出並檢視值區和物件,檢查值區是否存在及可存取,讀取物件文字內容,或將物件及整個前綴以原始位元組下載到本機磁碟。以內嵌文字、單一本機檔案或整個目錄樹上傳或更新物件,並在同一或不同值區間複製物件。建立值區,刪除物件或空值區,實際可用範圍取決於啟用的工具群組。透過工具群組(readonly、readwrite、delete)或個別啟用/停用清單控制可用工具,並可將所有操作限制在單一值區內。
適用情境
適合助理需要處理 Google Cloud Storage 中檔案的情境:瀏覽和讀取已存資料、把本機檔案或資料夾移入值區、複製物件,或清理物件和值區。唯讀群組適合探索與分析,單一值區模式適合最小權限設定。
執行需求
透過 npx 在本機執行(需要 Node.js)。需要 GCS_PROJECT_ID 和 Google Cloud 憑證:以 GCS_SERVICE_ACCOUNT_KEY_FILE 提供服務帳戶金鑰檔案、以 GCS_SERVICE_ACCOUNT_KEY_JSON 提供內嵌金鑰 JSON,或使用 gcloud 的 Application Default Credentials。服務帳戶需具備所啟用工具對應的儲存 IAM 權限。需要連線至 Google Cloud Storage 的網路。
安裝前請注意
服務帳戶金鑰是敏感憑證,內嵌 JSON 方式會把它寫入設定。寫入和刪除工具會變更或移除真實雲端資料,delete_bucket 會刪除值區。預設啟用全部工具群組(含刪除),建議以 GCS_ENABLED_TOOLGROUPS 或啟用/停用清單加以限制。SKIP_HEALTH_CHECKS=true 會關閉所有憑證驗證。上傳工具會跟隨檔案符號連結,可能將本機檔案傳送至 Google Cloud。

安裝

在 SourceWeft 中

  1. 開啟 儀表板中的 Gcs,將其新增到工作區。
  2. 為需要使用其工具的對話啟用該服務。

Desktop only,透過 STDIO。 STDIO 服務會啟動本機處理程序,因此需要 SourceWeft 桌面主機。

其他 MCP 客戶端

參照 儲存庫 中的啟動說明。

README

GCS MCP Server

MCP server for Google Cloud Storage operations with fine-grained tool access control. Supports read/write operations on GCS buckets and objects, with configurable tool groups for security and permission management.

Highlights

  • Full GCS bucket and object management (list, get, put, copy, delete)
  • Fine-grained access control with tool groups (readonly, readwrite, delete)
  • Individual tool enable/disable via environment variables
  • Multiple authentication methods (service account key file, inline JSON, ADC)
  • GCS credential validation with health checks
  • Single bucket constraint mode
  • TypeScript with strict type checking
  • Comprehensive testing (functional, integration, manual)

Capabilities

Tools

ToolGroupDescription
list_bucketsreadonlyList all GCS buckets in the Google Cloud project
list_objectsreadonlyList objects in a bucket with prefix and pagination
get_objectreadonlyGet object contents as text
download_objectreadonlyDownload a single object to a local file (binary-safe)
download_prefixreadonlyRecursively download a prefix to a local directory (binary-safe)
head_bucketreadonlyCheck if a bucket exists and is accessible
put_objectreadwriteUpload or update an object from inline string content
put_object_from_pathreadwriteUpload a single local file by streaming from disk (binary-safe, context-free)
upload_prefixreadwriteRecursively upload a local directory tree from disk (binary-safe, context-free)
copy_objectreadwriteCopy an object within or across buckets
create_bucketreadwriteCreate a new GCS bucket
delete_objectdeleteDelete an object from a bucket
delete_bucketdeleteDelete an empty GCS bucket

Downloading to Local Disk

get_object returns an object's contents inline as UTF-8 text, which is lossy for binary data and impractical for large files or many files at once. For local data-wrangling, use the download tools instead — both stream raw bytes to disk and belong to the readonly toolgroup:

  • download_object — download a single object to a local file path. Defaults to a unique file under the OS temp directory.

  • download_prefix — recursively download every object under a prefix to a local directory, preserving the key path structure as subdirectories. Paginates through the full listing, skips directory-placeholder objects (keys ending in /), collects per-object errors without aborting the batch, and returns a manifest:

    json
    {  "destinationDir": "/tmp/gcs-download-my-bucket-1700000000000",  "objectCount": 1234,  "totalBytes": 5678901,  "files": [    { "key": "logs/2024/01/data.json", "localPath": "/tmp/.../01/data.json", "size": 1234 }  ],  "filesTruncated": true,  "errors": []}

    The inline files list is capped (maxInlineEntries, default 100), but objectCount and totalBytes always reflect the full download. When destinationDir is omitted it defaults to a unique folder under the OS temp directory.

Uploading from Local Disk

put_object takes the object content inline as a string argument, which routes every byte through the model context and requires base64 for binary data — impractical for large files or bulk uploads. For uploading files or folders without consuming context, use the local-path upload tools instead. Both stream raw bytes directly from disk to GCS server-side, returning only metadata. They belong to the readwrite toolgroup, so read-only deployments never gain them.

  • put_object_from_path — upload a single local file by streaming it from a filesystem path. Content type is auto-detected from the file extension (override with contentType). Binary files (images, archives) work without base64. Returns { bucket, key, sourcePath, size, etag, generation }.

  • upload_prefix — recursively upload every file under a local directory, preserving the directory structure as key paths beneath a destination prefix. Symbolic links to files are followed and uploaded (links to directories are skipped to avoid cycles), per-file failures are collected without aborting the batch, and it returns a manifest:

    json
    {  "bucket": "my-bucket",  "sourceDir": "/tmp/exports",  "destPrefix": "uploads/",  "objectCount": 1234,  "totalBytes": 5678901,  "files": [    { "localPath": "/tmp/exports/01/data.json", "key": "uploads/01/data.json", "size": 1234 }  ],  "filesTruncated": true,  "errors": []}

    The inline files list is capped (maxInlineEntries, default 100), but objectCount and totalBytes always reflect the full upload. When destPrefix is omitted, files upload to the bucket root.

Resources

ResourceDescription
gcs://configServer configuration and status (for debugging)

Tool Groups

Control which tools are available via the GCS_ENABLED_TOOLGROUPS environment variable:

GroupDescription
readonlyRead-only operations (list, get, head)
readwriteNon-destructive write operations (put, copy, create)
deleteDelete operations (delete_object, delete_bucket)

Examples:

  • GCS_ENABLED_TOOLGROUPS="readonly" - Only read operations
  • GCS_ENABLED_TOOLGROUPS="readonly,readwrite" - Read and write, no deletes
  • GCS_ENABLED_TOOLGROUPS="readonly,readwrite,delete" - All operations
  • Not set - All tools enabled (default)

Individual Tool Control

Fine-grained control over specific tools:

  • GCS_ENABLED_TOOLS="list_buckets,get_object" - Only enable these tools
  • GCS_DISABLED_TOOLS="delete_bucket,delete_object" - Disable these tools

Single Bucket Mode

Constrain all operations to a specific bucket using GCS_BUCKET:

bash
GCS_BUCKET="my-bucket"

When set:

  • All object operations are automatically scoped to this bucket
  • Bucket-level tools (list_buckets, create_bucket, delete_bucket, head_bucket) are hidden
  • The bucket parameter is automatically injected and hidden from tool inputs
  • For copy_object, both source and destination are constrained to the specified bucket

This lets you grant a least-privilege service account that has only object-level access to one bucket, without project-level bucket-listing permission. The startup healthcheck honors this: when GCS_BUCKET is set it validates credentials with an object-scoped probe (storage.objects.list on that bucket) and never calls the project-level bucket list or a bucket-metadata probe. See Required IAM permissions for the exact permissions per mode.

Required IAM permissions

The minimal IAM permissions depend on whether the server is constrained to a single bucket (GCS_BUCKET) and which tool groups you enable. The startup healthcheck validates credentials within these bounds — it does not require any permission beyond what the table below lists for your mode.

Startup healthcheck

ModePermission the healthcheck needsNotes
Single bucket (GCS_BUCKET set)storage.objects.list on the constrained bucketProbes list_objects with maxResults: 1. Does not require project-level storage.buckets.list or bucket-metadata storage.buckets.get, so a correctly least-privilege, object-only service account can start.
Unconstrained (no GCS_BUCKET)project-level storage.buckets.listValidates by listing buckets in the project.

Set SKIP_HEALTH_CHECKS=true to bypass startup validation entirely (disables all credential checks — not recommended).

Per-tool permissions

Beyond the healthcheck, each tool needs the corresponding GCS permission at runtime. Grant only what the tool groups you enable require:

Tool / groupPermission
list_objects (readonly)storage.objects.list
get_object, download_object (readonly)storage.objects.get
download_prefix (readonly)storage.objects.list, storage.objects.get
list_buckets (readonly)storage.buckets.list
head_bucket (readonly)storage.buckets.get
put_object, put_object_from_path, upload_prefix, copy_object (readwrite)storage.objects.create, storage.objects.get (these tools read each object's metadata back after writing to return its etag/generation; copy_object additionally reads the copy source)
create_bucket (readwrite)storage.buckets.create
delete_object (delete)storage.objects.delete
delete_bucket (delete)storage.buckets.delete

For a read-only, single-bucket service account, the roles/storage.objectViewer role on the bucket (or a custom role with storage.objects.list + storage.objects.get) is sufficient — no project-level or bucket-metadata permissions are needed.

Quick Start

Configuration

Environment Variables
VariableRequiredDescriptionDefault
GCS_PROJECT_IDYesGoogle Cloud project ID-
GCS_SERVICE_ACCOUNT_KEY_FILENoPath to service account key JSON file-
GCS_SERVICE_ACCOUNT_KEY_JSONNoService account key JSON contents (inline)-
GCS_BUCKETNoConstrain operations to single bucket-
GCS_ENABLED_TOOLGROUPSNoComma-separated tool groupsAll enabled
GCS_ENABLED_TOOLSNoSpecific tools to enable-
GCS_DISABLED_TOOLSNoSpecific tools to disable-
SKIP_HEALTH_CHECKSNoSkip credential validationfalse
Authentication

The server supports three authentication methods (in order of precedence):

  1. Service Account Key File: Set GCS_SERVICE_ACCOUNT_KEY_FILE to the path of a JSON key file
  2. Inline Service Account Key: Set GCS_SERVICE_ACCOUNT_KEY_JSON with the JSON contents directly
  3. Application Default Credentials (ADC): No additional env vars needed - uses gcloud auth application-default login

Claude Desktop Configuration

If this is your first time using MCP Servers, make sure you have the Claude Desktop application and follow the official MCP setup instructions.

macOS: ~/Library/Application Support/Claude/claude_desktop_config.json

Windows: %APPDATA%\Claude\claude_desktop_config.json

json
{  "mcpServers": {    "gcs": {      "command": "npx",      "args": ["-y", "gcs-google-mcp-server"],      "env": {        "GCS_PROJECT_ID": "your-project-id",        "GCS_SERVICE_ACCOUNT_KEY_FILE": "/path/to/service-account-key.json",        "GCS_ENABLED_TOOLGROUPS": "readonly"      }    }  }}

Restart Claude Desktop and you should be ready to go!

Read-Only Mode

For safer exploration, enable only read operations:

json
{  "env": {    "GCS_ENABLED_TOOLGROUPS": "readonly"  }}

Using Application Default Credentials

If you have gcloud CLI configured locally:

bash
gcloud auth application-default login

Then configure without key file:

json
{  "env": {    "GCS_PROJECT_ID": "your-project-id"  }}

Development

Install Dependencies

bash
npm run install-all

Build

bash
npm run build

Running in Development Mode

bash
npm run dev

Testing

bash
# Run functional testsnpm run test:run
# Run integration tests (full MCP protocol)npm run test:integration
# Run manual tests (real GCS - requires .env)npm run test:manual:setup  # First time onlynpm run test:manual
# Run all automated testsnpm run test:all

Manual Testing Setup

Create a .env file in the gcs directory:

bash
GCS_PROJECT_ID=your-project-idGCS_SERVICE_ACCOUNT_KEY_FILE=/path/to/service-account-key.json

Then run:

bash
npm run test:manual

Project Structure

gcs/├── local/                 # Local server implementation│   ├── src/│   │   ├── index.ts      # Main entry point with env validation│   │   └── index.integration-with-mock.ts│   └── package.json├── shared/               # Shared business logic│   ├── src/│   │   ├── server.ts     # Server factory with DI│   │   ├── tools.ts      # Tool registration with grouping│   │   ├── tools/        # Individual tool implementations│   │   ├── resources.ts  # Resource implementations│   │   ├── gcs-client/   # Google Cloud Storage client wrapper│   │   └── logging.ts│   └── package.json├── tests/                # Test suite│   ├── functional/       # Unit tests with mocks│   ├── integration/      # MCP protocol tests│   ├── manual/          # Real API tests│   └── mocks/           # Mock implementations└── package.json         # Root workspace config

License

MIT

來源:experimental/gcs/README.md,提交 0ed34de

工具

0
SourceWeft 尚未在沙箱中啟動過該軟體包,因此其工具未知。

版本歷史

1
  1. v0.1.14最新Sep 16, 2026

評分

已滿足適用檢查項的 50%

該評分衡量此收錄條目的完整程度,依據註冊中心條目、端點與公開來源計算得出。它不是對伺服器本身的評價,也不表示伺服器安全或目前可用:可連通性是帶日期的檢查結果,評分也不包含安裝量或使用者評價。

  • 近 30 天內可連通25 分

    請保持端點能夠回應 MCP 握手;SourceWeft 每 30 天探測一次。

  • 已宣告認證方式10 分

    請在註冊中心條目中宣告憑證請求標頭,或保持端點能夠回應探測,以便判定其認證方式。

  • 已列出工具15 分

    請讓伺服器在無憑證時回應 tools/list,或發布可在沙箱中無憑證啟動的軟體包。

  • 描述必需15 分
  • 圖示10 分
  • 文件15 分
  • 授權條款10 分