WebDAV MCP Server
WebDAV MCP サーバー
WebDAVエンドポイントで基本認証によるCRUD操作を可能にするモデルコンテキストプロトコル(MCP)サーバー。このサーバーにより、Claude Desktopやその他のMCPクライアントは、自然言語コマンドを使用してWebDAVファイルシステムと対話できるようになります。
特徴
オプションの認証を使用して任意のWebDAVサーバーに接続します
ファイルとディレクトリに対してCRUD操作を実行する
ファイル操作をMCPリソースおよびツールとして公開する
stdio トランスポート (Claude Desktop 統合用) または HTTP/SSE トランスポート経由で実行
オプションの基本認証による安全なアクセス
MCP サーバー認証用の bcrypt 暗号化パスワードのサポート (プロトコルの制限により、WebDAV パスワードはプレーンテキストである必要があります)
WebDAV サーバーのパフォーマンスを向上させる接続プール
Zodを使用した構成検証
トラブルシューティングを向上させる構造化されたログ
Related MCP server: Claude MCP Server Integration
前提条件
Node.js 18以降
npmまたはyarn
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/5jKJByMCP サーバー認証用の暗号化パスワード
MCP サーバー (WebDAV 接続ではない) のセキュリティを強化するために、パスワードをプレーンテキストで保存する代わりに、bcrypt で暗号化されたパスワードを使用できます。
bcryptハッシュを生成します:
# Using the built-in utility npm run generate-hash -- yourpassword # Or with npx npx webdav-mcp-generate-hash yourpasswordハッシュを {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.jsHTTP/SSEトランスポートで実行
このモードでは、リアルタイム通信のために Server-Sent Events を使用して HTTP 経由でサーバーにアクセスできます。
# If installed globally
webdav-mcp-server --http
# If using npx
npx webdav-mcp-server --http
# If built from source
node dist/index.js --httpDocker 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サーバーであるhacdias/webdavを使用します。WebDAVサーバーの設定はwebdav_config.ymlに保存されており、これを変更することで権限の調整、ユーザーの追加、その他の設定の変更が可能です。
WebDAV サーバーは、すべてのファイルをwebdav_dataという Docker ボリュームに保存します。このボリュームは、コンテナの再起動後も保持されます。
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 testClaude Desktopとの統合
Claude DesktopでMCP機能が有効になっていることを確認します
利用可能な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 サーバー上のファイル/ディレクトリをコピーするためのプロンプト
クロードのクエリ例
WebDAV MCP サーバーに接続すると、Claude Desktop で使用できるクエリの例を次に示します。
「リモート WebDAV サーバー上のファイルを一覧表示する」
「リモート WebDAV サーバーに、次の内容を含む notes.txt という新しいテキスト ファイルを作成します: Hello World」
「リモート WebDAV サーバーから document.txt の内容を取得する」
「この新しい設定でリモート WebDAV サーバーの config.json を更新します」
「リモート WebDAV サーバーに projects というディレクトリを作成します」
「report.docx をリモート WebDAV サーバーのバックアップ場所にコピーします」
「ファイル old_name.txt をリモート WebDAV サーバー上の 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
}
}
});ライセンス
マサチューセッツ工科大学
Available Tools
8 toolswebdav_copy_remote_itemC
Copy a file or directory to a new location on a remote WebDAV server
Inputs: fromPath (required), toPath (required), overwrite.
webdav_create_remote_directoryC
Create a new directory on a remote WebDAV server
Inputs: path (required).
webdav_create_remote_fileC
Create a new file on a remote WebDAV server at the specified path
Inputs: path (required), content (required), overwrite.
webdav_delete_remote_itemC
Delete a file or directory from a remote WebDAV server
Inputs: path (required).
webdav_get_remote_fileC
Retrieve content from a file stored on a remote WebDAV server
Inputs: path (required).
webdav_list_remote_directoryC
List files and directories at the specified path on a remote WebDAV server
Inputs: path.
webdav_move_remote_itemC
Move or rename a file or directory on a remote WebDAV server
Inputs: fromPath (required), toPath (required), overwrite.
webdav_update_remote_fileC
Update an existing file on a remote WebDAV server with new content
Inputs: path (required), content (required).
Tool Schema Changelog
Recent tool additions, removals, and schema changes observed during successful MCP inspections.
Loading tool schema changelog…
TDQS
Scored across 8 tools
Each tool has a clearly distinct purpose with no ambiguity. The actions (copy, create, delete, get, list, move, update) are well-defined and target specific operations on files or directories, making it easy for an agent to select the correct tool for any task.
All tools follow a consistent 'webdav_verb_remote_noun' pattern using snake_case. This predictable naming convention makes the tool set easy to understand and navigate, with no deviations or mixed styles.
With 8 tools, this server is well-scoped for WebDAV file operations. Each tool earns its place by covering essential CRUD and management functions, providing a comprehensive yet manageable surface for interacting with remote WebDAV servers.
The tool set offers complete coverage for WebDAV file and directory management. It includes all core operations: create (file and directory), read (get and list), update (file), delete, copy, and move, with no obvious gaps that would hinder agent workflows.
Maintenance
Related MCP Connectors
A comprehensive Model Context Protocol (MCP) server that enables AI assistants to interact with yo…
An MCP server that provides read access to your cloud storage providers, bank accounts and more.
Shared memory MCP server for Claude Code, Codex, Gemini CLI and Cursor. Cited, editable.
MCP server unifying ERPs, CRMs, APIs and knowledge base for Claude, ChatGPT and Gemini.
Related MCP Servers
- FlicenseNot gradedqualityDmaintenanceA Model Context Protocol server that extends AI capabilities by providing file system access and management functionalities to Claude or other AI assistants.5-
- AlicenseNot gradedqualityDmaintenanceIntegration project for Model Context Protocol (MCP) servers with Claude Desktop App, enabling filesystem operations, development support, and file management through natural language.MIT
- AlicenseNot gradedqualityDmaintenanceA Model Context Protocol server that enables Claude Desktop to perform file operations like reading, writing, listing directories, and managing files through natural language commands.MIT
- AlicenseNot gradedqualityDmaintenanceA production-ready Model Context Protocol server that provides comprehensive file system management capabilities for seamless integration with Claude Desktop.1MIT