# UPYUN Developer Platform MCP

> UPYUN Developer Platform MCP Server gives your AI agent direct API access to UPYUN's CDN and cloud storage buckets. You can manage files, list directories, create new assets, and check service capacity without using any command-line tools or local SDKs. It lets your agent interact with your entire file system like a native developer would.

## Overview
- **Category:** cloud-infrastructure
- **Price:** Free
- **Tags:** cdn, file-storage, bucket-management, image-processing, edge-computing

## Description

Yo, this UPYUN Developer Platform MCP Server hooks up your AI agent straight to UPYUN's CDN and cloud storage buckets. You don't need any command-line crap or local SDKs; your agent can treat your whole file system like it's running on a native dev machine. It gives you direct API access, so you can manage files, build assets, list directories, delete stuff, and check service capacity—all without leaving your AI client.

**Managing Your Files**
Your agent handles all the heavy lifting when it comes to file operations. You'll use `list_directory` to pull a full manifest of every file and subfolder within any specified UPYUN directory path, letting you see exactly what's hanging out there. Need to drop new content? Just call `create_text_file`, and your agent uploads a plain text file right into the cloud storage bucket for you. When you’re done with something, remember that `delete_file` lets your agent wipe any specified file from anywhere in the UPYUN bucket structure.

**Getting File Details and Usage Stats**
The server gives you visibility on what's going on under the hood. You can check the specifics of a single file using `get_file_info`; this retrieves metadata like its size or when it was last modified. And if you need to know how much storage space you’ve burned through, just run `get_service_usage`. That pulls and reports the overall usage metrics for your entire UPYUN bucket service.

**How It Works**
It's straightforward: Your agent connects to this server on Vinkius. When it needs to perform any of these actions—like listing a folder or creating a file—it sends the request through the MCP, and we handle the complex API auth behind the scenes. This keeps your credentials safe while giving you that full-blast control over your assets.

## Tools

### create_text_file
Creates and uploads a plain text file to UPYUN's cloud storage bucket.

### delete_file
Deletes any specified file from your UPYUN cloud buckets.

### get_file_info
Retrieves metadata (like size or modification date) for a specific UPYUN file path.

### get_service_usage
Fetches and reports the overall storage usage metrics for your entire UPYUN bucket service.

### list_directory
Lists all files and subfolders contained within a specified UPYUN directory path.

## Prompt Examples

**Prompt:** 
```
List all files present in the root `/` directory of my Upyun bucket.
```

**Response:** 
```
Here is the directory listing for your root path. It contains 3 folders (`images/`, `assets/`, `scripts/`) and 2 files (`index.html`, `style.css`).
```

**Prompt:** 
```
Create a new text file at `/hello.txt` with the content 'Hello from MCP'.
```

**Response:** 
```
I've successfully created the file `/hello.txt` in your UPYUN bucket and uploaded the text string you requested.
```

## Capabilities

### List Directory Contents
The agent lists all files and folders within a specified UPYUN directory path.

### Create Text Files
The agent writes and uploads new text files directly into your UPYUN bucket.

### Delete Files
The agent removes specified files from any location within the UPYUN bucket structure.

### Get File Metadata
The agent retrieves specific details, like size and last modified date, for a single file.

### Check Service Usage
The agent fetches usage statistics to report on how much storage you've consumed in your UPYUN bucket.

## Use Cases

### A new page needs assets uploaded and checked.
The content team writes a new landing page. They ask their agent to first run `list_directory` to check if the 'images' folder exists. If it does, they ask the agent to use `create_text_file` to upload the new CSS file, and finally, they use `get_file_info` on that new file to confirm its size.

### The site is running low on space.
A DevOps engineer notices potential billing issues. They prompt their agent with a request for 'current storage usage.' The agent immediately calls `get_service_usage` and reports the bucket's remaining capacity, preventing overspending.

### Old development assets need to be purged.
A developer finishes a project branch. Instead of manually logging in and deleting files, they instruct their agent: 'Delete all temporary JS files from the /temp/ directory.' The agent executes `delete_file` across the whole group.

### Deploying a quick patch requires a new file.
The frontend team needs to test an emergency fix. They ask their agent to create a placeholder file: 'Create /hotfix.html with content <h1>Test</h1>.' The agent executes `create_text_file`, and the changes are live on the CDN.

## Benefits

- Stop writing deployment scripts. Your agent can use `create_text_file` to deploy new static content or updated HTML files directly to your CDN domains.
- Need a quick asset check? Use the `list_directory` tool to see everything in a bucket's root path just by asking, avoiding manual navigation through a web console.
- Track costs and capacity easily. The `get_service_usage` tool gives you real-time storage metrics so you know exactly when you hit your consumption limits.
- Need to clean up old assets? Use `delete_file` with natural language prompts to remove junk files without needing to manually specify every single file path.
- Get details on any asset instantly. Run `get_file_info` to check a file's size or last modified date before relying on it for production code.

## How It Works

The bottom line is: you provide the keys, and the server lets your AI agent use them to manage files and check stats in your UPYUN buckets.

1. Subscribe to the UPYUN Developer Platform server.
2. Retrieve an Operator Name and Password from your UPYUN API access page.
3. Inject those credentials into your agent. The MCP handles secure authentication, letting your AI client interact with the cloud.

## Frequently Asked Questions

**How do I check how much storage I'm using with `get_service_usage`?**
`get_service_usage` reports your current consumption against your total bucket limit. It gives a summary metric, telling you exactly what percentage of your allotted space is used.

**Can I use `list_directory` to see files inside subfolders?**
Yes, `list_directory` reads the contents of a specified path. You can point it at a folder like `/images/assets/` to list everything within that subdirectory.

**What should I use if I need to add a new asset? Should I use `create_text_file`?**
Yep, `create_text_file` is the tool for uploading assets. You give it the file path and the content string, and it handles writing the text data directly to your bucket.

**Is there a specific way to check if a file exists using `get_file_info`?**
Running `get_file_info` on a specific path will confirm existence. If the file isn't found, the tool returns an error, which your agent uses to let you know it's missing.

**What credentials do I need to use tools like `list_directory`?**
You need an Operator Name and Password from your UPYUN API access page. Plug these credentials into your agent, and the MCP handles the complex authorization process for you.

**How does the system secure file operations when I use `create_text_file`?**
The MCP abstracts away the legacy HMAC-SHA1 Authorization header generation. You don't have to worry about generating these headers; your agent handles it securely.

**If I try to delete a file that doesn’t exist using `delete_file`, what happens?**
The system reports the failure directly. The agent will tell you if the file path is invalid or if the deletion attempt failed, keeping your workflow clear.

**Does `list_directory` handle large buckets efficiently?**
Yes. It lists files and folders in an UPYUN directory structure. The tool lets you check contents without needing to download manual command line clients or process massive data dumps.

**Where do I find my UPYUN Operator details?**
Log into your UPYUN console, click on 'Cloud Storage' -> 'Your Service/Bucket' -> 'Configuration' -> 'Operators'. From there you can copy the operator name and the generated password.

**Does the AI see my files if I connect this?**
The AI uses this MCP to only perform the standard API queries you allow it. Use an Operator with specific folder limits if you wish to restrict directory access.