Token导航 LogoToken导航TokenDH.com
WebDAV MCP Server logo
运维云端stdio官方级别未说明来源级核验

WebDAV MCP Server

MCP Server

webdav-mcp-server

一个支持通过自然语言命令对WebDAV端点进行CRUD操作的模型上下文协议(MCP)服务器,适用于文件系统管理和Claude Desktop集成。

工具数

8

提示词数

0

GitHub Stars

17

资源数

0
自然语言处理TypeScriptClaudeCRUD操作Claude DesktopClaude

安装说明

本站只整理中文说明和来源信息,不托管安装包,也不代用户安装。

作者 / 组织

LaubPlusCo

提供方

LaubPlusCo

最后核验

2026/5/17 20:19

运行时

Node.js

快速接入

先看主来源和安装命令,再打开仓库或文档;下面只保留这个条目的关键接入事实。

命令预览

npx webdav-mcp-server

详细介绍

WebDAV MCP服务器

一种模型上下文协议(MCP)服务器,通过基本身份验证在WebDAV端点上启用CRUD操作。此服务器使Claude Desktop和其他MCP客户端能够通过自然语言命令与WebDAV文件系统进行交互。

特性

  • 使用可选身份验证连接到任何WebDAV服务器
  • 对文件和目录执行CRUD操作
  • 将文件操作作为MCP资源和工具公开
  • 通过stdio传输(用于Claude Desktop集成)或HTTP/SSE传输运行
  • 使用可选的基本身份验证进行安全访问
  • 支持MCP服务器身份验证的bcrypt加密密码(由于协议限制,WebDAV密码必须是纯文本)
  • 连接池可提高WebDAV服务器的性能
  • 使用Zod进行配置验证
  • 结构化日志记录,以便更好地进行故障排除

先决条件

  • Node.js 18或更高版本
  • npm或纱线
  • WebDAV服务器(用于实际文件操作)

安装

选项1:从npm包安装

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

# Or with npx
npx webdav-mcp-server

选项2:从源代码克隆和构建

# 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

选项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

配置

创建一个 .env 根目录中的文件,包含以下变量:

# 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

MCP服务器身份验证的加密密码

为了增强MCP服务器的安全性(不是WebDAV连接),您可以使用bcrypt加密的密码,而不是以纯文本形式存储:

  1. 生成bcrypt哈希:
   # Using the built-in utility
   npm run generate-hash -- yourpassword

   # Or with npx
   npx webdav-mcp-generate-hash yourpassword
  1. 使用{bcrypt}前缀将哈希添加到.env文件中:
   AUTH_PASSWORD={bcrypt}$2y$10$CyLKnUwn9fqqKQFEbxpZFuE9mzWR/x8t6TE7.CgAN0oT8I/5jKJBy

这样,您的MCP服务器密码就可以安全地存储。请注意,由于协议要求,WebDAV密码必须始终为纯文本。

用法

使用stdio传输运行

此模式非常适合与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传输运行

此模式允许通过HTTP访问服务器,并使用服务器发送事件进行实时通信。

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

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

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

Docker Compose快速入门

开始使用WebDAV服务器和MCP服务器的最简单方法是使用Docker Compose:

# Start both WebDAV and MCP servers
cd docker
docker-compose up -d

# This will start:
# - hacdias/webdav server on port 4080 (username: admin, password: admin)
# - MCP server on port 3000 (username: user, password: pass)

此设置使用 哈迪亚斯/韦伯,一个用Go编写的简单而独立的WebDAV服务器。WebDAV服务器的配置存储在 webdav_config.yml,您可以对其进行修改以调整权限、添加用户或更改其他设置。

WebDAV服务器将所有文件存储在名为的Docker卷中 webdav_data,这种情况在容器重新启动时仍然存在。

WebDAV服务器配置

webdav_config.yml 该文件配置了Docker Compose设置中使用的hacdias/webdav服务器。以下是您可以自定义的内容:

# Server address and port
address: 0.0.0.0
port: 6060

# Root data directory
directory: /data

# Enable/disable CORS
cors:
  enabled: true
  # Additional CORS settings...

# Default permissions (C=Create, R=Read, U=Update, D=Delete)
permissions: CRUD

# User definitions
users:
  - username: admin
    password: admin      # Plain text password
    permissions: CRUD    # Full permissions
  
  - username: reader
    password: reader
    permissions: R       # Read-only permissions
    
  # You can also use bcrypt-encrypted passwords
  - username: secure
    password: "{bcrypt}$2y$10$zEP6oofmXFeHaeMfBNLnP.DO8m.H.Mwhd24/TOX2MWLxAExXi4qgi"

有关更高级的配置选项,请参阅 hacdias/webdav文档.

测试

要运行测试,请执行以下操作:

npm test

与Claude Desktop集成

  1. 确保在Claude Desktop中启用MCP功能

Using npx

  1. Open Claude Desktop settings and click edit config (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 this repository and run setup.sh on mac/linux or setup.bat on windows
  2. Open Claude Desktop settings and click edit config (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"
            }
        }
    }
}

可用MCP资源

  • webdav://{path}/list -列出目录中的文件
  • webdav://{path}/content -获取文件内容
  • webdav://{path}/info -获取文件或目录信息

可用的MCP工具

  • webdav_create_remote_file -在远程WebDAV服务器上创建新文件
  • webdav_get_remote_file -从远程WebDAV服务器上存储的文件中检索内容
  • webdav_update_remote_file -更新远程WebDAV服务器上的现有文件
  • webdav_delete_remote_item -从远程WebDAV服务器删除文件或目录
  • webdav_create_remote_directory -在远程WebDAV服务器上创建新目录
  • webdav_move_remote_item -移动或重命名远程WebDAV服务器上的文件/目录
  • webdav_copy_remote_item -将文件/目录复制到远程WebDAV服务器上的新位置
  • webdav_list_remote_directory -列出远程WebDAV服务器上的文件和目录

可用MCP提示

  • webdav_create_remote_file -提示在远程WebDAV服务器上创建新文件
  • webdav_get_remote_file -提示从远程WebDAV文件检索内容
  • webdav_update_remote_file -提示更新远程WebDAV服务器上的文件
  • webdav_delete_remote_item -提示从远程WebDAV服务器删除文件/目录
  • webdav_list_remote_directory -提示列出远程WebDAV服务器上的目录内容
  • webdav_create_remote_directory -提示在远程WebDAV服务器上创建目录
  • webdav_move_remote_item -提示在远程WebDAV服务器上移动/重命名文件/目录
  • webdav_copy_remote_item -提示复制远程WebDAV服务器上的文件/目录

Claude中的查询示例

以下是连接WebDAV MCP服务器后,您可以在Claude Desktop中使用的一些示例查询:

  • “列出远程WebDAV服务器上的文件”
  • “在我的远程WebDAV服务器上创建一个名为notes.txt的新文本文件,内容如下:Hello World”
  • “从我的远程WebDAV服务器获取document.txt的内容”
  • “使用此新配置更新我的远程WebDAV服务器上的config.json”
  • “在我的远程WebDAV服务器上创建一个名为projects的目录”
  • “将report.docx复制到远程WebDAV服务器上的备份位置”
  • “将远程WebDAV服务器上的文件old_name.txt移动到new_name.txt”
  • “从我的远程WebDAV服务器中删除temp.txt”

程序化使用

您还可以在自己的项目中以编程方式使用此包:

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
    }
  }
});

许可证

麻省理工学院

目录标签

目录标签

自然语言处理TypeScriptClaudeCRUD操作文件管理本地部署WebDAV协议服务器集成

支持客户端

Claude DesktopClaude

接入字段

传输方式(transport,传输协议)

stdio

鉴权方式(authType,认证方式)

none

运行时(runtime,运行环境)

Node.js

部署方式(deploymentType,部署类型)

remote-capable

来源包(packageName,安装包名)

webdav-mcp-server

工具数量(toolCount,工具数)

8

资源数量(resourceCount,资源数)

0

提示词数量(promptCount,提示词数)

0

权限和风险

stdiononeremote-capable

接入前请确认传输方式、认证方式和部署位置,并根据实际工具能力限制访问范围。

安装前确认

不要直接授予不必要的文件、网络或账号权限;先核对安装命令和配置内容。

来源信息

继续浏览同类 MCP