# Qiniu Cloud MCP

> Qiniu Cloud MCP Server manages your entire cloud asset lifecycle. Use it to list buckets, get granular file metadata, track CDN bandwidth usage, delete assets, and even trigger persistent processing tasks—all directly through your AI client.

## Overview
- **Category:** industry-titans
- **Price:** Free
- **Tags:** qiniu-cloud, object-storage, cdn-management, asset-lifecycle, china-cloud, kodo-storage

## Description

Listen up. This isn't just another cloud connection; it’s your direct line into Qiniu Cloud for managing every damn asset you store and deliver online. You connect your AI client, and this MCP gives you everything you need to handle your entire content lifecycle—from figuring out what buckets you have to making sure the cache is fresh right now. It keeps all that infrastructure stuff from being a nightmare.

When you're scoping out what you've got, you can list every storage bucket in your account using `list_buckets`, and if you need to know exactly what lives inside one of those buckets, you just call `list_files`. For deeper inventory checks, you can also get a full rundown of associated domains pointing to any specific bucket via `get_bucket_domains`.

If you need details on a single file—like knowing its size, content type, or when it was last touched—you use `get_file_stat`. You'll always know the metadata without having to log into a dashboard. If you want to check what’s going on with your overall Qiniu account profile, `get_account_info` pulls that basic data for you.

For making changes or updating stuff, this thing is clutch. Need to wipe a file? You just run `delete_file`. Want to kick off some heavy lifting—like transcoding video or resizing images in the background? You'll start a persistent process with `persistent_file_op`, and then you can track its progress using `get_pfop_status` until it’s done. If you need to guarantee people see your latest content, running `refresh_cdn_urls` forces the CDN cache to update for those specific URLs. You can also manage file updates by initiating these background operations.

Monitoring usage is just as important. For your Content Delivery Network, you'll find `get_cdn_bandwidth` gives you live stats on how much bandwidth you're burning through. Beyond that, you get specialized reporting: check out `get_sms_stats` to see exactly how many SMS messages you sent recently, or use `get_bucket_domains` if you need to verify which domains are linked to a bucket.

It’s all about controlling delivery and usage metrics right through your agent. You don't have to jump between different consoles just to check stats or delete junk files. This MCP handles it all, letting you list contents, check granular metadata, force CDN cache refreshes, manage asset deletion and complex background operations, and pull critical usage stats—all without leaving your chat window.

## Tools

### delete_file
Removes a specified file from any Qiniu bucket.

### get_account_info
Retrieves basic profile information for your entire Qiniu account.

### get_bucket_domains
Lists all associated domains that point to a specific storage bucket.

### get_cdn_bandwidth
Fetches the current bandwidth consumption statistics for your CDN setup.

### get_file_stat
Retrieves detailed metadata (size, type, etc.) for a specific file in a bucket.

### get_pfop_status
Checks the completion status of any persistent background processing task that was initiated.

### get_sms_stats
Retrieves statistics on how many SMS messages you've sent recently.

### list_buckets
Returns a list of every storage bucket present in your Qiniu account.

### list_files
Outputs a list of all files stored inside a specified bucket.

### persistent_file_op
Starts a background process on a file, such as transcoding or resizing (a persistent operation).

### refresh_cdn_urls
Forces the CDN to update its cache for specific URLs, ensuring users see the latest content.

## Prompt Examples

**Prompt:** 
```
List all storage buckets in my Qiniu account.
```

**Response:** 
```
Retrieving your Qiniu buckets... I found 3 active buckets: 1. media-assets, 2. static-web, 3. user-backups. Which one would you like to inspect?
```

**Prompt:** 
```
Get the file status for 'logo.png' in bucket 'media-assets'.
```

**Response:** 
```
Querying file metadata... 'logo.png' (ID: abc123hash) has a size of 45KB and is set to type 'image/png'. It was last modified on 2024-04-10.
```

**Prompt:** 
```
Refresh the CDN cache for 'https://cdn.example.com/styles.css'.
```

**Response:** 
```
Connecting to Qiniu Fusion CDN... Refresh request submitted successfully! The cache for your CSS file is being purged across all global nodes.
```

## Capabilities

### Check Cloud Inventory
List all storage buckets in your account or list every file contained within a specific bucket.

### Manage File Status and Metadata
Get detailed stats on any stored asset, including its size, content type, and last modification date.

### Control CDN Delivery Cache
Force a cache refresh or check the live bandwidth statistics for your content delivery network URLs.

### Handle Asset Deletion and Updates
Delete specific files from buckets or trigger complex background operations like transcoding or processing.

### Monitor Usage Statistics
Retrieve account profile info, CDN bandwidth usage stats, or SMS sending metrics to track consumption.

## Use Cases

### Content is Live, But Users See Old Images
A new marketing campaign launches, but the global CDN shows old logos. Instead of manually logging into the dashboard and clicking 'Purge', you ask your agent to run `refresh_cdn_urls` for all affected paths. The cache updates instantly, and the content goes live globally.

### Need to Audit Old User Assets
The legal team requires a list of every file uploaded before 2023 that is stored in the 'user-uploads' bucket. You use `list_files` to get the full inventory, then filter that data with your AI agent to flag assets older than the required date.

### Debugging a Broken Asset Link
A developer reports an asset link is broken. Instead of just checking the URL, you use `get_file_stat` on that file ID. The tool returns metadata showing if the file was actually deleted (`delete_file`) or if its type changed, telling the dev exactly what went wrong.

### Managing Background Media Processing
A batch of videos needs watermarking and resizing. You trigger this job using `persistent_file_op`. You don't wait around; you repeatedly ask your agent to check the status with `get_pfop_status` until it confirms completion.

## Benefits

- **Instant Cache Purge:** Use `refresh_cdn_urls` to immediately purge stale content across your network. You don't have to wait for the cache timeout; you just run the tool, and it clears the URLs instantly.
- **Full Asset Inventory:** Need to know what files exist? `list_buckets` gives you an immediate map of all storage containers, while `list_files` fills in the details. No more guessing which bucket holds that one asset.
- **Deep File Auditing:** Don't just assume a file is right. Run `get_file_stat` to get precise metadata (size, type, last modified date). This is critical for compliance checks or troubleshooting corrupted assets.
- **Proactive Monitoring:** Track spending and performance with dedicated tools. Use `get_cdn_bandwidth` to see usage trends, and check `get_account_info` to keep tabs on your overall quota.
- **Automated Content Pipelines:** When a file needs resizing or transcoding, run `persistent_file_op`. Your agent handles the queueing and you use `get_pfop_status` until it's done. This keeps your workflow moving without manual follow-up.

## How It Works

The bottom line is you skip the manual console clicks. You tell your AI agent what to do with your cloud assets, and it handles the API calls.

1. Subscribe to the Qiniu Cloud server and gather your AccessKey/SecretKey from the official console.
2. Input those credentials into the MCP fields. Your AI client now holds permission to interact with your cloud infrastructure.
3. Ask your agent for specific actions, like 'List all buckets' or 'Refresh the CDN cache for X URL'. The server executes the tool and returns the data.

## Frequently Asked Questions

**How do I check file metadata with get_file_stat?**
You provide the specific file ID and bucket name to `get_file_stat`. The server returns detailed stats like size, MIME type, and the last time it was modified. This is great for auditing.

**Can I delete a file using delete_file?**
Yes, you use the `delete_file` tool by providing the target bucket and the full path to the asset. It executes the deletion immediately from your cloud account.

**What is the difference between list_files and list_buckets?**
Use `list_buckets` when you need a high-level view of all containers (the buckets) in your Qiniu account. Use `list_files` when you are inside one specific bucket and want to see every individual file within it.

**How do I force my CDN to show new content? Do I use refresh_cdn_urls?**
You run the `refresh_cdn_urls` tool, passing in the specific URLs you need updated. This forces the CDN cache across all global nodes to purge the old data and pull the latest version.

**Should I use get_cdn_bandwidth or get_account_info?**
Use `get_cdn_bandwidth` when you need usage metrics specific to content delivery. Use `get_account_info` for general, top-level account details and profile information.

**I ran a large file process; how do I check its status? Should I use get_pfop_status?**
Yes, you need to run get_pfop_status. This function takes the persistent task ID and reports whether transcoding, resizing, or other operations succeeded, failed, or are still running.

**I updated my bucket settings; how do I verify which domains are associated with it? Do I use get_bucket_domains?**
Use get_bucket_domains. This tool retrieves a list of all CNAMEs and custom endpoints connected to the specified storage bucket, confirming its public access points.

**How do I monitor my SMS messaging usage? Is get_sms_stats the right tool?**
Yep, get_sms_stats gives you a clear breakdown of your messaging service consumption. It tracks metrics like total sends and remaining credits for billing.

**Can I automatically list all buckets in my Qiniu account?**
Yes! Use the `list_buckets` tool. Your agent will retrieve a complete list of all Kodo storage buckets currently configured in your account.

**How do I refresh the CDN cache for a specific URL?**
Use the `refresh_cdn` tool with a list of target URLs. This will trigger the Qiniu Fusion CDN to purge the old cached versions and fetch the latest assets.

**Can I retrieve metadata for a specific file?**
Yes! Use the `get_file_stat` tool with the bucket name and file key. Your agent will return the file size, hash, and MIME type.