基于 dufs API 封装的 MCP (Model Context Protocol) Server,支持文件上传、下载、删除等操作
Config is the same across clients — only the file and path differ.
{
"mcpServers": {
"dufs": {
"env": {
"PORT": "7887",
"DUFS_URL": "http://127.0.0.1:5000",
"MCP_MODE": "http",
"DUFS_PASSWORD": "password",
"DUFS_USERNAME": "admin"
},
"command": "./dufs-mcp-server"
}
}
}Are you the author?
Add this badge to your README to show your security score and help users find safe servers.
基于 dufs API 封装的 MCP (Model Context Protocol) Server,通过 SSE (Server-Sent Events) 提供文件操作服务。
No automated test available for this server. Check the GitHub README for setup instructions.
Five weighted categories — click any category to see the underlying evidence.
No known CVEs.
No package registry to scan.
Be the first to review
Have you used this server?
Share your experience — it helps other developers decide.
Sign in to write a review.
Others in developer-tools
Manage Supabase projects — databases, auth, storage, and edge functions
XcodeBuildMCP provides tools for Xcode project management, simulator management, and app utilities.
A Model Context Protocol (MCP) server and CLI that provides tools for agent use when working on iOS and macOS projects.
Asynchronous coordination layer for AI coding agents: identities, inboxes, searchable threads, and advisory file leases over FastMCP + Git + SQLite
MCP Security Weekly
Get CVE alerts and security updates for Dufs Mcp Server and similar servers.
Start a conversation
Ask a question, share a tip, or report an issue.
Sign in to join the discussion.
基于 dufs API 封装的 MCP (Model Context Protocol) Server,通过 SSE (Server-Sent Events) 提供文件操作服务。
go build -o dufs-mcp-server main.go
go run main.go
所有配置通过环境变量传入,由 MCP 客户端在启动时设置:
export DUFS_URL="http://127.0.0.1:5000"
export DUFS_USERNAME="admin"
export DUFS_PASSWORD="password"
export DUFS_UPLOAD_DIR="/uploads"
export DUFS_ALLOW_INSECURE="false"
export MCP_MODE="stdio" # 或 "http"/"sse"
export PORT="7887" # 仅在 HTTP 模式下使用
DUFS_URL: dufs 服务器的地址(必需)DUFS_USERNAME: 用户名(如果 dufs 需要认证)DUFS_PASSWORD: 密码(如果 dufs 需要认证)DUFS_UPLOAD_DIR: 默认上传目录DUFS_ALLOW_INSECURE: 是否允许不安全的连接(true/false)MCP_MODE: 运行模式,可选值:
stdio (默认): 标准 MCP 协议,通过 stdin/stdout 通信http 或 sse: HTTP/SSE 模式,通过 HTTP 端点通信PORT: MCP server 监听端口(仅在 HTTP 模式下使用,默认 7887)这是标准的 MCP server 运行方式,通过 stdin/stdout 进行 JSON-RPC 通信。这是默认模式,也是 MCP 客户端推荐的方式。
# 直接运行(stdio 模式)
DUFS_URL=http://127.0.0.1:5000 DUFS_USERNAME=admin DUFS_PASSWORD=pass ./dufs-mcp-server
# 或者明确指定模式
MCP_MODE=stdio DUFS_URL=http://127.0.0.1:5000 ./dufs-mcp-server
通过 HTTP 端点提供服务,支持 SSE(Server-Sent Events)和 REST API。
# HTTP 模式
MCP_MODE=http DUFS_URL=http://127.0.0.1:5000 PORT=7887 ./dufs-mcp-server
GET /sse - Server-Sent Events 端点,用于 MCP 协议通信POST /message - 直接发送 JSON-RPC 消息(用于测试)批量上传文件并立即返回 job_id,上传任务在后台异步执行。即使只上传单个文件也推荐使用该工具(传入一个文件即可),可以避免前端等待造成的超时。
特性:
files 数组中的每一项都包含 local_path,可选 remote_pathremote_path,自动使用配置的 upload_dir(默认为 uploads)+ 当日目录(YYYYMMDD)+ 文件名job_id 与任务状态,不会阻塞 Cursor{
"name": "dufs_upload_batch",
"arguments": {
"files": [
{
"local_path": "/path/to/a.zip",
"remote_path": "dufs-mcp-server/a.zip"
},
{
"local_path": "/path/to/b.zip"
}
]
}
}
返回示例:
{
"success": true,
"job_id": "job-1732532145123456789",
"status": "pending",
"task_count": 2
}
单文件上传时同样把 files 数组设置为一个元素即可。
查询批量上传任务的状态与每个文件的执行结果,便于在任务完成后获取远程路径、HTTP 状态码以及错误详情。
{
"name": "dufs_upload_status",
"arguments": {
"job_id": "job-1732532145123456789"
}
}
返回数据包含整体状态(pending / running / completed / failed)以及每个文件的上传结果、耗时、错误信息等,适合在批量上传后再查询目录结构或结果。
从 dufs 服务器下载文件
{
"name": "dufs_download",
"arguments": {
"remote_path": "/uploads/file.txt",
"local_path": "/path/to/save/file.txt"
}
}
删除文件或目录
{
"name": "dufs_delete",
"arguments": {
"path": "/uploads/file.txt"
}
}
列出目录内容
{
"name": "dufs_list",
"arguments": {
"path": "/",
"query": "*.txt",
"format": "json"
}
}
创建目录
{
"name": "dufs_create_dir",
"arguments": {
"path": "/new-folder"
}
}
移动或重命名文件/目录
{
"name": "dufs_move",
"arguments": {
"source": "/old-path/file.txt",
"destination": "/new-path/file.txt"
}
}
获取文件的 SHA256 哈希值
{
"name": "dufs_get_hash",
"arguments": {
"path": "/uploads/file.txt"
}
}
下载整个文件夹为 zip
{
"name": "dufs_download_folder",
"arguments": {
"remote_path": "/uploads/folder",
"local_path": "/path/to/save/folder.zip"
}
}
检查 dufs 服务器健康状态
{
"name": "dufs_health",
"arguments": {}
}
# 发送初始化请求
curl -X POST http://localhost:8080/message \
-H "Content-Type: application/json" \
-d '{
"jsonr
... [View full README on GitHub](https://github.com/hello--world/dufs-mcp-server#readme)