ZFile MCP Server
This server does not currently have a deployable release on Glama. Follow the repository's setup instructions to install and configure it for your MCP client, including any required credentials and local dependencies.
✨ Features
📁 List Files - Browse directories in ZFile
📤 Upload Files - Get upload URLs (no base64, saves context tokens)
📤 Batch Upload - Get multiple upload URLs at once
🧩 Chunked Upload - Large file upload with auto-merge (Cloudflare-friendly)
🔗 Direct Links - Generate permanent direct download links (single or batch)
🔗 Short Links - Generate temporary short links (31 days)
🔐 Secure - Auto-generated access token, credentials stored server-side
🌐 Dual Protocol - SSE (Kiro, Claude Desktop) + Streamable HTTP (Gemini CLI)
Related MCP server: pshare-share-mcp
🏗️ Architecture
┌─────────────────────────┐ ┌─────────────────────────┐ ┌─────────┐
│ MCP Client (Kiro/Claude)│ SSE/ │ MCP Server (Docker) │ API │ ZFile │
│ ┌───────────────────┐ │ HTTP │ ┌─────────────────┐ │ ──────► │ │
│ │ Only ACCESS_TOKEN │ │ ──────► │ │ ZFile credentials│ │ │ │
│ └───────────────────┘ │ Token │ │ stored here │ │ │ │
└─────────────────────────┘ │ └─────────────────┘ │ └─────────┘
└─────────────────────────┘Security Model:
Client only stores
ACCESS_TOKEN(for MCP authentication)Server stores ZFile credentials via environment variables
ZFile credentials are never exposed to clients
🚀 Quick Start
docker run -d --name zfile-mcp -p 8092:8092 \
-e ZFILE_URL=https://your-zfile.com \
-e ZFILE_USER=admin \
-e ZFILE_PASS=password \
-v ./data:/data \
neosun/zfile-mcp-server:latestGet your ACCESS_TOKEN:
docker logs zfile-mcp 2>&1 | grep ACCESS_TOKEN📦 Installation
Option 1: Docker Hub (Recommended)
docker run -d \
--name zfile-mcp \
-p 8092:8092 \
-e ZFILE_URL=https://your-zfile-server.com \
-e ZFILE_USER=your_username \
-e ZFILE_PASS=your_password \
-e ZFILE_STORAGE_KEY=1 \
-v ./data:/data \
neosun/zfile-mcp-server:latestOption 2: Docker Compose
Create docker-compose.yml:
services:
zfile-mcp:
image: neosun/zfile-mcp-server:latest
container_name: zfile-mcp
restart: always
ports:
- '8092:8092'
environment:
- ZFILE_URL=https://your-zfile-server.com
- ZFILE_USER=your_username
- ZFILE_PASS=your_password
- ZFILE_STORAGE_KEY=1
# - ACCESS_TOKEN= # auto-generated if not set
# - CHUNK_SIZE_MB=10 # chunk size in MB for large file upload
# - MCP_SERVER_URL= # optional: external URL override for chunked upload callbacks
volumes:
- ./data:/data
extra_hosts:
- "host.docker.internal:host-gateway"docker compose up -dOption 3: Run from Source
Requirements:
Python 3.11+
pip
git clone https://github.com/neosun100/zfile-mcp-server.git
cd zfile-mcp-server
# Install dependencies
pip install -r requirements.txt
# Set environment variables
export ZFILE_URL=https://your-zfile.com
export ZFILE_USER=admin
export ZFILE_PASS=password
# Run
python server.py⚙️ Configuration
Environment Variables
Variable | Required | Description | Default |
| ✅ | ZFile server URL (e.g., | - |
| ✅ | ZFile admin username | - |
| ✅ | ZFile admin password | - |
| ❌ | Storage source key |
|
| ❌ | Custom access token (auto-generated if not set) | Auto |
| ❌ | Chunk size in MB for large file upload |
|
| ❌ | External URL override for chunked upload callbacks | Auto |
MCP Client Configuration
Kiro CLI
Add to ~/.kiro/settings/mcp.json:
{
"mcpServers": {
"zfile": {
"type": "sse",
"url": "https://your-server.com/mcp/sse?token=YOUR_ACCESS_TOKEN",
"headers": {},
"autoApprove": ["*"],
"disabled": false
}
}
}Claude Desktop
Add to Claude Desktop config:
{
"mcpServers": {
"zfile": {
"type": "sse",
"url": "https://your-server.com/mcp/sse?token=YOUR_ACCESS_TOKEN"
}
}
}Google Gemini CLI
Add to Gemini CLI config (Streamable HTTP mode):
{
"mcpServers": {
"zfile": {
"type": "streamableHttp",
"url": "https://your-server.com/mcp?token=YOUR_ACCESS_TOKEN"
}
}
}🌐 Reverse Proxy Configuration
Option A: Cloudflare Tunnel (Recommended)
Cloudflare Tunnel provides secure access without exposing ports. Configure in Cloudflare Dashboard:
Public hostname | Service |
|
|
|
|
Path-based routing in Cloudflare Zero Trust:
Go to Zero Trust → Networks → Tunnels
Select your tunnel → Public Hostname
Add two entries:
Path:
/mcp/*→ Service:http://localhost:8092Path: (empty) → Service:
http://localhost:8090
Option B: Nginx Reverse Proxy
server {
listen 443 ssl;
server_name zfile.example.com;
ssl_certificate /path/to/cert.pem;
ssl_certificate_key /path/to/key.pem;
# MCP Server (SSE requires special handling)
location /mcp/ {
proxy_pass http://127.0.0.1:8092/;
proxy_http_version 1.1;
proxy_set_header Host $host;
proxy_set_header X-Real-IP $remote_addr;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
proxy_set_header X-Forwarded-Proto $scheme;
proxy_set_header X-Forwarded-Host $host;
proxy_set_header Connection '';
proxy_buffering off;
proxy_cache off;
chunked_transfer_encoding off;
proxy_read_timeout 86400s;
}
# ZFile main application
location / {
proxy_pass http://127.0.0.1:8090/;
proxy_set_header Host $host;
proxy_set_header X-Real-IP $remote_addr;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
proxy_set_header X-Forwarded-Proto $scheme;
client_max_body_size 10G;
}
}Option C: Caddy
zfile.example.com {
handle_path /mcp/* {
reverse_proxy localhost:8092
}
handle {
reverse_proxy localhost:8090
}
}🛠️ Available Tools
Tool | Description |
| List files in a directory |
| Get upload URL for a file (returns URL + direct link) |
| Get upload URLs for multiple files |
| Initialize chunked upload for large files (>10MB, Cloudflare-friendly) |
| Check status of a chunked upload |
| Generate permanent direct link for a file |
| Generate direct links for multiple files |
| Generate 31-day short link |
Usage Examples
List files:
List all files in /documentsUpload a file:
I need to upload app.apk to /releases folderGenerate direct link:
Generate a direct link for /report.pdfBatch operations:
Generate direct links for all PDF files in /documentsWhy URL-based Upload?
Base64 upload consumes context tokens:
1MB file → ~350K tokens
5MB file → ~1.75M tokens (exceeds most context limits!)
URL-based upload: 0 tokens - client uploads directly to ZFile.
📁 Project Structure
zfile-mcp-server/
├── server.py # Main MCP server implementation
├── Dockerfile # Docker image definition
├── docker-compose.yml # Docker Compose configuration
├── requirements.txt # Python dependencies
├── .env.example # Environment variables template
├── README.md # English documentation
├── README_CN.md # 简体中文文档
├── README_TW.md # 繁體中文文檔
├── README_JP.md # 日本語ドキュメント
├── CHANGELOG.md # Version history
├── LICENSE # MIT License
└── .gitignore # Git ignore rules🔧 Tech Stack
Runtime: Python 3.11
Framework: FastAPI + Uvicorn
Protocol: MCP (Model Context Protocol) over SSE + Streamable HTTP
HTTP Client: httpx
Container: Docker
🤝 Contributing
Contributions are welcome! Please feel free to submit a Pull Request.
Fork the repository
Create your feature branch (
git checkout -b feature/amazing-feature)Commit your changes (
git commit -m 'Add some amazing feature')Push to the branch (
git push origin feature/amazing-feature)Open a Pull Request
📋 Changelog
See CHANGELOG.md for version history.
📄 License
This project is licensed under the MIT License - see the LICENSE file for details.
⭐ Star History
📱 Follow

Tool Schema Changelog
Recent tool additions, removals, and schema changes observed during successful MCP inspections.
Loading tool schema changelog…
This server cannot be deployed
Maintenance
Related MCP Connectors
Connect AnyFile to AI clients to manage files, share links, file requests, and analytics.
File uploads for AI agents. Upload, list, and manage files. No signup required.
Temporary file relay for AI agents: upload a generated file, get an expiring download link.
Cloud file relay: chunked uploads, folders, share links, inline text reads, ZIP packing.
Related MCP Servers
- AlicenseNot gradedqualityDmaintenanceEnables AI agents like Claude Code to directly control a ZSpace NAS with 90 tools for file management, media, notes, cloud disks, and more.42MIT
- AlicenseAqualityDmaintenanceEnables AI assistants to upload files and folders to a Pshare instance and generate share links, with support for optional password, TTL, and chunked uploads for large files.1ISC
- AlicenseNot gradedqualityBmaintenanceEnables LibreChat agents to manage per-user private files, persistent documentation, RAG indexing and semantic search, and publish files via secure opaque public links.MIT
- AlicenseNot gradedqualityBmaintenanceEnables AI agents to securely access and manage Nextcloud files, edit music tags, and handle archives using the user's own credentials.AGPL 3.0