Content
# Qiniu Cloud Storage MCP Service
MCP service 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 service:
```bash
python server.py
```
## Configuration Instructions
1. Copy the example configuration file:
```bash
cp .env.example .env
```
2. Edit the `.env` file to 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 .env file
cp .env.example .env
nano .env # Edit and fill in your Qiniu Cloud credentials
# Start the service
python server.py
```
2. Daily usage:
```bash
cd qiniu_mcp_server
source venv/bin/activate # Activate the environment
python server.py # Start the service
```
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("File URL:", url)
```
The service provides the following tools:
- `upload_file(file_path: str) -> str`: Upload a file and return a publicly accessible URL
## Trae Integration Configuration
Add the following content 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: Ensure that:
1. Replace `/path/to/` with the actual server path
2. Use real credentials to replace the example values
3. Keep credentials secure
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.
firecrawl
Firecrawl MCP Server enables web scraping, crawling, and content extraction.
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.