get_bucket_policy
Retrieve the access policy of a specified bucket in MinIO Storage MCP for security and permissions management. Input the bucket name to fetch detailed policy configuration.
Instructions
获取存储桶策略
Input Schema
TableJSON Schema
| Name | Required | Description | Default |
|---|---|---|---|
| bucketName | Yes | 存储桶名称 |
Implementation Reference
- src/index.ts:611-625 (handler)MCP tool handler for get_bucket_policy: validates bucketName argument using zod, calls minioClient.getBucketPolicy, and returns the policy as formatted text content.case 'get_bucket_policy': { const { bucketName } = z.object({ bucketName: z.string() }).parse(args); const policy = await this.minioClient.getBucketPolicy(bucketName); return { content: [ { type: 'text', text: `存储桶 ${bucketName} 的策略:\n${policy}` } ] }; }
- src/index.ts:290-300 (registration)Registration of the get_bucket_policy tool in the listTools response, including name, Chinese description, and input schema requiring bucketName.{ name: 'get_bucket_policy', description: '获取存储桶策略', inputSchema: { type: 'object', properties: { bucketName: { type: 'string', description: '存储桶名称' } }, required: ['bucketName'] } },
- src/minio-client.ts:337-340 (helper)Helper method in MinIOStorageClient class that ensures client connection and delegates to the underlying Minio SDK's getBucketPolicy method.async getBucketPolicy(bucketName: string): Promise<string> { this.ensureConnected(); return await this.client!.getBucketPolicy(bucketName); }