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!
# Clone repository
git clone https://github.com/atom2ueki/mcp-server-synology.git
cd mcp-server-synology
# Create environment file
cp env.example .env
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/
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
# Install dependencies
pip install -r requirements.txt
# Run with environment control
python main.py
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"
}
}
}
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"
}
}
}
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"
}
}
}
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"
}
}
}
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"
}
}
}
}
New unified architecture supports both clients simultaneously!
- 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
- 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
- β 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
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!
synology_status
- Check authentication status and active sessionssynology_login
- Authenticate with Synology NAS (conditional)synology_logout
- Logout from session (conditional)
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
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
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
// 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
}
// 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"
}
// Create download task
{
"uri": "https://example.com/file.zip",
"destination": "/volume1/downloads"
}
// Pause tasks
{
"task_ids": ["dbid_123", "dbid_456"]
}
- β
Unified Entry Point - Single
main.py
supports both stdio and WebSocket clients - β
Environment Controlled - Switch modes via
ENABLE_XIAOZHI
environment 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
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
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! π