COS (Cloud Object Storage & Cloud Infinite) MCP Integration
An MCP server that exposes COS/CI API capabilities, supporting operations such as uploading/downloading objects, listing objects, document-to-PDF conversion, image text watermarking, image QR code recognition, image quality scoring, image super-resolution, image matting, intelligent image cropping, intelligent search MetaInsight (text-to-image, image-to-image), and video intelligent cover generation.
Environment Variables
- Set SECRET_ID and SECRET_KEY to your credentials from the API Key Management page
- Set BUCKET to your bucket name
- Set REGION to the region where your bucket is located
- Set DATASET_NAME to the dataset name for intelligent search (optional)
🗺️ Feature List
| Tool Identifier | Function Description | Core Parameters |
|---|---|---|
putObject | Upload a local file to the bucket (server-local files only) | filePath, fileName, targetDir |
putObjectSourceUrl | Download a file via URL and upload it to the bucket | sourceUrl, fileName, targetDir |
getObject | Download a file from the bucket | objectKey |
getBucket | List files in the specified bucket | Prefix |
imageInfo | Get image information | objectKey |
assessQuality | Image quality assessment | objectKey |
aiSuperResolution | Image super-resolution processing | objectKey |
aiPicMatting | Image matting processing | objectKey, width, height |
aiQrcode | QR code recognition | objectKey |
waterMarkFont | Generate an image with text watermark | objectKey, text |
createMediaSmartCoverJob | Create a media intelligent cover task | objectKey |
describeMediaJob | Query media intelligent cover task result | jobId |
imageSearchPic | Search for similar images by image | uri |
imageSearchText | Search for similar images by text | text |
createDocToPdfJob | Create a document-to-PDF processing task | objectKey |
describeDocProcessJob | Query document transcoding task result | jobId |
🔌 Usage
Parameter Reference
putObject
Upload a file to the bucket.
| Input Parameter | Type | Description |
|---|---|---|
| filePath | string | File path (including filename) |
| fileName | optional string | Filename (as stored in the bucket) |
| targetDir | optional string | Target directory (directory inside the bucket) |
Returns: Object URL
putObjectSourceUrl
Download a file via URL and upload it to the bucket.
| Input Parameter | Type | Description |
|---|---|---|
| sourceUrl | string | Downloadable file URL |
| fileName | optional string | Filename (as stored in the bucket) |
| targetDir | optional string | Target directory (directory inside the bucket) |
Returns: Object URL
getObject
Download a file from the bucket.
| Input Parameter | Type | Description |
|---|---|---|
| objectKey | string | File path |
Returns: File content
getBucket
Get information about a specified bucket.
| Input Parameter | Type | Description |
|---|---|---|
| Prefix | optional string | Path prefix for the file list; defaults to the root path |
Returns: List of files in the bucket
imageInfo
Image processing — get image information.
| Input Parameter | Type | Description |
|---|---|---|
| objectKey | string | Path of the image in the bucket |
Returns:
| Output Parameter | Description |
|---|---|
| format | Image type, e.g. png, gif |
| width | Image width in pixels (px) |
| height | Image height in pixels (px) |
| size | Image size in bytes |
| md5 | MD5 value of the image |
| frame_count | Number of frames; 1 for static images, actual frame count for animated images |
| bit_depth | Bit depth of the image |
| vertical_dpi | Vertical DPI of the image |
| horizontal_dpi | Horizontal DPI of the image |
assessQuality
Image processing — image quality assessment.
| Input Parameter | Type | Description |
|---|---|---|
| objectKey | string | Path of the image in the bucket |
Returns:
| Output Parameter | Description |
|---|---|
| LongImage | Long image (aspect ratio ≥3 or ≤1/3); TRUE = yes, FALSE = no |
| BlackAndWhite | Black and white image (grayscale, all RGB channels are gray); TRUE = yes, FALSE = no |
| SmallImage | Small image (longest side <179 px); TRUE = yes, other fields output 0 or FALSE |
| BigImage | Large image (shortest side >1000 px); TRUE = yes, FALSE = no |
| PureImage | Solid-color/pure-text image (no content or simple content); TRUE = yes, FALSE = no |
| ClarityScore | Clarity score (0–100; composite of noise/exposure/blur/compression; ≥50 is relatively clear) |
| AestheticScore | Aesthetic score (0–100; artistic evaluation of composition/color; ≥50 is relatively aesthetic) |
| LowQualityScore | Content quality score (0–100; quality evaluation of background/content; ≥50 is relatively good quality) |
| RequestId | Unique request ID for troubleshooting |
aiSuperResolution
Image processing — super-resolution.
| Input Parameter | Type | Description |
|---|---|---|
| objectKey | string | Path of the image in the bucket |
Returns:
| Output Parameter Node | Parent Node | Description |
|---|---|---|
| UploadResult | None | Request result container |
| OriginalInfo | UploadResult | Original image information container |
| Key | OriginalInfo | Original image filename (e.g. example.jpg) |
| Location | OriginalInfo | Original image storage path |
| ETag | OriginalInfo | Unique identifier of the original image file |
| ProcessResults | UploadResult | Image processing result container |
| Object | ProcessResults | Single image processing result container |
| Key | Object | Super-resolution output image filename (e.g. output.jpg) |
| Location | Object | Access URL for the super-resolution output image |
| ETag | Object | Unique identifier of the super-resolution output image |
| Size | Object | Size of the super-resolution output image (in bytes) |
aiPicMatting
Image processing — matting.
| Input Parameter | Type | Description |
|---|---|---|
| objectKey | string | Path of the image in the bucket |
| width | optional string | Width |
| height | optional string | Height |
Returns:
| Output Parameter Node | Parent Node | Description |
|---|---|---|
| UploadResult | None | Request result container |
| OriginalInfo | UploadResult | Original image information container |
| Key | OriginalInfo | Original image filename (e.g. example.jpg) |
| Location | OriginalInfo | Original image storage path |
| ETag | OriginalInfo | Original image ETag value |
| ProcessResults | UploadResult | Image processing result container |
| Object | ProcessResults | Single image processing result container |
| Key | Object | Matted image filename (e.g. output.jpg) |
| Location | Object | Matted image URL |
| ETag | Object | Matted image ETag value |
| Size | Object | Matted image size (in bytes) |
aiQrcode
Image processing — QR code recognition for images in the bucket.
| Input Parameter | Type | Description |
|---|---|---|
| objectKey | string | COS object key (full path), e.g. images/qrcode.jpg |
Returns:
| Output Parameter Node | Parent Node | Description |
|---|---|---|
| UploadResult | None | Original image information container |
| OriginalInfo | UploadResult | Original image information container |
| Key | OriginalInfo | Original image filename |
| Location | OriginalInfo | Image path |
| ImageInfo | OriginalInfo | Original image info container |
| Format | ImageInfo | Image format |
| Width | ImageInfo | Image width |
| Height | ImageInfo | Image height |
| Quality | ImageInfo | Image quality |
| Ave | ImageInfo | Image dominant color |
| Orientation | ImageInfo | Image rotation angle |
| ProcessResults | UploadResult | Image processing result container |
| Object | ProcessResults | Single processing result container |
| Key | Object | Processed filename |
| Location | Object | Processed image path |
| Format | Object | Processed image format |
| Width | Object | Processed image width |
| Height | Object | Processed image height |
| Size | Object | Processed image size |
| Quality | Object | Processed image quality |
| codeStatus | Object | QR code recognition status (0 = none, 1 = found) |
| QRcodeInfo | Object | QR code recognition result container |
| codeUrl | QRcodeInfo | Decoded QR code content |
| codelocation | QRcodeInfo | QR code coordinate container |
| point | codelocation | Coordinate points (format: x1,y1;x2,y2;...) |
waterMarkFont
Generate an image with a text watermark.
| Input Parameter | Type | Description |
|---|---|---|
| objectKey | string | COS object key (full path), e.g. images/photo.jpg |
| text | string | Watermark text content (supports Chinese) |
Returns:
| Output Parameter Node | Parent Node | Description |
|---|---|---|
| UploadResult | None | Original image info (request result container) |
| OriginalInfo | UploadResult | Original image information container |
| Key | OriginalInfo | Original image filename |
| Location | OriginalInfo | Image path |
| ImageInfo | OriginalInfo | Original image info container |
| ETag | OriginalInfo | ETag of original/result image (updated on overwrite) |
| Format | ImageInfo | Image format |
| Width | ImageInfo | Image width (in pixels) |
| Height | ImageInfo | Image height (in pixels) |
| Quality | ImageInfo | Image quality (numeric) |
| Ave | ImageInfo | Image dominant color (hex format 0xRRGGBB) |
| Orientation | ImageInfo | Image rotation angle (1–8 correspond to different rotation/flip modes) |
| FrameCount | ImageInfo | Number of frames (1 for static images, actual count for animated images) |
| ProcessResults | UploadResult | Image processing result container |
| Object | ProcessResults | Single image processing result container |
| Key | Object | Result image filename |
| Location | Object | Result image path |
| Format | Object | Result image format |
| Width | Object | Result image width (in pixels) |
| Height | Object | Result image height (in pixels) |
| Size | Object | Result image size (in bytes) |
| Quality | Object | Result image quality (numeric) |
| ETag | Object | ETag of the processing result image |
| FrameCount | Object | Number of frames in result image (1 for static, actual count for animated) |
createMediaSmartCoverJob
Create a media intelligent cover task.
| Input Parameter | Type | Description |
|---|---|---|
| objectKey | string | Path of the object in the bucket |
Returns:
| Output Parameter Node | Parent Node | Description |
|---|---|---|
| Response | None | Result container |
| JobsDetail | Response | Detailed task information |
| Code | Response.JobsDetail | Error code; only meaningful when State is Failed |
| Message | Response.JobsDetail | Error description; only meaningful when State is Failed |
| JobId | Response.JobsDetail | ID of the newly created task |
| Tag | Response.JobsDetail | Tag of the newly created task: SmartCover |
| State | Response.JobsDetail | Task status |
| CreationTime | Response.JobsDetail | Task creation time |
| EndTime | Response.JobsDetail | Task end time |
| QueueId | Response.JobsDetail | Queue ID the task belongs to |
| Input | Response.JobsDetail | Input resource address for this task |
| Operation | Response.JobsDetail | Rules for this task |
| Region | Response.JobsDetail.Input | Region of the bucket |
| Bucket | Response.JobsDetail.Input | Bucket where results are stored |
| Object | Response.JobsDetail.Input | Output result filename |
| SmartCover | Response.JobsDetail.Operation | Same as Request.Operation.SmartCover in the request |
| Output | Response.JobsDetail.Operation | Same as Request.Operation.Output in the request |
| MediaResult | Response.JobsDetail.Operation | Basic information about the output file; not returned until the task is complete. See MediaResult |
| UserData | Response.JobsDetail.Operation | Passthrough user information |
| JobLevel | Response.JobsDetail.Operation | Task priority |
| OutputFile | Response.JobsDetail.Operation.MediaResult | Basic information about the output file |
| Bucket_OutputFile | Response.JobsDetail.Operation.MediaResult.OutputFile | Bucket where the output file is stored |
| Region_OutputFile | Response.JobsDetail.Operation.MediaResult.OutputFile | Region of the bucket where the output file is stored |
| ObjectName | Response.JobsDetail.Operation.MediaResult.OutputFile | Output filename(s); may have multiple |
| Md5Info | Response.JobsDetail.Operation.MediaResult.OutputFile | MD5 information of the output file |
| ObjectName_MD5 | Response.JobsDetail.Operation.MediaResult.OutputFile.Md5Info | Output filename (with MD5 suffix) |
| Md5 | Response.JobsDetail.Operation.MediaResult.OutputFile.Md5Info | MD5 value of the output file |
describeMediaJob
Query the result of a specified media intelligent cover task by job ID.
| Input Parameter | Type | Description |
|---|---|---|
| jobId | string | ID of the task to query; available from the response when the intelligent cover task was submitted |
Returns:
| Output Parameter Node | Parent Node | Description |
|---|---|---|
| Response | None | Result container |
| JobsDetail | Response | Detailed task information |
| Code | Response.JobsDetail | Error code; only meaningful when State is Failed |
| Message | Response.JobsDetail | Error description; only meaningful when State is Failed |
| JobId | Response.JobsDetail | ID of the newly created task |
| Tag | Response.JobsDetail | Tag of the newly created task: SmartCover |
| State | Response.JobsDetail | Task status |
| CreationTime | Response.JobsDetail | Task creation time |
| EndTime | Response.JobsDetail | Task end time |
| QueueId | Response.JobsDetail | Queue ID the task belongs to |
| Input | Response.JobsDetail | Input resource address for this task |
| Operation | Response.JobsDetail | Rules for this task |
| Region | Response.JobsDetail.Input | Region of the bucket |
| Bucket | Response.JobsDetail.Input | Bucket where results are stored |
| Object | Response.JobsDetail.Input | Output result filename |
| SmartCover | Response.JobsDetail.Operation | Same as Request.Operation.SmartCover in the request |
| Output | Response.JobsDetail.Operation | Same as Request.Operation.Output in the request |
| MediaResult | Response.JobsDetail.Operation | Basic information about the output file; not returned until the task is complete. See MediaResult |
| UserData | Response.JobsDetail.Operation | Passthrough user information |
| JobLevel | Response.JobsDetail.Operation | Task priority |
| OutputFile | Response.JobsDetail.Operation.MediaResult | Basic information about the output file |
| Bucket_OutputFile | Response.JobsDetail.Operation.MediaResult.OutputFile | Bucket where the output file is stored |
| Region_OutputFile | Response.JobsDetail.Operation.MediaResult.OutputFile | Region of the bucket where the output file is stored |
| ObjectName | Response.JobsDetail.Operation.MediaResult.OutputFile | Output filename(s); may have multiple |
| Md5Info | Response.JobsDetail.Operation.MediaResult.OutputFile | MD5 information of the output file |
| ObjectName_Info | Response.JobsDetail.Operation.MediaResult.OutputFile.Md5Info | Output filename (with MD5 suffix) |
| Md5_Value | Response.JobsDetail.Operation.MediaResult.OutputFile.Md5Info | MD5 value of the output file |
imageSearchPic
Search for images with similar content to the input image from the dataset.
| Input Parameter | Type | Description |
|---|---|---|
| uri | string | URI of the input image; retrieves images with similar content from the dataset |
Returns:
| Output Parameter Node | Parent Node | Description |
|---|---|---|
| ImageResult | None | List of image search recognition results |
| RequestId | None | Request ID |
| URI | ImageResult | URL of the similar image |
| Score | ImageResult | Image relevance score; higher score means more similar to the search criteria |
imageSearchText
Search for images that match the input text content from the dataset.
| Input Parameter | Type | Description |
|---|---|---|
| text | string | Search text |
Returns:
| Output Parameter Node | Parent Node | Description |
|---|---|---|
| ImageResult | None | List of image search recognition results |
| RequestId | None | Request ID |
| URI | ImageResult | URL of the matching image |
| Score | ImageResult | Image relevance score; higher score means more similar to the search criteria |
createDocToPdfJob
Create a document-to-PDF processing task.
| Input Parameter | Type | Description |
|---|---|---|
| objectKey | string | Path of the object in the bucket |
Returns:
| Output Parameter Node | Parent Node | Description |
|---|---|---|
| Response | None | Result container |
| JobsDetail | Response | Detailed task information; same as the Response.JobsDetail node in the CreateDocProcessJobs API |
| NonExistJobIds | Response | IDs in the query that do not exist; not returned if all tasks exist |
| DocProcess | Response.JobsDetail.Operation | Document preview task parameters |
| DocProcessResult | Response.JobsDetail.Operation | Document preview task result details; returned when job type is DocProcess and status is success |
| Output | Response.JobsDetail.Operation | Result output address; same as the Request.Operation.Output node in the CreateDocProcessJobs API |
| PageInfo | Response.JobsDetail.Operation.DocProcessResult | Details about preview task output |
| TgtType | Response.JobsDetail.Operation.DocProcessResult | Target format of the preview output |
| TotalPageCount | Response.JobsDetail.Operation.DocProcessResult | Total number of preview task outputs |
| SuccPageCount | Response.JobsDetail.Operation.DocProcessResult | Number of successful preview task outputs |
| FailPageCount | Response.JobsDetail.Operation.DocProcessResult | Number of failed preview task outputs |
| TotalSheetCount | Response.JobsDetail.Operation.DocProcessResult | Total number of sheets in the preview task (Excel-specific parameter) |
| PageNo | Response.JobsDetail.Operation.DocProcessResult.PageInfo | Preview output page number / SheetId (for Excel format) |
| TgtUri | Response.JobsDetail.Operation.DocProcessResult.PageInfo | COS bucket path of the generated preview output |
| X-SheetPics | Response.JobsDetail.Operation.DocProcessResult.PageInfo | Total number of images generated for the current sheet (Excel-specific parameter) |
| PicIndex | Response.JobsDetail.Operation.DocProcessResult.PageInfo | Sequence number of the current preview output in the entire source file (Excel-specific parameter) |
| PicNum | Response.JobsDetail.Operation.DocProcessResult.PageInfo | Sequence number of the current preview output within the sheet (Excel-specific parameter) |
describeDocProcessJob
Query the result of a specified document transcoding task by job ID.
| Input Parameter | Type | Description |
|---|---|---|
| jobId | string | ID of the task to query; available from the response when the document task was submitted |
Returns:
| Output Parameter Node | Parent Node | Description |
|---|---|---|
| Response | None | Result container |
| JobsDetail | Response | Detailed task information; same as the Response.JobsDetail node in the CreateDocProcessJobs API |
| NonExistJobIds | Response | IDs in the query that do not exist; not returned if all tasks exist |
| DocProcess | Response.JobsDetail.Operation | Document preview task parameters |
| DocProcessResult | Response.JobsDetail.Operation | Document preview task result details; returned when job type is DocProcess and status is success |
| Output | Response.JobsDetail.Operation | Result output address; same as the Request.Operation.Output node in the CreateDocProcessJobs API |
| PageInfo | Response.JobsDetail.Operation.DocProcessResult | Details about preview task output |
| TgtType | Response.JobsDetail.Operation.DocProcessResult | Target format of the preview output |
| TotalPageCount | Response.JobsDetail.Operation.DocProcessResult | Total number of preview task outputs |
| SuccPageCount | Response.JobsDetail.Operation.DocProcessResult | Number of successful preview task outputs |
| FailPageCount | Response.JobsDetail.Operation.DocProcessResult | Number of failed preview task outputs |
| TotalSheetCount | Response.JobsDetail.Operation.DocProcessResult | Total number of sheets in the preview task (Excel-specific parameter) |
| PageNo | Response.JobsDetail.Operation.DocProcessResult.PageInfo | Preview output page number / SheetId (for Excel format) |
| TgtUri | Response.JobsDetail.Operation.DocProcessResult.PageInfo | COS bucket path of the generated preview output |
| X-SheetPics | Response.JobsDetail.Operation.DocProcessResult.PageInfo | Total number of images generated for the current sheet (Excel-specific parameter) |
| PicIndex | Response.JobsDetail.Operation.DocProcessResult.PageInfo | Sequence number of the current preview output in the entire source file (Excel-specific parameter) |
| PicNum | Response.JobsDetail.Operation.DocProcessResult.PageInfo | Sequence number of the current preview output within the sheet (Excel-specific parameter) |