connect_minio
Establish a connection to MinIO Storage MCP by providing server details, authentication keys, and SSL preferences to enable object storage operations like uploads, downloads, and permissions management.
Instructions
连接到MinIO服务器
Input Schema
TableJSON Schema
| Name | Required | Description | Default |
|---|---|---|---|
| accessKey | Yes | 访问密钥 | |
| endPoint | Yes | MinIO服务器地址 | |
| port | Yes | MinIO服务器端口 | |
| region | No | 区域设置(可选) | |
| secretKey | Yes | 秘密密钥 | |
| useSSL | No | 是否使用SSL连接 |
Implementation Reference
- src/index.ts:321-332 (handler)MCP tool handler for 'connect_minio': validates input using MinIOConfigSchema and calls MinIOStorageClient.connectcase 'connect_minio': { const config = MinIOConfigSchema.parse(args); await this.minioClient.connect(config); return { content: [ { type: 'text', text: `成功连接到MinIO服务器 ${config.endPoint}:${config.port}` } ] }; }
- src/minio-client.ts:14-31 (helper)Core implementation of MinIO connection in MinIOStorageClient.connect method: creates Minio.Client instance and tests with listBucketsasync connect(config: MinIOConfig): Promise<void> { try { this.client = new Minio.Client({ endPoint: config.endPoint, port: config.port, useSSL: config.useSSL, accessKey: config.accessKey, secretKey: config.secretKey, region: config.region }); // 测试连接 await this.client.listBuckets(); this.config = config; } catch (error) { throw new Error(`连接MinIO服务器失败: ${error instanceof Error ? error.message : String(error)}`); } }
- src/types.ts:4-11 (schema)Zod schema for MinIO connection configuration, used for input validation in handlerexport const MinIOConfigSchema = z.object({ endPoint: z.string().describe('MinIO服务器地址'), port: z.number().min(1).max(65535).describe('MinIO服务器端口'), useSSL: z.boolean().default(false).describe('是否使用SSL连接'), accessKey: z.string().describe('访问密钥'), secretKey: z.string().describe('秘密密钥'), region: z.string().optional().describe('区域设置(可选)') });
- src/index.ts:68-82 (registration)Tool registration in ListTools response: defines name, description, and input schema matching MinIOConfigSchemaname: 'connect_minio', description: '连接到MinIO服务器', inputSchema: { type: 'object', properties: { endPoint: { type: 'string', description: 'MinIO服务器地址' }, port: { type: 'number', description: 'MinIO服务器端口' }, useSSL: { type: 'boolean', description: '是否使用SSL连接', default: false }, accessKey: { type: 'string', description: '访问密钥' }, secretKey: { type: 'string', description: '秘密密钥' }, region: { type: 'string', description: '区域设置(可选)' } }, required: ['endPoint', 'port', 'accessKey', 'secretKey'] } },