Skip to main content
Glama
pickstar-2002

MinIO Storage MCP

generate_presigned_url

Create time-limited URLs for secure access to MinIO storage objects without authentication, enabling temporary sharing or uploads.

Instructions

生成预签名URL

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
bucketNameYes存储桶名称
objectNameYes对象名称
methodNoHTTP方法GET
expiresNo过期时间(秒)

Implementation Reference

  • Handler for the 'generate_presigned_url' tool that validates input parameters using Zod, calls the MinIO client's generatePresignedUrl method, and formats the response with the generated URL.
    case 'generate_presigned_url': {
      const { bucketName, objectName, method, expires } = z.object({
        bucketName: z.string(),
        objectName: z.string(),
        method: z.enum(['GET', 'PUT', 'DELETE']).default('GET'),
        expires: z.number().default(3600)
      }).parse(args);
      
      const url = await this.minioClient.generatePresignedUrl(bucketName, objectName, method, { expires });
      return {
        content: [
          {
            type: 'text',
            text: `预签名URL (${method}, 有效期${expires}秒):\n${url}`
          }
        ]
      };
    }
  • src/index.ts:212-225 (registration)
    Registration of the 'generate_presigned_url' tool in the MCP server, including name, description, and input schema definition.
    {
      name: 'generate_presigned_url',
      description: '生成预签名URL',
      inputSchema: {
        type: 'object',
        properties: {
          bucketName: { type: 'string', description: '存储桶名称' },
          objectName: { type: 'string', description: '对象名称' },
          method: { type: 'string', enum: ['GET', 'PUT', 'DELETE'], description: 'HTTP方法', default: 'GET' },
          expires: { type: 'number', description: '过期时间(秒)', default: 3600 }
        },
        required: ['bucketName', 'objectName']
      }
    },
  • Helper method in MinIOStorageClient that implements the presigned URL generation logic using the MinIO SDK's presigned methods for GET, PUT, and DELETE.
    async generatePresignedUrl(bucketName: string, objectName: string, method: 'GET' | 'PUT' | 'DELETE' = 'GET', options?: PresignedUrlOptions): Promise<string> {
      this.ensureConnected();
      
      const expires = options?.expires || 3600; // 默认1小时
      
      switch (method) {
        case 'GET':
          return await this.client!.presignedGetObject(bucketName, objectName, expires, options?.reqParams, options?.requestDate);
        case 'PUT':
          return await this.client!.presignedPutObject(bucketName, objectName, expires);
        case 'DELETE':
          return await this.client!.presignedUrl('DELETE', bucketName, objectName, expires, options?.reqParams, options?.requestDate);
        default:
          throw new Error(`不支持的HTTP方法: ${method}`);
      }
    }
Behavior2/5

Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?

No annotations are provided, so the description carries full burden. It doesn't disclose that this generates a time-limited URL for object operations (GET, PUT, DELETE), which is a key behavioral trait. It misses details like authentication needs (likely requires permissions) or that the URL expires. The description is too minimal for a mutation-related tool.

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness3/5

Is the description appropriately sized, front-loaded, and free of redundancy?

The description is a single phrase, which is concise but under-specified. It's front-loaded but lacks necessary detail, making it inefficient rather than appropriately sized. It doesn't earn its place with useful information beyond the name.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness2/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

Given no annotations, no output schema, and a tool that generates URLs (implying mutation or access control), the description is incomplete. It should explain the tool's role in temporary access, return value format, or security implications. It fails to compensate for the lack of structured data.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters3/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

Schema description coverage is 100%, so parameters are well-documented in the schema. The description adds no additional meaning beyond the schema, such as explaining how 'method' affects URL usage or what 'expires' implies for security. Baseline is 3 since the schema does the heavy lifting.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose2/5

Does the description clearly state what the tool does and how it differs from similar tools?

The description '生成预签名URL' (Generate presigned URL) restates the tool name in Chinese without specifying what a presigned URL is or what it does. It doesn't distinguish this tool from sibling tools like 'get_object_info' or 'download_file', which might also involve object access. The purpose is vague rather than specific.

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines1/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

The description provides no guidance on when to use this tool versus alternatives. It doesn't mention that presigned URLs are for temporary access, or contrast it with tools like 'download_file' for direct downloads or 'get_object_info' for metadata. There's no context for when this is appropriate.

Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.

Install Server

Other Tools

Latest Blog Posts

MCP directory API

We provide all the information about MCP servers via our MCP API.

curl -X GET 'https://glama.ai/api/mcp/v1/servers/pickstar-2002/minio-storage-mcp'

If you have feedback or need assistance with the MCP directory API, please join our Discord server