The WebDAV MCP Server provides a bridge between Model Context Protocol (MCP) clients (like Claude Desktop) and WebDAV file systems, allowing you to manage remote files through natural language commands. It enables CRUD operations on WebDAV endpoints with authentication support.
# Global installation
npm install -g webdav-mcp-server
# Or with npx (no installation required)
npx webdav-mcp-server
# Run without authentication
docker run -p 3000:3000 \
-e WEBDAV_ROOT_URL=http://your-webdav-server \
-e WEBDAV_ROOT_PATH=/webdav \
webdav-mcp-server
# Run with authentication for both WebDAV and 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
The easiest way to get started with both WebDAV and MCP servers:
# Start both servers
cd docker
docker-compose up -d
# This starts:
# - hacdias/webdav server on port 4080 (username: admin, password: admin)
# - MCP server on port 3000 (username: user, password: pass)
Create a .env
file in the root directory with these variables:
# WebDAV configuration
WEBDAV_ROOT_URL=http://localhost:4080
WEBDAV_ROOT_PATH=/webdav
# WebDAV authentication (optional)
WEBDAV_AUTH_ENABLED=true
WEBDAV_USERNAME=admin
WEBDAV_PASSWORD=password
# Server configuration (for HTTP mode)
SERVER_PORT=3000
# Authentication configuration for MCP server (optional)
AUTH_ENABLED=true
AUTH_USERNAME=user
AUTH_PASSWORD=pass
AUTH_REALM=MCP WebDAV Server
For enhanced security, you can use bcrypt-encrypted passwords for MCP server authentication:
# Generate a bcrypt hash
npm run generate-hash -- yourpassword
# Or with npx
npx webdav-mcp-generate-hash yourpassword
Then add the hash to your .env
file with the {bcrypt}
prefix:
AUTH_PASSWORD={bcrypt}$2y$10$CyLKnUwn9fqqKQFEbxpZFuE9mzWR/x8t6TE7.CgAN0oT8I/5jKJBy
Note that WebDAV passwords must remain in plain text due to protocol requirements.
# If installed globally
webdav-mcp-server
# If using npx
npx webdav-mcp-server
# If built from source
node dist/index.js
# If installed globally
webdav-mcp-server --http
# If using npx
npx webdav-mcp-server --http
# If built from source
node dist/index.js --http
claude_desktop_config.json
){
"mcpServers": {
"webdav": {
"command": "npx",
"args": [
"-y",
"webdav-mcp-server"
],
"env": {
"WEBDAV_ROOT_URL": "",
"WEBDAV_ROOT_PATH": "",
"WEBDAV_USERNAME": "",
"WEBDAV_PASSWORD": "",
"WEBDAV_AUTH_ENABLED": "true|false"
}
}
}
}
setup.sh
on mac/linux or setup.bat
on windowsclaude_desktop_config.json
){
"mcpServers": {
"webdav": {
"command": "node",
"args": [
"/dist/index.js"
],
"env": {
"WEBDAV_ROOT_URL": "",
"WEBDAV_ROOT_PATH": "",
"WEBDAV_USERNAME": "",
"WEBDAV_PASSWORD": "",
"WEBDAV_AUTH_ENABLED": "true|false"
}
}
}
}
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 filewebdav_get_remote_file
- Retrieve file contentwebdav_update_remote_file
- Update an existing filewebdav_delete_remote_item
- Delete a file or directorywebdav_create_remote_directory
- Create a new directorywebdav_move_remote_item
- Move or rename a file/directorywebdav_copy_remote_item
- Copy a file/directorywebdav_list_remote_directory
- List files and directoriesOnce connected, you can use natural language to manage files:
There are two ways to add an MCP server to Cursor. The most common way is to add the server globally in the ~/.cursor/mcp.json
file so that it is available in all of your projects.
If you only need the server in a single project, you can add it to the project instead by creating or adding it to the .cursor/mcp.json
file.
To add a global MCP server go to Cursor Settings > MCP and click "Add new global MCP server".
When you click that button the ~/.cursor/mcp.json
file will be opened and you can add your server like this:
{
"mcpServers": {
"cursor-rules-mcp": {
"command": "npx",
"args": [
"-y",
"cursor-rules-mcp"
]
}
}
}
To add an MCP server to a project you can create a new .cursor/mcp.json
file or add it to the existing one. This will look exactly the same as the global MCP server example above.
Once the server is installed, you might need to head back to Settings > MCP and click the refresh button.
The Cursor agent will then be able to see the available tools the added MCP server has available and will call them when it needs to.
You can also explictly ask the agent to use the tool by mentioning the tool name and describing what the function does.