nextcloud-mcp-server
Provides tools for managing NextCloud files (list, upload, download, delete, move, copy, search, versioning) and sharing (create public links, user/group shares, list, delete).
Click on "Install Server".
Wait a few minutes for the server to deploy. Once ready, it will show a "Started" state.
In the chat, type
@followed by the MCP server name and your instructions, e.g., "@nextcloud-mcp-serverlist files in my Documents folder"
That's it! The server will respond to your query, and you can continue using it as needed.
Here is a step-by-step guide with screenshots.
๐ NextCloud MCP Server
A professional Model Context Protocol (MCP) server for seamless NextCloud integration
Empower your AI agents with comprehensive NextCloud file management and sharing capabilities
Installation โข Quick Start โข Features โข Documentation โข Security
๐ Features
๐ File Management | ๐ Sharing | ๐ Security | ๐ ๏ธ Developer Experience |
List, upload, download | Public links | App passwords | Full TypeScript support |
Create directories | User/group shares | Environment variables | Comprehensive tests |
Delete files/folders | Password protection | Secure authentication | Professional documentation |
Move and rename | Expiration dates | HTTPS enforcement | Easy integration |
โจ Key Capabilities
๐ฏ 14 Comprehensive Tools - Complete file operations and sharing management
๐ Enhanced Security - Built-in app password support and best practices
๐๏ธ Professional Architecture - TypeScript-first with full type safety
๐ Rich Documentation - Detailed guides and examples
๐ WebDAV Integration - Native NextCloud protocol support
โก High Performance - Optimized for speed and reliability
๐ Universal Compatibility - Works with any NextCloud instance
๐ฆ Installation
From NPM (Recommended)
# Install globally for CLI usage
npm install -g nextcloud-mcp-server
# Or install locally in your project
npm install nextcloud-mcp-serverFrom Source
git clone https://github.com/abdullahMASHUK/nextcloud-mcp-server.git
cd nextcloud-mcp-server
npm install
npm run build๐ Quick Start
1. ๐ Setup App Password (Recommended)
For enhanced security, create a dedicated app password:
Navigate to NextCloud Settings
NextCloud โ Settings โ Security โ App passwordsCreate New App Password
Enter name:
MCP ServerClick "Create new app password"
Copy the generated password:
xxxxx-xxxxx-xxxxx-xxxxx-xxxxx
Why App Passwords?
โ Limited scope and permissions
โ Can be revoked independently
โ No access to your main account
โ Auditable access logs
2. โ๏ธ Configuration
# Copy the environment template
cp .env.example .envEdit your .env file:
NEXTCLOUD_URL=https://your-nextcloud-server.com
NEXTCLOUD_USERNAME=your-username
NEXTCLOUD_PASSWORD=your-app-password-here # Use app password!3. ๐ฎ Usage with MCP Clients
Add to your claude_desktop_config.json:
{
"mcpServers": {
"nextcloud": {
"command": "nextcloud-mcp-server",
"env": {
"NEXTCLOUD_URL": "https://your-nextcloud-server.com",
"NEXTCLOUD_USERNAME": "your-username",
"NEXTCLOUD_PASSWORD": "your-app-password"
}
}
}
}# Run the MCP server
nextcloud-mcp-server
# Or with Node.js
node build/index.js๐ ๏ธ Available Tools
๐ File Operations
๐ Sharing Operations
๐ Documentation
๐ฏ Tool Examples
{
"name": "list-files",
"arguments": {
"path": "/Documents"
}
}Response: Returns array of files with metadata (name, size, type, modification date)
{
"name": "upload-file",
"arguments": {
"remotePath": "/documents/report.pdf",
"content": "JVBERi0xLjQK..." // base64 encoded content
}
}{
"name": "move-file",
"arguments": {
"sourcePath": "/old-location/document.pdf",
"destinationPath": "/new-location/document.pdf",
"overwrite": false
}
}Response: Confirmation message with source and destination paths
{
"name": "copy-file",
"arguments": {
"sourcePath": "/Documents/template.docx",
"destinationPath": "/Projects/new-document.docx",
"overwrite": true
}
}Response: Confirmation message with copy operation details
{
"name": "search-files",
"arguments": {
"query": "quarterly report",
"path": "/Documents",
"limit": 20,
"type": "file"
}
}Response: Array of matching files with full metadata
Type Options: file, directory, all
{
"name": "get-file-versions",
"arguments": {
"path": "/Documents/important-document.pdf"
}
}Response: Array of file versions with timestamps, sizes, and user information
{
"name": "restore-file-version",
"arguments": {
"path": "/Documents/important-document.pdf",
"versionId": "1672531200"
}
}Response: Confirmation of version restoration
{
"name": "create-share",
"arguments": {
"path": "/Documents/presentation.pptx",
"shareType": 3,
"password": "secure123",
"expireDate": "2024-12-31",
"note": "Shared for team review"
}
}Share Types:
0- User share1- Group share3- Public link4- Email share
๐๏ธ Development
# Clone and install
git clone https://github.com/abdullahMASHUK/nextcloud-mcp-server.git
cd nextcloud-mcp-server
npm install
# Development commands
npm run dev # Run with auto-reload
npm run build # Build TypeScript
npm run test # Run test suite
npm run lint # Check code quality
npm run format # Format codeProject Structure:
src/
โโโ index.ts # Main MCP server
โโโ services/
โ โโโ nextcloud.ts # NextCloud API client
โโโ types.ts # TypeScript definitions
โโโ utils/ # Utility functions
__tests__/ # Test suites
build/ # Compiled output๐ Security
๐ก๏ธ Best Practices
โ Do | โ Don't |
Use app passwords | Use main account password |
Store in environment variables | Hardcode credentials |
Use HTTPS URLs | Use HTTP connections |
Rotate passwords regularly | Keep old passwords |
Monitor access logs | Ignore security events |
๐ Security Features
๐ App Password Integration - Dedicated authentication tokens
๐ HTTPS Enforcement - Secure connections required
๐ Environment Variables - Safe credential storage
๐ Error Handling - No credential exposure in logs
๐ก๏ธ Permission Scoping - Limited access rights
โ ๏ธ Security Checklist
App password created and configured
HTTPS enabled on NextCloud server
Environment variables properly set
.envfile added to.gitignoreRegular password rotation scheduled
License
MIT License - see LICENSE file for details.
๐ค Contributing
We Welcome Contributions!
๐ด Fork the repository
๐ฟ Create your feature branch
git checkout -b feature/amazing-feature๐ป Make your changes
โ Add tests for new features
๐งช Run the test suite
npm run test npm run lint๐ Commit your changes
git commit -m "โจ Add amazing feature"๐ Push to your branch
git push origin feature/amazing-feature๐ Open a Pull Request
๐ก Ways to Contribute
๐ Support
Show Your Support! โญ
If this project helped you, please consider giving it a โญ on GitHub!
๐ฃ๏ธ Get Help
๐ Documentation
๐ Report Issues
๐ฌ Discussions
๐ง Contact Maintainer
๐ Connect With Us
๐ License
MIT License ยฉ 2024 Abdullah MASHUK
Permission is hereby granted, free of charge, to any person obtaining a copy of this software...
๐ Changelog
๐ v1.0.3
๐จ Beautified README with professional formatting and visual enhancements
๐ Added interactive tables, badges, and collapsible sections
๐ค Updated author information and git configuration
๐ Enhanced navigation with emojis and better organization
โจ Improved user experience for npm and GitHub viewers
๐ v1.0.2
โจ Enhanced documentation and README
๐ Added comprehensive security guidelines
๐ Improved TypeScript definitions
๐ Bug fixes and stability improvements
๐ v1.0.1
๐ Updated documentation
๐ง Configuration improvements
๐ ๏ธ Build process optimization
๐ v1.0.0
๐ Initial release
๐ Basic file operations (list, upload, download, delete)
๐ Share management (create, list, delete)
๐ง TypeScript implementation
โ Comprehensive test coverage
๐ Full documentation
Made with โค๏ธ by Abdullah MASHUK
Building bridges between NextCloud and AI assistants ๐
Maintenance
Resources
Unclaimed servers have limited discoverability.
Looking for Admin?
If you are the server author, to access and configure the admin panel.
Latest Blog Posts
MCP directory API
We provide all the information about MCP servers via our MCP API.
curl -X GET 'https://glama.ai/api/mcp/v1/servers/abdullahMASHUK/nextcloud-mcp-server'
If you have feedback or need assistance with the MCP directory API, please join our Discord server