Perform CRUD operations on a WebDAV server with basic authentication.
A Model Context Protocol (MCP) server that enables CRUD operations on a WebDAV endpoint with basic authentication. This server enables Claude Desktop and other MCP clients to interact with WebDAV file systems through natural language commands.
npm install -g webdav-mcp-server
npx webdav-mcp-server
git clone https://github.com/yourusername/webdav-mcp-server.git cd webdav-mcp-server
npm install
npm run build
docker build -t webdav-mcp-server .
docker run -p 3000:3000
-e WEBDAV_ROOT_URL=http://your-webdav-server
-e WEBDAV_ROOT_PATH=/webdav
webdav-mcp-server
docker run -p 3000:3000
-e WEBDAV_ROOT_URL=http://your-webdav-server
-e WEBDAV_ROOT_PATH=/webdav
-e WEBDAV_AUTH_ENABLED=true
-e WEBDAV_USERNAME=admin
-e WEBDAV_PASSWORD=password
-e AUTH_ENABLED=true
-e AUTH_USERNAME=user
-e AUTH_PASSWORD=pass
webdav-mcp-server
Create a .env
file in the root directory with the following variables:
WEBDAV_ROOT_URL=http://localhost:4080 WEBDAV_ROOT_PATH=/webdav
WEBDAV_AUTH_ENABLED=true WEBDAV_USERNAME=admin
WEBDAV_PASSWORD=password
SERVER_PORT=3000
AUTH_ENABLED=true AUTH_USERNAME=user AUTH_PASSWORD=pass AUTH_REALM=MCP WebDAV Server
For enhanced security of the MCP server (not WebDAV connections), you can use bcrypt-encrypted passwords instead of storing them in plain text:
npm run generate-hash -- yourpassword
npx webdav-mcp-generate-hash yourpassword 2. Add the hash to your .env file with the {bcrypt} prefix:
AUTH_PASSWORD={bcrypt}$2y$10$CyLKnUwn9fqqKQFEbxpZFuE9mzWR/x8t6TE7.CgAN0oT8I/5jKJBy
This way, your MCP server password is stored securely. Note that WebDAV passwords must always be in plain text due to protocol requirements.
This mode is ideal for direct integration with Claude Desktop.
webdav-mcp-server
npx webdav-mcp-server
node dist/index.js
This mode enables the server to be accessed over HTTP with Server-Sent Events for real-time communication.
webdav-mcp-server --http
npx webdav-mcp-server --http
node dist/index.js --http
The easiest way to get started with both the WebDAV server and the MCP server is to use Docker Compose:
cd docker docker-compose up -d
This setup uses hacdias/webdav, a simple and standalone WebDAV server written in Go. The configuration for the WebDAV server is stored in webdav_config.yml
, which you can modify to adjust permissions, add users, or change other settings.
The WebDAV server stores all files in a Docker volume called webdav_data
, which persists across container restarts.
The webdav_config.yml
file configures the hacdias/webdav server used in the Docker Compose setup. Here's what you can customize:
address: 0.0.0.0 port: 6060
directory: /data
cors: enabled: true
permissions: CRUD
users:
username: admin password: admin # Plain text password permissions: CRUD # Full permissions
username: reader password: reader permissions: R # Read-only permissions
For more advanced configuration options, refer to the hacdias/webdav documentation.
To run the tests:
npm test
webdav://{path}/list
- List files in a directorywebdav://{path}/content
- Get file contentwebdav://{path}/info
- Get file or directory informationwebdav_create_remote_file
- Create a new file on a remote WebDAV serverwebdav_get_remote_file
- Retrieve content from a file stored on a remote WebDAV serverwebdav_update_remote_file
- Update an existing file on a remote WebDAV serverwebdav_delete_remote_item
- Delete a file or directory from a remote WebDAV serverwebdav_create_remote_directory
- Create a new directory on a remote WebDAV serverwebdav_move_remote_item
- Move or rename a file/directory on a remote WebDAV serverwebdav_copy_remote_item
- Copy a file/directory to a new location on a remote WebDAV serverwebdav_list_remote_directory
- List files and directories on a remote WebDAV serverwebdav_create_remote_file
- Prompt to create a new file on a remote WebDAV serverwebdav_get_remote_file
- Prompt to retrieve content from a remote WebDAV filewebdav_update_remote_file
- Prompt to update a file on a remote WebDAV serverwebdav_delete_remote_item
- Prompt to delete a file/directory from a remote WebDAV serverwebdav_list_remote_directory
- Prompt to list directory contents on a remote WebDAV serverwebdav_create_remote_directory
- Prompt to create a directory on a remote WebDAV serverwebdav_move_remote_item
- Prompt to move/rename a file/directory on a remote WebDAV serverwebdav_copy_remote_item
- Prompt to copy a file/directory on a remote WebDAV serverHere are some example queries you can use in Claude Desktop once the WebDAV MCP server is connected:
You can also use this package programmatically in your own projects:
import { startWebDAVServer } from 'webdav-mcp-server';
// For stdio transport without authentication await startWebDAVServer({ webdavConfig: { rootUrl: 'http://your-webdav-server', rootPath: '/webdav', authEnabled: false }, useHttp: false });
// For stdio transport with WebDAV authentication (password must be plain text) await startWebDAVServer({ webdavConfig: { rootUrl: 'http://your-webdav-server', rootPath: '/webdav', authEnabled: true, username: 'admin', password: 'password' }, useHttp: false });
// With bcrypt hash for MCP server password (HTTP auth only) await startWebDAVServer({ webdavConfig: { rootUrl: 'http://your-webdav-server', rootPath: '/webdav', authEnabled: true, username: 'admin', password: 'password' // WebDAV password must be plain text }, useHttp: true, httpConfig: { port: 3000, auth: { enabled: true, username: 'user', password: '{bcrypt}$2y$10$CyLKnUwn9fqqKQFEbxpZFuE9mzWR/x8t6TE7.CgAN0oT8I/5jKJBy' } } });
// For HTTP transport with MCP authentication await startWebDAVServer({ webdavConfig: { rootUrl: 'http://your-webdav-server', rootPath: '/webdav', authEnabled: true, username: 'admin', password: 'password' }, useHttp: true, httpConfig: { port: 3000, auth: { enabled: true, username: 'user', password: 'pass', realm: 'MCP WebDAV Server' } } });
// For HTTP transport without authentication await startWebDAVServer({ webdavConfig: { rootUrl: 'http://your-webdav-server', rootPath: '/webdav', authEnabled: false }, useHttp: true, httpConfig: { port: 3000, auth: { enabled: false } } });
MIT
File access and search for Box.
MCP server and client for MinIO object storage, configured via environment variables.
An MCP server for interacting with Dropbox files and services.
Uploads local images to Bilibili's image hosting service and returns a permanent HTTPS link.
An MCP server for integrating with Dropbox, allowing clients to interact with files and folders.
A read-only MCP server for IBM Cloud Object Storage, powered by CData. Requires a separate CData JDBC Driver license.
Quickly integrate with Tencent Cloud Storage (COS) and Data Processing (CI) capabilities powered
Manage AWS S3 operations, providing secure access to S3 buckets through pre-signed URLs.
An MCP server for interacting with Dropbox, allowing clients to manage files and folders.
A read-only MCP server by CData that allows LLMs to query live Dropbox data. Requires the CData JDBC Driver for Dropbox.