@google-cloud/storage-mcp 0.2.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/README.md ADDED
@@ -0,0 +1,195 @@
1
+ # Storage MCP Server ☁️
2
+
3
+ The Storage
4
+ [Model Context Protocol (MCP)](https://modelcontextprotocol.io/docs/getting-started/intro)
5
+ server enables AI assistants to easily interact with Google Cloud Storage for
6
+ bucket and object management. With the Storage MCP server you can:
7
+
8
+ - **Interact with Google Cloud Storage using natural language.** Describe the
9
+ outcome you want instead of memorizing complex command syntax, flags, and
10
+ arguments.
11
+
12
+ <img src="./assets/natural_language.gif" width="80%" alt="Natural Language Demo">
13
+
14
+ - **Automate and simplify complex workflows.** Chain multiple storage operations
15
+ into a single, repeatable command to reduce manual effort and the chance of
16
+ error.
17
+
18
+ <img src="./assets/chained.gif" width="80%" alt="Chained Commands Demo">
19
+
20
+ - **Lower the barrier to entry for cloud storage management.** Empower team
21
+ members who are less familiar with GCS to perform powerful actions confidently
22
+ and safely.
23
+
24
+ <img src="./assets/easy_access_3x.gif" width="80%" alt="Easy Access Demo">
25
+
26
+ ## 🚀 Getting Started
27
+
28
+ ### Prerequisites
29
+
30
+ - [Node.js](https://docs.npmjs.com/downloading-and-installing-node-js-and-npm):
31
+ version 20 or higher
32
+ - [gcloud CLI](https://cloud.google.com/sdk/docs/install) (for authentication)
33
+
34
+ ## ✨ Set up your MCP server
35
+
36
+ ### Gemini CLI and Gemini Code Assist
37
+
38
+ To integrate the Storage MCP server with Gemini CLI or Gemini Code Assist, run the
39
+ setup command below. This will install the MCP server as a
40
+ [Gemini CLI extension](https://github.com/google-gemini/gemini-cli/blob/main/docs/extension.md)
41
+ for the current user, making it available for all your projects.
42
+
43
+ ```shell
44
+ npx @google-cloud/storage-mcp init --agent=gemini-cli
45
+ ```
46
+
47
+ After the initialization process, you can verify that the storage-mcp server is
48
+ configured correctly by running the following command:
49
+
50
+ ```
51
+ gemini mcp list
52
+
53
+ > ✓ gcs: npx -y @google-cloud/storage-mcp (stdio) - Connected
54
+ ```
55
+
56
+ By default, the server only enables safe, non-destructive tools. To enable
57
+ tools that can modify or delete existing data, use the
58
+ `--enable-destructive-tools` flag:
59
+
60
+ ```shell
61
+ npx @google-cloud/storage-mcp init --agent=gemini-cli --enable-destructive-tools
62
+ ```
63
+
64
+ ### For other AI clients
65
+
66
+ To use the Storage MCP server with other clients, add the following snippet to their
67
+ respective JSON configuration files:
68
+
69
+ ```json
70
+ "gcs": {
71
+ "command": "npx",
72
+ "args": ["-y", "@google-cloud/storage-mcp"]
73
+ }
74
+ ```
75
+
76
+ Instructions for popular tools:
77
+
78
+ - **Claude Desktop:** Open **Claude > Settings > Developer > Edit Config** and
79
+ edit `claude_desktop_config.json`.
80
+ - **Cline:** Click the MCP Servers icon, then **Configure MCP Servers** to edit
81
+ `cline_mcp_settings.json`.
82
+ - **Cursor:** Edit `.cursor/mcp.json` for a single project or
83
+ `~/.cursor/mcp.json` for all projects.
84
+ - **Gemini CLI (Manual Setup):**
85
+ [If not using extensions](#gemini-cli-and-gemini-code-assist), edit
86
+ `.gemini/settings.json` for a single project or `~/.gemini/settings.json` for
87
+ all projects.
88
+
89
+ For **Visual Studio Code** edit the `.vscode/mcp.json` file in your workspace
90
+ for a single project or your global user settings file for all projects:
91
+
92
+ ```json
93
+ "servers": {
94
+ "gcs": {
95
+ "command": "npx",
96
+ "args": ["-y", "@google-cloud/storage-mcp"]
97
+ }
98
+ }
99
+ ```
100
+
101
+ ## 🛠 Local Development
102
+
103
+ For more information regarding installing the repository locally, please see
104
+ [development.md](doc/DEVELOPMENT.md)
105
+
106
+ ### Testing
107
+
108
+ To run the integration or E2E tests, you will need to set the
109
+ `GOOGLE_CLOUD_PROJECT` or `GCP_PROJECT_ID` environment variable to a valid
110
+ Google Cloud project ID.
111
+
112
+ ```shell
113
+ export GOOGLE_CLOUD_PROJECT=your-gcp-project-id
114
+ npm run test:integration --workspace=packages/storage-mcp
115
+ npm run test:e2e --workspace=packages/storage-mcp
116
+ ```
117
+
118
+ ## 🧰 Available MCP Tools
119
+
120
+ The Storage MCP server offers two sets of tools: **Safe Tools** and
121
+ **Destructive Tools**. By default, only the safe tools are enabled to prevent
122
+ accidental data loss.
123
+
124
+ ### Safe Tools
125
+
126
+ Safe tools are read-only or only create new objects without affecting existing
127
+ ones. They will never modify or delete existing data in GCS.
128
+
129
+ | Tool | Description |
130
+ | :---------------------- | :------------------------------------------------------------------------------ |
131
+ | `list_buckets` | Lists all buckets in a project. |
132
+ | `get_bucket_metadata` | Gets comprehensive metadata for a specific bucket. |
133
+ | `get_bucket_location` | Gets the location of a bucket. |
134
+ | `view_iam_policy` | Views the IAM policy for a bucket. |
135
+ | `check_iam_permissions` | Tests IAM permissions for a bucket. |
136
+ | `create_bucket` | Creates a new bucket. Fails if the bucket already exists. |
137
+ | `list_objects` | Lists objects in a GCS bucket. |
138
+ | `read_object_metadata` | Reads comprehensive metadata for a specific object. |
139
+ | `read_object_content` | Reads the content of a specific object. |
140
+ | `download_object` | Downloads an object from GCS to a local file. |
141
+ | `write_object_new` | Writes a new object. Fails if the object already exists. |
142
+ | `upload_object_new` | Uploads a file to a new object. Fails if the object already exists. |
143
+ | `copy_object_new` | Copies an object to a new destination. Fails if the destination already exists. |
144
+
145
+ ### Destructive Tools
146
+
147
+ **Warning:** These tools can permanently modify or delete existing data. Enable
148
+ them only when you are confident that the agent should be allowed to perform
149
+ these actions.
150
+
151
+ You can enable them by running the `init` command with the
152
+ `--enable-destructive-tools` flag. When enabled, these tools replace their safe
153
+ counterparts (e.g., `write_object` is registered instead of `write_object_new`).
154
+
155
+ | Tool | Description |
156
+ | :----------------------- | :--------------------------------------------------------- |
157
+ | `delete_bucket` | **Deletes** a bucket. |
158
+ | `update_bucket_labels` | **Modifies** labels for a bucket. |
159
+ | `delete_object` | **Deletes** a specific object from a bucket. |
160
+ | `update_object_metadata` | **Modifies** the custom metadata of an existing object. |
161
+ | `move_object` | **Moves** an object (copies then deletes the original). |
162
+ | `write_object` | Writes an object, **overwriting** it if it already exists. |
163
+ | `upload_object` | Uploads a file, **overwriting** the destination object. |
164
+ | `copy_object` | Copies an object, **overwriting** the destination object. |
165
+
166
+ ## 🔑 MCP Permissions
167
+
168
+ The permissions of the Storage MCP are directly tied to the permissions of the
169
+ authenticated user or service account. To restrict permissions and operate with
170
+ the principle of least privilege, you can
171
+ [authorize gcloud as a service account](https://cloud.google.com/sdk/docs/authorizing#service-account)
172
+ and assign the service account a
173
+ [role with limited permissions](https://cloud.google.com/iam/docs/roles-overview)
174
+ for Google Cloud Storage.
175
+
176
+ ## 👥 Contributing
177
+
178
+ We welcome contributions! Whether you're fixing bugs, sharing feedback, or
179
+ improving documentation, your contributions are welcome. Please read our
180
+ [Contributing Guide](CONTRIBUTING.md) to get started.
181
+
182
+ ## 🎬 Demo
183
+
184
+ <p align="center"><b>Click to watch the Storage MCP demo</b><br/>
185
+ <a href="./assets/storage_mcp_demo.mp4" title="Click to play demo">
186
+ <img width="80%" alt="Storage MCP Demo Video" src="./assets/storage_mcp_demo_thumbnail.png">
187
+ </a>
188
+ </p>
189
+
190
+ ## 📄 Important Notes
191
+
192
+ This repository is currently in preview and may see breaking changes. This
193
+ repository is providing a solution, not an officially supported Google product.
194
+ It may break when the MCP specification, other SDKs, or when other solutions
195
+ and products change. See also our [Security Policy](SECURITY.md).