
模式上下文协议(MCP)服务器,可以让CRUD在具有基本认证的WebDAV端点上操作.
概览
一个模式上下文协议(MCP)服务器,可以让CRUD在一个具有基本认证的WebDAV端点上操作. 这个服务器使克洛德·桌面和其他MCP客户端能够通过自然语言命令与WebDAV文件系统互动. - 与任何具有可选认证的WebDAV服务器连接 - 在文件和目录上执行 CRUD 操作 - 作为 MCP 资源和工具的 Expose 文件操作 - 通过 stdio 传输(用于 Claude 桌面集成) 或 HTTP/SSE 传输 - 安全访问 具有可选的基本认证 - 支持 MCP 服务器认证的 bcrypt加密密码(由于协议限制,WebDAV 密码必须是纯文本) - 连接集成以与 WebDAV 服务器实现更好的性能 - 配置验证使用 Zod - 结构化记录以更好地排除出错 - Node.js 18 或后期 - npm或纱线 - WebDAV服务器(用于实际文件操作) 创建一个.
概述(AI 翻译)
一个模式上下文协议(MCP)服务器,可以让CRUD在一个具有基本认证的WebDAV端点上操作. 这个服务器使克洛德·桌面和其他MCP客户端能够通过自然语言命令与WebDAV文件系统互动.
□ 特性
- 连接任何具有可选认证的WebDAV服务器
- 在文件和目录上执行 CRUD 操作
- 将文件操作作为 MCP 资源和工具
- 通过stdio运输(用于Claude桌面集成)或HTTP/SSE运输运行
- 使用可选基本认证的安全访问
- 支持MCP服务器认证的bcrypt加密密码(由于协议限制,WebDAV密码必须是纯文本)
- 与WebDAV服务器连接,以提高性能
- 使用 Zod 进行配置验证
- 结构化伐木以更好地排除故障
□ 先决条件
- 节点.js 18或以后
- Npm或纱线
- WebDAV服务器(用于实际文件操作)
□ 安装
备选1:从 npm 包安装
备选2:克隆和从源头建造
备选 3: Docker
□ 配置
在根目录中创建一个带有以下变量的 [[T0] 文件:
本页由 AI 翻译,技术细节请以原文为准。
README
以下为原文 README 节选,完整内容请查看原文。
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
# Global installation
npm install -g webdav-mcp-server
# Or with npx
npx webdav-mcp-server
Option 2: Clone and build from source
# Clone repository
git clone https://github.com/yourusername/webdav-mcp-server.git
cd webdav-mcp-server
# Install dependencies
npm install
# Build the application
npm run build
Option 3: Docker
# Build the Docker image
docker build -t webdav-mcp-server .
# Run the container without authentication
docker run -p 3000:3000 \
-e WEBDAV_ROOT_URL=http://your-webdav-server \
-e WEBDAV_ROOT_PATH=/webdav \
webdav-mcp-server
# Run the container 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
Configuration
Create a .env file in the root directory with the following 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 must be plain text (required when auth enabled)
# The WebDAV protocol requires sending the actual password to the server
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
# Auth password for MCP server can be a bcrypt hash (unlike WebDAV passwords)
# AUTH_PASSWORD={bcrypt}$2y$10$CyLKnUwn9fqqKQFEbxpZFuE9mzWR/x8t6TE7.CgAN0oT8I/5jKJBy
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:
安装
npx -y webdav-mcp-server配置
{
"mcpServers": {
"webdav": {
"command": "npx",
"args": [
"-y",
"webdav-mcp-server"
],
"env": {
"WEBDAV_ROOT_URL": "<WEBDAV_ROOT_URL>",
"WEBDAV_ROOT_PATH": "<WEBDAV_ROOT_PATH>",
"WEBDAV_USERNAME": "<WEBDAV_USERNAME>",
"WEBDAV_PASSWORD": "<WEBDAV_PASSWORD>",
"WEBDAV_AUTH_ENABLED": "true|false"
}
}
}
}