A Model Context Protocol (MCP) server for Synology NAS devices
Project description
๐พ Synology MCP Server
A Model Context Protocol (MCP) server for Synology NAS devices. Enables AI assistants to manage files and downloads through secure authentication and session management.
๐ NEW: Unified server supports both Claude/Cursor (stdio) and Xiaozhi (WebSocket) simultaneously!
๐ Quick Start with Docker
1๏ธโฃ Setup Environment
# Clone repository
git clone https://github.com/atom2ueki/mcp-server-synology.git
cd mcp-server-synology
# Create environment file
cp env.example .env
2๏ธโฃ Configure .env File
Basic Configuration (Claude/Cursor only):
# Required: Synology NAS connection
SYNOLOGY_URL=http://192.168.1.100:5000
SYNOLOGY_USERNAME=your_username
SYNOLOGY_PASSWORD=your_password
# Optional: Auto-login on startup
AUTO_LOGIN=true
VERIFY_SSL=false
Extended Configuration (Both Claude/Cursor + Xiaozhi):
# Required: Synology NAS connection
SYNOLOGY_URL=http://192.168.1.100:5000
SYNOLOGY_USERNAME=your_username
SYNOLOGY_PASSWORD=your_password
# Optional: Auto-login on startup
AUTO_LOGIN=true
VERIFY_SSL=false
# Enable Xiaozhi support
ENABLE_XIAOZHI=true
XIAOZHI_TOKEN=your_xiaozhi_token_here
XIAOZHI_MCP_ENDPOINT=wss://api.xiaozhi.me/mcp/
3๏ธโฃ Run with Docker
One simple command supports both modes:
# Claude/Cursor only mode (default if ENABLE_XIAOZHI not set)
docker-compose up -d
# Both Claude/Cursor + Xiaozhi mode (if ENABLE_XIAOZHI=true in .env)
docker-compose up -d
# Build and run
docker-compose up -d --build
4๏ธโฃ Alternative: Local Python
# Install dependencies
pip install -r requirements.txt
# Run with environment control
python main.py
๐ Client Setup
๐ค Claude Desktop
Add to your Claude Desktop configuration file:
macOS: ~/Library/Application Support/Claude/claude_desktop_config.json
Windows: %APPDATA%\Claude\claude_desktop_config.json
{
"mcpServers": {
"synology": {
"command": "docker-compose",
"args": [
"-f", "/path/to/your/mcp-server-synology/docker-compose.yml",
"run", "--rm", "synology-mcp"
],
"cwd": "/path/to/your/mcp-server-synology"
}
}
}
โ๏ธ Cursor
Add to your Cursor MCP settings:
{
"mcpServers": {
"synology": {
"command": "docker-compose",
"args": [
"-f", "/path/to/your/mcp-server-synology/docker-compose.yml",
"run", "--rm", "synology-mcp"
],
"cwd": "/path/to/your/mcp-server-synology"
}
}
}
๐ Continue (VS Code Extension)
Add to your Continue configuration (.continue/config.json):
{
"mcpServers": {
"synology": {
"command": "docker-compose",
"args": [
"-f", "/path/to/your/mcp-server-synology/docker-compose.yml",
"run", "--rm", "synology-mcp"
],
"cwd": "/path/to/your/mcp-server-synology"
}
}
}
๐ป Codeium
For Codeium's MCP support:
{
"mcpServers": {
"synology": {
"command": "docker-compose",
"args": [
"-f", "/path/to/your/mcp-server-synology/docker-compose.yml",
"run", "--rm", "synology-mcp"
],
"cwd": "/path/to/your/mcp-server-synology"
}
}
}
๐ Alternative: Direct Python Execution
If you prefer not to use Docker:
{
"mcpServers": {
"synology": {
"command": "python",
"args": ["main.py"],
"cwd": "/path/to/your/mcp-server-synology",
"env": {
"SYNOLOGY_URL": "http://192.168.1.100:5000",
"SYNOLOGY_USERNAME": "your_username",
"SYNOLOGY_PASSWORD": "your_password",
"AUTO_LOGIN": "true",
"ENABLE_XIAOZHI": "false"
}
}
}
}
๐ Xiaozhi Integration
New unified architecture supports both clients simultaneously!
How It Works
- ENABLE_XIAOZHI=false (default): Standard MCP server for Claude/Cursor via stdio
- ENABLE_XIAOZHI=true: Multi-client bridge supporting both:
- ๐ก Xiaozhi: WebSocket connection
- ๐ป Claude/Cursor: stdio connection
Setup Steps
- Add to your .env file:
ENABLE_XIAOZHI=true
XIAOZHI_TOKEN=your_xiaozhi_token_here
- Run normally:
# Same command, different behavior based on environment
python main.py
# OR
docker-compose up
Key Features
- โ Zero Configuration Conflicts: One server, multiple clients
- โ Parallel Operation: Both clients can work simultaneously
- โ All Tools Available: Xiaozhi gets access to all Synology MCP tools
- โ Backward Compatible: Existing setups work unchanged
- โ Auto-Reconnection: Handles WebSocket connection drops
- โ Environment Controlled: Simple boolean flag to enable/disable
Startup Messages
Claude/Cursor only mode:
๐ Synology MCP Server
==============================
๐ Claude/Cursor only mode (ENABLE_XIAOZHI=false)
Both clients mode:
๐ Synology MCP Server with Xiaozhi Bridge
==================================================
๐ Supports BOTH Xiaozhi and Claude/Cursor simultaneously!
๐ ๏ธ Available MCP Tools
๐ Authentication
synology_status- Check authentication status and active sessionssynology_login- Authenticate with Synology NAS (conditional)synology_logout- Logout from session (conditional)
๐ File System Operations
list_shares- List all available NAS shareslist_directory- List directory contents with metadatapath(required): Directory path starting with/
get_file_info- Get detailed file/directory informationpath(required): File path starting with/
search_files- Search files matching patternpath(required): Search directorypattern(required): Search pattern (e.g.,*.pdf)
create_file- Create new files with contentpath(required): Full file path starting with/content(optional): File content (default: empty string)overwrite(optional): Overwrite existing files (default: false)
create_directory- Create new directoriesfolder_path(required): Parent directory path starting with/name(required): New directory nameforce_parent(optional): Create parent directories if needed (default: false)
delete- Delete files or directories (auto-detects type)path(required): File/directory path starting with/
rename_file- Rename files or directoriespath(required): Current file pathnew_name(required): New filename
move_file- Move files to new locationsource_path(required): Source file pathdestination_path(required): Destination pathoverwrite(optional): Overwrite existing files
๐ฅ Download Station Management
ds_get_info- Get Download Station informationds_list_tasks- List all download tasks with statusoffset(optional): Pagination offsetlimit(optional): Max tasks to return
ds_create_task- Create new download taskuri(required): Download URL or magnet linkdestination(optional): Download folder path
ds_pause_tasks- Pause download taskstask_ids(required): Array of task IDs
ds_resume_tasks- Resume paused taskstask_ids(required): Array of task IDs
ds_delete_tasks- Delete download taskstask_ids(required): Array of task IDsforce_complete(optional): Force delete completed
ds_get_statistics- Get download/upload statistics
โ๏ธ Configuration Options
| Variable | Required | Default | Description |
|---|---|---|---|
SYNOLOGY_URL |
Yes* | - | NAS base URL (e.g., http://192.168.1.100:5000) |
SYNOLOGY_USERNAME |
Yes* | - | Username for authentication |
SYNOLOGY_PASSWORD |
Yes* | - | Password for authentication |
AUTO_LOGIN |
No | true |
Auto-login on server start |
VERIFY_SSL |
No | true |
Verify SSL certificates |
DEBUG |
No | false |
Enable debug logging |
ENABLE_XIAOZHI |
No | false |
Enable Xiaozhi WebSocket bridge |
XIAOZHI_TOKEN |
Xiaozhi only | - | Authentication token for Xiaozhi |
XIAOZHI_MCP_ENDPOINT |
No | wss://api.xiaozhi.me/mcp/ |
Xiaozhi WebSocket endpoint |
*Required for auto-login and default operations
๐ Usage Examples
๐ File Operations
โ Creating Files and Directories
// List directory
{
"path": "/volume1/homes"
}
// Search for PDFs
{
"path": "/volume1/documents",
"pattern": "*.pdf"
}
// Create new file
{
"path": "/volume1/documents/notes.txt",
"content": "My important notes\nLine 2 of notes",
"overwrite": false
}
๐๏ธ Deleting Files and Directories
// Delete file or directory (auto-detects type)
{
"path": "/volume1/temp/old-file.txt"
}
// Move file
{
"source_path": "/volume1/temp/file.txt",
"destination_path": "/volume1/archive/file.txt"
}
โฌ๏ธ Download Management
๐ ๏ธ Creating a Download Task
// Create download task
{
"uri": "https://example.com/file.zip",
"destination": "/volume1/downloads"
}
// Pause tasks
{
"task_ids": ["dbid_123", "dbid_456"]
}
๐ฆฆ Download Results
โจ Features
- โ
Unified Entry Point - Single
main.pysupports both stdio and WebSocket clients - โ
Environment Controlled - Switch modes via
ENABLE_XIAOZHIenvironment variable - โ Multi-Client Support - Simultaneous Claude/Cursor + Xiaozhi access
- โ Secure Authentication - RSA encrypted password transmission
- โ Session Management - Persistent sessions across multiple NAS devices
- โ Complete File Operations - Create, delete, list, search, rename, move files with detailed metadata
- โ Directory Management - Recursive directory operations with safety checks
- โ Download Station - Complete torrent and download management
- โ Docker Support - Easy containerized deployment
- โ Backward Compatible - Existing configurations work unchanged
- โ Error Handling - Comprehensive error reporting and recovery
๐๏ธ Architecture
File Structure
mcp-server-synology/
โโโ main.py # ๐ฏ Unified entry point
โโโ src/
โ โโโ mcp_server.py # Standard MCP server
โ โโโ multiclient_bridge.py # Multi-client bridge
โ โโโ auth/ # Authentication modules
โ โโโ filestation/ # File operations
โ โโโ downloadstation/ # Download management
โโโ docker-compose.yml # Single service, environment-controlled
โโโ Dockerfile
โโโ requirements.txt
โโโ .env # Configuration
Mode Selection
ENABLE_XIAOZHI=falseโmain.pyโmcp_server.py(stdio only)ENABLE_XIAOZHI=trueโmain.pyโmulticlient_bridge.pyโmcp_server.py(both clients)
Perfect for any workflow - from simple Claude/Cursor usage to advanced multi-client setups! ๐
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file iflow_mcp_atom2ueki_mcp_server_synology-0.1.0.tar.gz.
File metadata
- Download URL: iflow_mcp_atom2ueki_mcp_server_synology-0.1.0.tar.gz
- Upload date:
- Size: 2.6 MB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: uv/0.10.0 {"installer":{"name":"uv","version":"0.10.0","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Debian GNU/Linux","version":"13","id":"trixie","libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":null}
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
afc4183b6e37e73c4df42ae2fe4d501ff4faac30721c9ab8f8905f272a73e6dc
|
|
| MD5 |
f10ee2b06eb82a456d17ead2c03c5ea4
|
|
| BLAKE2b-256 |
80d65e9938c4d2795d37bd235e14f0c08a80bae7d73532416180dc7339049782
|
File details
Details for the file iflow_mcp_atom2ueki_mcp_server_synology-0.1.0-py3-none-any.whl.
File metadata
- Download URL: iflow_mcp_atom2ueki_mcp_server_synology-0.1.0-py3-none-any.whl
- Upload date:
- Size: 35.2 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: uv/0.10.0 {"installer":{"name":"uv","version":"0.10.0","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Debian GNU/Linux","version":"13","id":"trixie","libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":null}
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
dc32327503c4251252dff39ba3314222e80b41515715c4c0f81b952387717935
|
|
| MD5 |
ab65e81875e420011aa56561f5ac0024
|
|
| BLAKE2b-256 |
ee668fc02838b3c10e3b65fcdf85f6ad687d452588cf41cd3a309374c11c1204
|