copy_object
Copy objects between buckets in MinIO Storage by specifying source and destination bucket and object names through the MCP server.
Instructions
复制对象
Input Schema
TableJSON Schema
| Name | Required | Description | Default |
|---|---|---|---|
| destBucket | Yes | 目标存储桶名称 | |
| destObject | Yes | 目标对象名称 | |
| sourceBucket | Yes | 源存储桶名称 | |
| sourceObject | Yes | 源对象名称 |
Implementation Reference
- src/index.ts:486-503 (handler)Handler for the 'copy_object' tool that validates input with Zod, calls MinIOStorageClient.copyObject, and returns a success message.case 'copy_object': { const { sourceBucket, sourceObject, destBucket, destObject } = z.object({ sourceBucket: z.string(), sourceObject: z.string(), destBucket: z.string(), destObject: z.string() }).parse(args); await this.minioClient.copyObject(sourceBucket, sourceObject, destBucket, destObject); return { content: [ { type: 'text', text: `成功复制对象从 ${sourceBucket}/${sourceObject} 到 ${destBucket}/${destObject}` } ] }; }
- src/index.ts:186-199 (schema)Input schema and tool metadata for 'copy_object' tool defined in the list_tools response.{ name: 'copy_object', description: '复制对象', inputSchema: { type: 'object', properties: { sourceBucket: { type: 'string', description: '源存储桶名称' }, sourceObject: { type: 'string', description: '源对象名称' }, destBucket: { type: 'string', description: '目标存储桶名称' }, destObject: { type: 'string', description: '目标对象名称' } }, required: ['sourceBucket', 'sourceObject', 'destBucket', 'destObject'] } },
- src/minio-client.ts:188-193 (helper)The MinIOStorageClient method that implements the object copy operation using the MinIO client library.async copyObject(sourceBucket: string, sourceObject: string, destBucket: string, destObject: string): Promise<void> { this.ensureConnected(); const copyConditions = new Minio.CopyConditions(); await this.client!.copyObject(destBucket, destObject, `/${sourceBucket}/${sourceObject}`, copyConditions); }