Content
# Qiniu MCP Server
## Overview
The Model Context Protocol (MCP) Server built on Qiniu Cloud products supports users in accessing Qiniu Cloud storage, intelligent multimedia, live streaming services, etc., within the context of the AI large model client through this MCP Server.
Capabilities:
- Storage
- Get Bucket list
- Get file list in a Bucket
- Upload local files, as well as upload by providing file content
- Read file content
- Get file download link
- For detailed information on accessing Qiniu Cloud storage, please refer to [Using MCP to Access Qiniu Cloud Storage with Large Models](https://developer.qiniu.com/kodo/12914/mcp-aimodel-kodo).
- Intelligent Multimedia
- Image scaling
- Image rounding
- CDN
- Refresh files by link
- Prefetch files by link
- Live Streaming
- Create live streaming space bucket
- Create live stream
- Get live streaming space list
- Get stream list
- Bind push and pull stream domain names
- Get push and pull stream live address
- Get live streaming usage
## Environment Requirements
- Python 3.12 or higher
- uv package manager
If uv is not installed yet, you can install it using the following command:
```bash
# Mac, recommended to install using brew
brew install uv
# Linux & Mac
# 1. Installation
curl -LsSf https://astral.sh/uv/install.sh | sh
# 2. After the installation is complete, please ensure that the installation path of the package (the directory containing the uv and uvx executable files) is added to the system's PATH environment variable.
# Assume the installation package path is /Users/xxx/.local/bin (see installation execution output)
### Temporary Effect (Current Session), execute the following command in the current terminal:
export PATH="/Users/xxx/.local/bin:$PATH"
### Permanent Effect (Recommended), execute the following command in the current terminal:
echo 'export PATH="/Users/xxx/.local/bin:$PATH"' >> ~/.bash_profile
source ~/.bash_profile
# Windows
powershell -ExecutionPolicy ByPass -c "irm https://astral.sh/uv/install.ps1 | iex"
```
For specific installation methods, refer to [uv 安装](https://docs.astral.sh/uv/getting-started/installation/#pypi)
## Using Cline:
Steps:
1. Download the Cline plugin in vscode (after downloading the Cline plugin, the Cline icon will appear in the sidebar)
2. Configure the large model
3. Configure qiniu MCP
1. Click the Cline icon to enter the Cline plugin, and select the MCP Server module
2. Choose installed, click Advanced MCP Settings to configure the MCP Server, refer to the configuration information below
```
{
"mcpServers": {
"qiniu": {
"command": "uvx",
"args": [
"qiniu-mcp-server"
],
"env": {
"QINIU_ACCESS_KEY": "YOUR_ACCESS_KEY",
"QINIU_SECRET_KEY": "YOUR_SECRET_KEY",
"QINIU_REGION_NAME": "YOUR_REGION_NAME",
"QINIU_ENDPOINT_URL": "YOUR_ENDPOINT_URL",
"QINIU_BUCKETS": "YOUR_BUCKET_A,YOUR_BUCKET_B"
},
"disabled": false
}
}
}
```
```
When only using the live broadcast function, two authentication modes are supported:
1. Configure QINIU_ACCESS_KEY/QINIU_SECRET_KEY
{
"mcpServers": {
"qiniu": {
"command": "uvx",
"args": [
"qiniu-mcp-server"
],
"env": {
"QINIU_ACCESS_KEY": "YOUR_ACCESS_KEY",
"QINIU_SECRET_KEY": "YOUR_SECRET_KEY"
},
"disabled": false
}
}
}
2. After obtaining the apikey from the Qiniu live broadcast console, configure QINIU_LIVE_API_KEY
{
"mcpServers": {
"qiniu": {
"command": "uvx",
"args": [
"qiniu-mcp-server"
],
"env": {
"QINIU_LIVE_API_KEY": "YOUR_LIVE_API_KEY"
},
"disabled": false
}
}
}
```
3. Click the link switch of qiniu MCP Server to connect
4. Create a chat window in Cline, at this point we can interact with AI to use qiniu-mcp-server. Here are a few examples of object storage:
- List resource information of qiniu
- List all Buckets in qiniu
- List files in the xxx Bucket of qiniu
- Read the content of the file yyy in the qiniu xxx Bucket
- Crop the image yyy in the qiniu xxx Bucket to a rounded corner of 200 pixels wide
- Refresh the CDN link of qiniu: https://developer.qiniu.com/test.txt
5. Create a chat window in Cline, at this point we can interact with AI to use qiniu-mcp-server. Here are a few examples of the live broadcast system:
- List all live broadcast spaces
- Create a new live broadcast space named mcptest1123
- Create a new stream for mcptest1123 named stream1
- List all streams in the live broadcast space mcptest1123
- Bind the push domain <your-push-domain> and the pull domain <your-play-domain> to mcptest1123
- Get the push and pull addresses corresponding to the live stream stream1 under mcptest1123
- Get the usage of live broadcasts in the last hour
Note:
The MCP Server created in the cursor can directly use the above configuration.
When using in claude, you may encounter the error: Error: spawn uvx ENOENT. Solution: Fill in the absolute path of uvx in the command parameter, e.g., /usr/local/bin/uvx
## Development
1. Clone the repository:
```bash
# Clone the project and enter the directory
```bash
git clone git@github.com:qiniu/qiniu-mcp-server.git
cd qiniu-mcp-server
```
2. Create and activate the virtual environment:
```bash
uv venv
source .venv/bin/activate # Linux/macOS
```
# Or
.venv\Scripts\activate # Windows
```
3. Install dependencies:
```bash
uv pip install -e .
```
4. Configuration
Copy the environment variable template:
```bash
cp .env.example .env
```
Edit the `.env` file and configure the following parameters:
```bash
# S3/Kodo Authentication Information
QINIU_ACCESS_KEY=your_access_key
QINIU_SECRET_KEY=your_secret_key
# Region Information
QINIU_REGION_NAME=your_region
QINIU_ENDPOINT_URL=endpoint_url # eg: https://s3.your_region.qiniucs.com
# Configure buckets, separate multiple buckets with commas, it is recommended to configure a maximum of 20 buckets
QINIU_BUCKETS=bucket1,bucket2,bucket3
```
To extend functionality, first create a new business package directory under the core directory (e.g., storage -> storage), and complete the functional extension in this business package directory. In the `__init__.py` file under the business package directory, define the load function to register business tools or resources, and finally call this load function in the `__init__.py` file under the `core` directory to complete the registration of tools or resources.
```shell
core
├── __init__.py # Load various business tools or resources
└── storage # Storage business directory
├── __init__.py # Load storage tools or resources
├── resource.py # Storage resource extension
├── storage.py # Storage utility class
└── tools.py # Storage tool extension
```
## Testing
### Testing with Model Control Protocol Inspector
It is highly recommended to use [Model Control Protocol Inspector](https://github.com/modelcontextprotocol/inspector) for testing.
```shell
# Node version: v22.4.0
npx @modelcontextprotocol/inspector uv --directory . run qiniu-mcp-server
```
### Local Startup MCP Server Example
1. Start in standard input/output (stdio) mode (default):
```bash
uv --directory . run qiniu-mcp-server
```
2. Start in SSE mode (for web applications):
```bash
uv --directory . run qiniu-mcp-server --transport sse --port 8000
```
Connection Info
You Might Also Like
MarkItDown MCP
Converting files and office documents to Markdown.
Filesystem
Model Context Protocol Servers
Sequential Thinking
Offers a structured approach to dynamic and reflective problem-solving,...
TrendRadar
🎯 Say goodbye to information overload. AI helps you understand news hotspots...
Github
GitHub's official MCP Server
opik
Debug, evaluate, and monitor your LLM applications, RAG systems, and agentic...