Nextcloud MCP Server
Provides full WebDAV access to Nextcloud files, enabling listing, uploading, downloading, viewing text file contents, creating directories, and deleting files or directories.
This server does not currently have a deployable release on Glama. Follow the repository's setup instructions to install and configure it for your MCP client, including any required credentials and local dependencies.
Nextcloud MCP Server
A Model Context Protocol (MCP) server that provides Nextcloud file access to Claude Desktop via WebDAV.
Disclaimer: This project was created with assistance from Claude AI (Anthropic). While functional, use at your own discretion and review the code before deployment.
Features
Full WebDAV access to Nextcloud files
Integrates natively with Claude Desktop
Supports file listing, upload, download, and deletion
Smart directory detection for uploads
No external dependencies beyond Python and
webdav4
Related MCP server: WebDAV MCP Server
Available Tools
Once configured, Claude Desktop will have access to these tools:
nextcloud_list- List files and directoriesnextcloud_download- Download files from Nextcloudnextcloud_upload- Upload files to Nextcloud (with smart directory handling)nextcloud_cat- Display text file contentsnextcloud_mkdir- Create directoriesnextcloud_delete- Delete files or directories
Prerequisites
Python 3.8 or higher
Claude Desktop installed
A Nextcloud instance with WebDAV access enabled
uv (recommended) or pip for Python package management
Installation
1. Clone or Download
# Clone this repository or download the files to a local directory
git clone https://github.com/runter-vom-mattenwagen/nextcloud-mcp-server.git
cd nextcloud-mcp-server2. Configure Credentials
Edit nextcloud_client.py and update the following variables at the top of the file:
WEBDAV_URL = "https://your-nextcloud-instance.com/remote.php/dav/files/username/"
USERNAME = "your-username"
PASSWORD = "your-password"Important: The WEBDAV_URL should end with your username followed by a trailing slash.
Example: https://cloud.example.com/remote.php/dav/files/john/
3. Configure Claude Desktop
Add the MCP server to your Claude Desktop configuration file.
Configuration file location by OS:
macOS:
~/Library/Application Support/Claude/claude_desktop_config.jsonWindows:
%APPDATA%\Claude\claude_desktop_config.jsonLinux:
~/.config/Claude/claude_desktop_config.json
Configuration:
Option A: Using uv (Recommended)
{
"mcpServers": {
"nextcloud": {
"command": "uv",
"args": [
"run",
"--with",
"webdav4",
"/absolute/path/to/nextcloud_mcp_server.py"
]
}
}
}Option B: Using system Python
{
"mcpServers": {
"nextcloud": {
"command": "python3",
"args": [
"/absolute/path/to/nextcloud_mcp_server.py"
]
}
}
}Note: If using system Python, you must install dependencies first:
pip3 install webdav44. Restart Claude Desktop
After configuration, restart Claude Desktop for the changes to take effect.
Usage Examples
Once configured, you can interact with your Nextcloud instance through Claude:
User: "List the files in my Nextcloud"
Claude: [uses nextcloud_list tool]
User: "Upload this document to my Nextcloud Documents folder"
Claude: [uses nextcloud_upload with remote_path="Documents/"]
User: "Show me the contents of notes.txt"
Claude: [uses nextcloud_cat]Standalone Usage
The nextcloud_client.py script can also be used standalone from the command line:
# List files
python3 nextcloud_client.py list /
# Upload a file
python3 nextcloud_client.py upload local_file.txt remote_folder/
# Download a file
python3 nextcloud_client.py download remote_file.txt
# Create directory
python3 nextcloud_client.py mkdir new_folder
# Delete file
python3 nextcloud_client.py delete old_file.txt
# Show file contents
python3 nextcloud_client.py cat notes.txtTroubleshooting
Connection Issues
Verify your WebDAV URL is correct (should include
/remote.php/dav/files/username/)Check username and password are correct
Ensure WebDAV is enabled in your Nextcloud instance
Test connection manually:
curl -u "username:password" "https://your-nextcloud-instance.com/remote.php/dav/files/username/"
MCP Server Not Starting
Check the Claude Desktop logs for errors
Verify Python path in configuration is correct
Ensure
webdav4is installed (if using system Python)Test the MCP server directly:
echo '{"jsonrpc":"2.0","id":1,"method":"initialize","params":{}}' | python3 nextcloud_mcp_server.py
Permission Denied
Ensure the scripts are executable:
chmod +x nextcloud_client.py nextcloud_mcp_server.pySecurity Considerations
Credentials in Code: This implementation stores credentials directly in the Python file. For production use, consider using environment variables or a separate config file.
HTTPS Only: Always use HTTPS URLs to protect credentials in transit.
File Permissions: Ensure the Python files are not world-readable if they contain credentials.
Architecture
nextcloud_client.py- WebDAV client handling all Nextcloud operationsnextcloud_mcp_server.py- MCP protocol server that wraps the client for Claude Desktop
The MCP server communicates with Claude Desktop via JSON-RPC over stdin/stdout, executing the WebDAV client as needed.
Dependencies
Python 3.8+
webdav4 - WebDAV client library
License
MIT License - See LICENSE file for details.
Contributing
Contributions are welcome! Please feel free to submit issues or pull requests.
Acknowledgments
Created with assistance from Claude AI (Anthropic)
Uses the webdav4 library for WebDAV operations
Built for the Model Context Protocol
Tool Schema Changelog
Recent tool additions, removals, and schema changes observed during successful MCP inspections.
Loading tool schema changelog…
This server cannot be deployed
Maintenance
Related MCP Connectors
Your own computer's files from ChatGPT or Claude: folder rules, confirmations and undo.
Give Claude only the Google Drive files you choose. Every action logged.
Swiss encrypted cloud drive for Claude, ChatGPT and AI agents: search, read and save files.
Browse and manage files in your Moxt AI workspace from any MCP client.
Related MCP Servers
- AlicenseAqualityDmaintenanceA Model Context Protocol server that enables Claude Desktop and other MCP clients to interact with WebDAV file systems through natural language commands for CRUD operations.8138 npm20MIT
- AlicenseAqualityDmaintenanceEnables CRUD operations on WebDAV file systems with authentication support, allowing users to manage files and directories through natural language commands. Includes advanced features like file search, range requests, smart editing with diff preview, and directory tree visualization.162MIT
- AlicenseNot gradedqualityDmaintenanceConnects Claude to your self-hosted or cloud-based Seafile storage for managing libraries and files through natural language. It enables users to browse directories, read file contents, and perform file operations like moving, renaming, or searching across their private infrastructure.4MIT
- AlicenseNot gradedqualityDmaintenanceProvides Claude with complete file system integration including directory management, file operations, Office document creation/editing, and advanced file tree visualization.3MIT