Content
# Qiniu Cloud Storage MCP Server
MCP server for uploading files to Qiniu Cloud Storage
## Installation Guide
1. Clone the repository
2. Create and activate a virtual environment:
```bash
python3 -m venv venv
source venv/bin/activate
```
3. Install dependencies:
```bash
pip install -r requirements.txt
```
4. Configure environment variables:
```bash
export QINIU_ACCESS_KEY="your AccessKey"
export QINIU_SECRET_KEY="your SecretKey"
export QINIU_BUCKET_NAME="joemarkdown"
export QINIU_DOMAIN="https://img.t5t6.com"
```
5. Start the server:
```bash
python server.py
```
## Configuration Instructions
1. Copy the example configuration file:
```bash
cp .env.example .env
```
2. Edit the `.env` file and fill in your Qiniu Cloud credentials
3. Do not commit the `.env` file to version control
Example `.env` content:
```
QINIU_ACCESS_KEY=your AccessKey
QINIU_SECRET_KEY=your SecretKey
QINIU_BUCKET_NAME=your bucket name
QINIU_DOMAIN=https://your domain
```
## Usage
1. First run after cloning the project:
```bash
# Enter the project directory
cd qiniu_mcp_server
# Create a virtual environment
python3 -m venv venv
# Activate the environment (Linux/Mac)
source venv/bin/activate
# Install dependencies
pip install -r requirements.txt
# Copy and configure the .env file
cp .env.example .env
nano .env # Edit and fill in your Qiniu Cloud credentials
# Start the server
python server.py
```
2. Daily use:
```bash
cd qiniu_mcp_server
source venv/bin/activate # Activate the environment
python server.py # Start the server
```
3. Example of calling the upload interface:
```python
from mcp import McpClient
client = McpClient("qiniu_mcp")
url = client.use_tool("upload_file", {
"file_path": "/path/to/your/file.jpg"
})
print("文件URL:", url)
```
The service provides the following tools:
- `upload_file(file_path: str) -> str`: Uploads a file and returns a publicly accessible URL
## Trae Integration Configuration
Add the following to Trae's configuration file (replace with actual paths and credentials):
```json
{
"mcpServers": {
"qiniu_mcp": {
"command": "python",
"args": [
"/path/to/qiniu_mcp_server/server.py"
],
"env": {
"QINIU_ACCESS_KEY": "your AccessKey",
"QINIU_SECRET_KEY": "your SecretKey",
"QINIU_BUCKET_NAME": "your bucket name",
"QINIU_DOMAIN": "https://your domain"
}
}
}
}
```
Note: In actual use, please ensure that:
1. Replace `/path/to/` with the actual server path
2. Replace the example values with real credential information
3. Keep your credential information safe
Connection Info
You Might Also Like
markitdown
MarkItDown-MCP is a lightweight server for converting URIs to Markdown.
markitdown
Python tool for converting files and office documents to Markdown.
Filesystem
Node.js MCP Server for filesystem operations with dynamic access control.
TrendRadar
TrendRadar: Your hotspot assistant for real news in just 30 seconds.
mempalace
The highest-scoring AI memory system ever benchmarked. And it's free.
mempalace
The highest-scoring AI memory system ever benchmarked. And it's free.