WebDAV MCP Server
remote-capable server
The server can be hosted and run remotely because it primarily relies on remote services or has no dependency on the local environment.
Integrations
Supports configuration through .env files to set WebDAV connection parameters, authentication credentials, and server options.
Provides containerized deployment of the MCP server with configurable environment variables for WebDAV connectivity and authentication.
Offers programmatic usage within Node.js applications through an importable API for custom MCP server implementations.
WebDAV MCP Server
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.
Features
- Connect to any WebDAV server with optional authentication
- Perform CRUD operations on files and directories
- Expose file operations as MCP resources and tools
- Run via stdio transport (for Claude Desktop integration) or HTTP/SSE transport
- Secure access with optional basic authentication
- Support for bcrypt-encrypted passwords for MCP server authentication (WebDAV passwords must be plain text due to protocol limitations)
- Connection pooling for better performance with WebDAV servers
- Configuration validation using Zod
- Structured logging for better troubleshooting
Prerequisites
- Node.js 18 or later
- npm or yarn
- WebDAV server (for actual file operations)
Installation
Option 1: Install from npm package
Option 2: Clone and build from source
Option 3: Docker
Configuration
Create a .env
file in the root directory with the following variables:
Encrypted Passwords for MCP Server Authentication
For enhanced security of the MCP server (not WebDAV connections), you can use bcrypt-encrypted passwords instead of storing them in plain text:
- Generate a bcrypt hash:Copy
- Add the hash to your .env file with the {bcrypt} prefix:Copy
This way, your MCP server password is stored securely. Note that WebDAV passwords must always be in plain text due to protocol requirements.
Usage
Running with stdio transport
This mode is ideal for direct integration with Claude Desktop.
Running with HTTP/SSE transport
This mode enables the server to be accessed over HTTP with Server-Sent Events for real-time communication.
Quick Start with Docker Compose
The easiest way to get started with both the WebDAV server and the MCP server is to use Docker Compose:
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.
WebDAV Server Configuration
The webdav_config.yml
file configures the hacdias/webdav server used in the Docker Compose setup. Here's what you can customize:
For more advanced configuration options, refer to the hacdias/webdav documentation.
Testing
To run the tests:
Integrating with Claude Desktop
- Ensure the MCP feature is enabled in Claude Desktop
Available MCP Resources
webdav://{path}/list
- List files in a directorywebdav://{path}/content
- Get file contentwebdav://{path}/info
- Get file or directory information
Available MCP Tools
webdav_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 server
Available MCP Prompts
webdav_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 server
Example Queries in Claude
Here are some example queries you can use in Claude Desktop once the WebDAV MCP server is connected:
- "List files on my remote WebDAV server"
- "Create a new text file called notes.txt on my remote WebDAV server with the following content: Hello World"
- "Get the content of document.txt from my remote WebDAV server"
- "Update config.json on my remote WebDAV server with this new configuration"
- "Create a directory called projects on my remote WebDAV server"
- "Copy report.docx to a backup location on my remote WebDAV server"
- "Move the file old_name.txt to new_name.txt on my remote WebDAV server"
- "Delete temp.txt from my remote WebDAV server"
Programmatic Usage
You can also use this package programmatically in your own projects:
License
MIT
This server cannot be installed
A Model Context Protocol server that enables Claude Desktop and other MCP clients to interact with WebDAV file systems through natural language commands for CRUD operations.