Minio MCP Python Implementation
Configuration
View docs{
"mcpServers": {
"ucesys-minio-python-mcp": {
"url": "https://mcp.example.com/mcp",
"headers": {
"SERVER_HOST": "0.0.0.0",
"SERVER_PORT": "8000",
"MINIO_SECURE": "true",
"MINIO_ENDPOINT": "play.min.io",
"MINIO_ACCESS_KEY": "your_access_key",
"MINIO_SECRET_KEY": "your_secret_key",
"ANTHROPIC_API_KEY": "YOUR_API_KEY"
}
}
}
}You can run a MinIO MCP server locally to expose MinIO resources and perform common actions like listing buckets, listing objects, and getting or uploading objects. This enables you to interact with your MinIO data through concise MCP commands and client implementations.
You interact with the MinIO MCP server through a client implementation. The server runs locally and exposes four core tools you can use: ListBuckets, ListObjects, GetObject, and PutObject. The Basic Client provides a straightforward way to perform these actions directly, while the Anthropic Client lets you combine these capabilities with AI-powered interactions to ask questions about your data and retrieve results automatically.
Prerequisites: You need Python and a working runtime to start the MCP server. You also need a functioning MinIO instance or endpoint you want to expose through MCP.
Step 1: Install Python dependencies.
pip install -r requirements.txtStep 2: Run the MCP server locally using Python. You start the server by executing the main server script.
python src/minio_mcp_server/server.pyEnvironment variables you typically configure for MinIO and the MCP server include endpoint details, access keys, and server host/port. Use a .env file in the root directory with entries such as:
# MinIO Configuration
MINIO_ENDPOINT=play.min.io
MINIO_ACCESS_KEY=your_access_key
MINIO_SECRET_KEY=your_secret_key
MINIO_SECURE=true
MINIO_MAX_BUCKETS=5
# Server Configuration
SERVER_HOST=0.0.0.0
SERVER_PORT=8000
# For Anthropic Client (if using)
ANTHROPIC_API_KEY=your_anthropic_api_keyIf you want to start the MCP server as a local process, you can run it directly with Python from a path that points to the server script.
{
"type": "stdio",
"name": "minio_mcp",
"command": "python",
"args": ["path/to/minio_mcp_server/server.py"]
}The MCP server provides these operations to interact with MinIO data:
ListBuckets ā returns a list of all buckets owned by the authenticated sender. Optional: start_after, max_buckets.
ListObjects ā returns objects in a bucket (up to 1,000). Required: bucket_name. Optional: prefix, max_keys.
GetObject ā retrieves an object. Required: bucket_name, object_name.
PutObject ā uploads a file to a bucket using the fput method. Required: bucket_name, object_name, file_path.
The server supports multiple client implementations. Use the Basic Client for direct interactions or the Anthropic Client for AI-assisted workflows that leverage the MCP tools to access MinIO data.
Returns a list of all buckets owned by the authenticated sender of the request, with optional pagination and limit controls.
Returns objects in a bucket, with optional prefix filtering and max results per request.
Retrieves an object from MinIO using bucket and object names.
Uploads a file to a MinIO bucket using the fput method, requiring bucket, object name, and file path.