Get the FREE Ultimate OpenClaw Setup Guide →

dufs

基于 dufs API 封装的 MCP (Model Context Protocol) Server,支持文件上传、下载、删除等操作

Installation
Run this command in your terminal to add the MCP server to Claude Code.
Run in terminal:
Command
claude mcp add --transport stdio hello--world-dufs-mcp-server ./dufs-mcp-server \
  --env DUFS_URL="http://127.0.0.1:5000" \
  --env MCP_MODE="stdio" \
  --env DUFS_PASSWORD="password" \
  --env DUFS_USERNAME="admin" \
  --env DUFS_UPLOAD_DIR="/uploads" \
  --env DUFS_ALLOW_INSECURE="false"

How to use

This MCP server wraps the Dufs API and exposes file operations via the MCP protocol. It supports standard stdio-based JSON-RPC communication as the default (MCP_MODE=stdio) and can also run in HTTP/SSE mode (MCP_MODE=http or sse) for HTTP endpoints. The server provides tools to upload, download, delete, list, create directories, move/rename, hash, and download folders as zip, plus a health check and optional Basic Auth integration. In stdio mode, clients communicate over stdin/stdout using JSON-RPC; in HTTP/SSE mode, clients interact via HTTP endpoints and SSE channels. The included tools expose reusable RPC calls such as dufs_upload_batch, dufs_upload_status, dufs_download, dufs_delete, dufs_list, dufs_create_dir, dufs_move, dufs_get_hash, dufs_download_folder, and dufs_health, each documented with expected arguments. Use the tools through the MCP client (e.g., Cursor) or via the provided HTTP endpoints when running in http/sse mode.

How to install

Prerequisites:

  • Go 1.21+ installed on your system
  • Git (optional, to clone the repository)
  • A Dufs server reachable at the configured DUFS_URL

Installation steps:

  1. Clone the MCP server repository or navigate to the project folder.
  2. Build the binary: go build -o dufs-mcp-server main.go
  3. Run the server in stdio mode by configuring environment variables and starting the binary. Example: 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" # default ./dufs-mcp-server

Alternatively, run in HTTP/SSE mode: export MCP_MODE="http" export PORT="7887" ./dufs-mcp-server

Notes:

  • If you set MCP_MODE to http or sse, the server exposes HTTP endpoints (e.g., /message for JSON-RPC and /sse for SSE).
  • In stdio mode, no API endpoint is exposed; communication is via stdin/stdout.
  • Ensure the DUFS_URL and credentials match your Dufs server configuration for authentication and access control.

Additional notes

Tips and common issues:

  • Ensure DUFS_URL is reachable from the MCP server host. Network or TLS issues may require DUFS_ALLOW_INSECURE=true if using self-signed certificates.
  • When using stdio mode, the MCP client must manage JSON-RPC framing over the process's standard input/output.
  • In HTTP mode, the PORT variable controls the listening port (default 7887). If running behind a reverse proxy, adjust host/port accordingly.
  • If DUFS_UPLOAD_DIR is not set, the server may use a default directory; explicitly set it to avoid uploads landing in unintended locations.
  • If Basic Auth is required by your Dufs server, provide DUFS_USERNAME and DUFS_PASSWORD; otherwise leave them unset or empty.
  • The MCP configuration supports setting environment variables for sensitive information; avoid hardcoding credentials in a shared config file.

Related MCP Servers

Sponsor this space

Reach thousands of developers