Qiniu Cloud Storage MCP is a service designed to facilitate file uploads to Qiniu Cloud Storage. It implements the Model Context Protocol (MCP) to provide a standardized way of interacting with Qiniu's storage services, making it straightforward to integrate into your applications.
Clone the repository:
git clone https://github.com/yourusername/qiniu_mcp_server.git
cd qiniu_mcp_server
Create and activate a virtual environment:
python3 -m venv venv
source venv/bin/activate # For Linux/Mac
Install dependencies:
pip install -r requirements.txt
Set up your configuration:
cp .env.example .env
Edit the .env
file with your Qiniu credentials:
QINIU_ACCESS_KEY=YourAccessKey
QINIU_SECRET_KEY=YourSecretKey
QINIU_BUCKET_NAME=YourBucketName
QINIU_DOMAIN=https://your-domain.com
You can start the server using environment variables or the .env
file:
Using environment variables:
export QINIU_ACCESS_KEY="YourAccessKey"
export QINIU_SECRET_KEY="YourSecretKey"
export QINIU_BUCKET_NAME="joemarkdown"
export QINIU_DOMAIN="https://img.t5t6.com"
python server.py
Using .env file:
# After configuring your .env file
python server.py
To use the service in your Python applications:
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 MCP server provides the following tools:
file_path
(str): Path to the file you want to uploadTo integrate with Trae, add the following to your Trae configuration file:
{
"mcpServers": {
"qiniu_mcp": {
"command": "python",
"args": [
"/path/to/qiniu_mcp_server/server.py"
],
"env": {
"QINIU_ACCESS_KEY": "YourAccessKey",
"QINIU_SECRET_KEY": "YourSecretKey",
"QINIU_BUCKET_NAME": "YourBucketName",
"QINIU_DOMAIN": "https://your-domain.com"
}
}
}
}
Be sure to replace all placeholder values with your actual credentials and paths.
There are two ways to add an MCP server to Cursor. The most common way is to add the server globally in the ~/.cursor/mcp.json
file so that it is available in all of your projects.
If you only need the server in a single project, you can add it to the project instead by creating or adding it to the .cursor/mcp.json
file.
To add a global MCP server go to Cursor Settings > MCP and click "Add new global MCP server".
When you click that button the ~/.cursor/mcp.json
file will be opened and you can add your server like this:
{
"mcpServers": {
"cursor-rules-mcp": {
"command": "npx",
"args": [
"-y",
"cursor-rules-mcp"
]
}
}
}
To add an MCP server to a project you can create a new .cursor/mcp.json
file or add it to the existing one. This will look exactly the same as the global MCP server example above.
Once the server is installed, you might need to head back to Settings > MCP and click the refresh button.
The Cursor agent will then be able to see the available tools the added MCP server has available and will call them when it needs to.
You can also explictly ask the agent to use the tool by mentioning the tool name and describing what the function does.