Qiniu Cloud Storage MCP server

Provides a bridge to Qiniu Cloud Storage services for uploading files and retrieving public URLs through authenticated API calls
Back to servers
Provider
Joe Sun
Release date
Apr 22, 2025
Language
Python
Stats
21 stars

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.

Installation

Prerequisites

  • Python 3.x
  • Qiniu Cloud account with Access Key and Secret Key

Step-by-Step Installation

  1. Clone the repository:

    git clone https://github.com/yourusername/qiniu_mcp_server.git
    cd qiniu_mcp_server
    
  2. Create and activate a virtual environment:

    python3 -m venv venv
    source venv/bin/activate  # For Linux/Mac
    
  3. Install dependencies:

    pip install -r requirements.txt
    
  4. Set up your configuration:

    cp .env.example .env
    
  5. 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
    

Usage

Starting the Server

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

Client Integration

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)

Available Tools

The MCP server provides the following tools:

  • upload_file: Uploads a file to Qiniu Cloud Storage and returns a public access URL
    • Parameters:
      • file_path (str): Path to the file you want to upload

Trae Integration

To 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.

How to add this MCP server to Cursor

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.

Adding an MCP server to Cursor globally

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"
            ]
        }
    }
}

Adding an MCP server to a project

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.

How to use the MCP server

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.

Want to 10x your AI skills?

Get a free account and learn to code + market your apps using AI (with or without vibes!).

Nah, maybe later