create_bucket
Create and configure storage buckets in MinIO Storage MCP by specifying a bucket name and optional region settings for organized object storage management.
Instructions
创建存储桶
Input Schema
TableJSON Schema
| Name | Required | Description | Default |
|---|---|---|---|
| bucketName | Yes | 存储桶名称 | |
| region | No | 区域设置(可选) |
Implementation Reference
- src/index.ts:346-361 (handler)Main tool handler for 'create_bucket' in the CallToolRequestSchema switch statement. Parses input arguments using Zod, calls the MinIO client's createBucket method, and returns a success response.case 'create_bucket': { const { bucketName, region } = z.object({ bucketName: z.string(), region: z.string().optional() }).parse(args); await this.minioClient.createBucket(bucketName, region); return { content: [ { type: 'text', text: `成功创建存储桶: ${bucketName}` } ] }; }
- src/index.ts:88-99 (registration)Tool registration for 'create_bucket' in the ListToolsRequestSchema handler, including name, description, and input schema.{ name: 'create_bucket', description: '创建存储桶', inputSchema: { type: 'object', properties: { bucketName: { type: 'string', description: '存储桶名称' }, region: { type: 'string', description: '区域设置(可选)' } }, required: ['bucketName'] } },
- src/index.ts:347-350 (schema)Zod schema validation for 'create_bucket' input arguments within the tool handler.const { bucketName, region } = z.object({ bucketName: z.string(), region: z.string().optional() }).parse(args);
- src/minio-client.ts:54-60 (helper)Core implementation of bucket creation in MinIOStorageClient class using the MinIO SDK's makeBucket method./** * 创建存储桶 */ async createBucket(bucketName: string, region?: string): Promise<void> { this.ensureConnected(); await this.client!.makeBucket(bucketName, region || this.config!.region || 'us-east-1'); }