WebDAV MCP server

Enables interaction with WebDAV file systems through natural language commands, providing complete CRUD operations for files and directories with support for both local and remote access.
Back to servers
Provider
Laub Plus Co
Release date
Mar 19, 2025
Language
TypeScript
Stats
2 stars

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.

Installation Options

Using NPM Package

# Global installation
npm install -g webdav-mcp-server

# Or with npx (no installation required)
npx webdav-mcp-server

Using Docker

# 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

Quick Start with Docker Compose

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)

Configuration

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

Secure Password Storage for MCP 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.

Running the Server

Stdio Transport (for Claude Desktop)

# If installed globally
webdav-mcp-server

# If using npx
npx webdav-mcp-server

# If built from source
node dist/index.js

HTTP/SSE Transport

# If installed globally
webdav-mcp-server --http

# If using npx
npx webdav-mcp-server --http

# If built from source
node dist/index.js --http

Integrating with Claude Desktop

Using npx

  1. Open Claude Desktop settings and edit configuration (claude_desktop_config.json)
  2. Add:
{
    "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"
            }
        }
    }
}

Using node and local build

  1. Clone the repository and run setup.sh on mac/linux or setup.bat on windows
  2. Open Claude Desktop settings and edit configuration (claude_desktop_config.json)
  3. Add:
{
    "mcpServers": {
        "webdav": {
            "command": "node",
            "args": [
                "/dist/index.js"
            ],
            "env": {
                "WEBDAV_ROOT_URL": "",
                "WEBDAV_ROOT_PATH": "",
                "WEBDAV_USERNAME": "",
                "WEBDAV_PASSWORD": "",
                "WEBDAV_AUTH_ENABLED": "true|false"
            }
        }
    }
}

Available MCP Resources and Tools

Resources

  • webdav://{path}/list - List files in a directory
  • webdav://{path}/content - Get file content
  • webdav://{path}/info - Get file or directory information

Tools

  • webdav_create_remote_file - Create a new file
  • webdav_get_remote_file - Retrieve file content
  • webdav_update_remote_file - Update an existing file
  • webdav_delete_remote_item - Delete a file or directory
  • webdav_create_remote_directory - Create a new directory
  • webdav_move_remote_item - Move or rename a file/directory
  • webdav_copy_remote_item - Copy a file/directory
  • webdav_list_remote_directory - List files and directories

Example Queries for Claude

Once connected, you can use natural language to manage files:

  • "List files on my remote WebDAV server"
  • "Create a new text file called notes.txt with the following content: Hello World"
  • "Get the content of document.txt from my remote WebDAV server"
  • "Update config.json with this new configuration"
  • "Create a directory called projects"
  • "Copy report.docx to a backup location"
  • "Move old_name.txt to new_name.txt"
  • "Delete temp.txt from my remote WebDAV server"

How to add this MCP server to Cursor

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.

Adding an MCP server to Cursor globally

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"
            ]
        }
    }
}

Adding an MCP server to a project

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.

How to use the MCP server

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.

Want to 10x your AI skills?

Get a free account and learn to code + market your apps using AI (with or without vibes!).

Nah, maybe later