UNPKG

qiniu-mcp

Version:

A Model Context Protocol server for Qiniu Cloud Storage services with optimized local file upload support

285 lines 10.5 kB
export const QINIU_TOOLS = [ { name: "qiniu_upload_file", description: "Upload a file to Qiniu Cloud Storage", inputSchema: { type: "object", properties: { filePath: { type: "string", description: "Local file path to upload" }, bucket: { type: "string", description: "Target bucket name (optional, will use default bucket from config if not provided)" }, key: { type: "string", description: "Object key (filename) in the bucket. If not provided, will use the original filename" }, expires: { type: "number", description: "Upload token expiration time in seconds (default: 3600)" } }, required: ["filePath"] } }, { name: "qiniu_upload_content", description: "Upload text content directly to Qiniu Cloud Storage without creating a local file", inputSchema: { type: "object", properties: { content: { type: "string", description: "Text content to upload" }, bucket: { type: "string", description: "Target bucket name (optional, will use default bucket from config if not provided)" }, key: { type: "string", description: "Object key (filename) in the bucket" }, contentType: { type: "string", description: "MIME type of the content (e.g., 'text/html', 'text/plain', 'application/json'). Default: 'text/plain'" }, expires: { type: "number", description: "Upload token expiration time in seconds (default: 3600)" } }, required: ["content", "key"] } }, { name: "qiniu_upload_base64", description: "Upload base64 encoded binary content (images, PDFs, etc.) directly to Qiniu Cloud Storage", inputSchema: { type: "object", properties: { base64Content: { type: "string", description: "Base64 encoded binary content (without data:mime/type;base64, prefix)" }, bucket: { type: "string", description: "Target bucket name (optional, will use default bucket from config if not provided)" }, key: { type: "string", description: "Object key (filename) in the bucket" }, contentType: { type: "string", description: "MIME type of the content (e.g., 'image/png', 'image/jpeg', 'application/pdf'). Default: 'application/octet-stream'" }, expires: { type: "number", description: "Upload token expiration time in seconds (default: 3600)" } }, required: ["base64Content", "key"] } }, { name: "qiniu_upload_from_url", description: "Upload a file from URL directly to Qiniu Cloud Storage (faster than base64 for images)", inputSchema: { type: "object", properties: { url: { type: "string", description: "URL of the file to upload" }, bucket: { type: "string", description: "Target bucket name (optional, will use default bucket from config if not provided)" }, key: { type: "string", description: "Object key (filename) in the bucket. If not provided, will generate from URL" }, expires: { type: "number", description: "Upload token expiration time in seconds (default: 3600)" } }, required: ["url"] } }, { name: "qiniu_upload_local_file", description: "Upload a local file to Qiniu Cloud Storage by sending file content to server (supports file:// URLs and local paths)", inputSchema: { type: "object", properties: { filePath: { type: "string", description: "Local file path or file:// URL to upload" }, bucket: { type: "string", description: "Target bucket name (optional, will use default bucket from config if not provided)" }, key: { type: "string", description: "Object key (filename) in the bucket. If not provided, will use the original filename" }, expires: { type: "number", description: "Upload token expiration time in seconds (default: 3600)" } }, required: ["filePath"] } }, { name: "qiniu_list_files", description: "List files in a Qiniu Cloud Storage bucket", inputSchema: { type: "object", properties: { bucket: { type: "string", description: "Bucket name to list files from (optional, will use default bucket from config if not provided)" }, prefix: { type: "string", description: "File prefix to filter results" }, limit: { type: "number", description: "Maximum number of files to return (default: 100, max: 1000)" }, marker: { type: "string", description: "Marker for pagination" } }, required: [] } }, { name: "qiniu_delete_file", description: "Delete a file from Qiniu Cloud Storage", inputSchema: { type: "object", properties: { bucket: { type: "string", description: "Bucket name (optional, will use default bucket from config if not provided)" }, key: { type: "string", description: "Object key (filename) to delete" } }, required: ["key"] } }, { name: "qiniu_get_file_info", description: "Get detailed information about a file in Qiniu Cloud Storage", inputSchema: { type: "object", properties: { bucket: { type: "string", description: "Bucket name (optional, will use default bucket from config if not provided)" }, key: { type: "string", description: "Object key (filename)" } }, required: ["key"] } }, { name: "qiniu_generate_download_url", description: "Generate a download URL for a file in Qiniu Cloud Storage", inputSchema: { type: "object", properties: { bucket: { type: "string", description: "Bucket name (optional, will use default bucket from config if not provided)" }, key: { type: "string", description: "Object key (filename)" }, domain: { type: "string", description: "Custom domain for the download URL. If not provided, will use the default domain from config" }, expires: { type: "number", description: "URL expiration time in seconds (default: 3600)" }, private: { type: "boolean", description: "Whether the file is in a private bucket (default: false)" } }, required: ["key"] } }, { name: "qiniu_copy_file", description: "Copy a file within Qiniu Cloud Storage", inputSchema: { type: "object", properties: { sourceBucket: { type: "string", description: "Source bucket name" }, sourceKey: { type: "string", description: "Source object key" }, targetBucket: { type: "string", description: "Target bucket name" }, targetKey: { type: "string", description: "Target object key" } }, required: ["sourceBucket", "sourceKey", "targetBucket", "targetKey"] } }, { name: "qiniu_move_file", description: "Move/rename a file within Qiniu Cloud Storage", inputSchema: { type: "object", properties: { sourceBucket: { type: "string", description: "Source bucket name" }, sourceKey: { type: "string", description: "Source object key" }, targetBucket: { type: "string", description: "Target bucket name" }, targetKey: { type: "string", description: "Target object key" } }, required: ["sourceBucket", "sourceKey", "targetBucket", "targetKey"] } } ]; //# sourceMappingURL=tools.js.map