44
55A Model Context Protocol (MCP) server for Synology NAS devices. Enables AI assistants to manage files and downloads through secure authentication and session management.
66
7+ ** 🌟 NEW: Unified server supports both Claude/Cursor (stdio) and Xiaozhi (WebSocket) simultaneously!**
8+
79## 🚀 Quick Start with Docker
810
911### 1️⃣ Setup Environment
@@ -17,6 +19,20 @@ cp env.example .env
1719```
1820
1921### 2️⃣ Configure .env File
22+
23+ ** Basic Configuration (Claude/Cursor only):**
24+ ``` bash
25+ # Required: Synology NAS connection
26+ SYNOLOGY_URL=http://192.168.1.100:5000
27+ SYNOLOGY_USERNAME=your_username
28+ SYNOLOGY_PASSWORD=your_password
29+
30+ # Optional: Auto-login on startup
31+ AUTO_LOGIN=true
32+ VERIFY_SSL=false
33+ ```
34+
35+ ** Extended Configuration (Both Claude/Cursor + Xiaozhi):**
2036``` bash
2137# Required: Synology NAS connection
2238SYNOLOGY_URL=http://192.168.1.100:5000
@@ -26,27 +42,39 @@ SYNOLOGY_PASSWORD=your_password
2642# Optional: Auto-login on startup
2743AUTO_LOGIN=true
2844VERIFY_SSL=false
45+
46+ # Enable Xiaozhi support
47+ ENABLE_XIAOZHI=true
48+ XIAOZHI_TOKEN=your_xiaozhi_token_here
49+ XIAOZHI_MCP_ENDPOINT=wss://api.xiaozhi.me/mcp/
2950```
3051
3152### 3️⃣ Run with Docker
53+
54+ ** One simple command supports both modes:**
55+
3256``` bash
33- # Build and run
34- docker-compose up --build
57+ # Claude/Cursor only mode (default if ENABLE_XIAOZHI not set)
58+ docker-compose up -d
59+
60+ # Both Claude/Cursor + Xiaozhi mode (if ENABLE_XIAOZHI=true in .env)
61+ docker-compose up -d
3562
36- # Most of the case you run detached
63+ # Build and run
3764docker-compose up -d --build
3865```
3966
40- ### 4️⃣ Alternative: Docker Run
67+ ### 4️⃣ Alternative: Local Python
68+
4169``` bash
42- # Build image
43- docker build -t synology-mcp-server .
70+ # Install dependencies
71+ pip install -r requirements.txt
4472
45- # Run container
46- docker run --env-file .env synology-mcp-server
73+ # Run with environment control
74+ python main.py
4775```
4876
49- ## 🔌 MCP Client Setup
77+ ## 🔌 Client Setup
5078
5179### 🤖 Claude Desktop
5280
@@ -70,9 +98,9 @@ Add to your Claude Desktop configuration file:
7098}
7199```
72100
73- ### 🔄 Continue (VS Code Extension)
101+ ### ↗️ Cursor
74102
75- Add to your Continue configuration ( ` .continue/config.json ` ) :
103+ Add to your Cursor MCP settings :
76104
77105``` json
78106{
@@ -89,9 +117,9 @@ Add to your Continue configuration (`.continue/config.json`):
89117}
90118```
91119
92- ### ↗️ Cursor
120+ ### 🔄 Continue (VS Code Extension)
93121
94- Add to your Cursor MCP settings :
122+ Add to your Continue configuration ( ` .continue/config.json ` ) :
95123
96124``` json
97125{
@@ -129,7 +157,7 @@ For Codeium's MCP support:
129157
130158### 🐍 Alternative: Direct Python Execution
131159
132- If you prefer not to use Docker, you can run the server directly :
160+ If you prefer not to use Docker:
133161
134162``` json
135163{
@@ -142,21 +170,63 @@ If you prefer not to use Docker, you can run the server directly:
142170 "SYNOLOGY_URL" : " http://192.168.1.100:5000" ,
143171 "SYNOLOGY_USERNAME" : " your_username" ,
144172 "SYNOLOGY_PASSWORD" : " your_password" ,
145- "AUTO_LOGIN" : " true"
173+ "AUTO_LOGIN" : " true" ,
174+ "ENABLE_XIAOZHI" : " false"
146175 }
147176 }
148177 }
149178}
150179```
151180
152- ## 💻 Local Development Setup
181+ ## 🌟 Xiaozhi Integration
182+
183+ ** New unified architecture supports both clients simultaneously!**
184+
185+ ### How It Works
186+
187+ - ** ENABLE_XIAOZHI=false** (default): Standard MCP server for Claude/Cursor via stdio
188+ - ** ENABLE_XIAOZHI=true** : Multi-client bridge supporting both:
189+ - 📡 ** Xiaozhi** : WebSocket connection
190+ - 💻 ** Claude/Cursor** : stdio connection
153191
192+ ### Setup Steps
193+
194+ 1 . ** Add to your .env file:**
154195``` bash
155- # Install dependencies
156- pip install -r requirements.txt
196+ ENABLE_XIAOZHI=true
197+ XIAOZHI_TOKEN=your_xiaozhi_token_here
198+ ```
157199
158- # Run directly
200+ 2 . ** Run normally:**
201+ ``` bash
202+ # Same command, different behavior based on environment
159203python main.py
204+ # OR
205+ docker-compose up
206+ ```
207+
208+ ### Key Features
209+ - ✅ ** Zero Configuration Conflicts** : One server, multiple clients
210+ - ✅ ** Parallel Operation** : Both clients can work simultaneously
211+ - ✅ ** All Tools Available** : Xiaozhi gets access to all Synology MCP tools
212+ - ✅ ** Backward Compatible** : Existing setups work unchanged
213+ - ✅ ** Auto-Reconnection** : Handles WebSocket connection drops
214+ - ✅ ** Environment Controlled** : Simple boolean flag to enable/disable
215+
216+ ### Startup Messages
217+
218+ ** Claude/Cursor only mode:**
219+ ```
220+ 🚀 Synology MCP Server
221+ ==============================
222+ 📌 Claude/Cursor only mode (ENABLE_XIAOZHI=false)
223+ ```
224+
225+ ** Both clients mode:**
226+ ```
227+ 🚀 Synology MCP Server with Xiaozhi Bridge
228+ ==================================================
229+ 🌟 Supports BOTH Xiaozhi and Claude/Cursor simultaneously!
160230```
161231
162232## 🛠️ Available MCP Tools
@@ -220,6 +290,9 @@ python main.py
220290| ` AUTO_LOGIN ` | No | ` true ` | Auto-login on server start |
221291| ` VERIFY_SSL ` | No | ` true ` | Verify SSL certificates |
222292| ` DEBUG ` | No | ` false ` | Enable debug logging |
293+ | ` ENABLE_XIAOZHI ` | No | ` false ` | Enable Xiaozhi WebSocket bridge |
294+ | ` XIAOZHI_TOKEN ` | Xiaozhi only | - | Authentication token for Xiaozhi |
295+ | ` XIAOZHI_MCP_ENDPOINT ` | No | ` wss://api.xiaozhi.me/mcp/ ` | Xiaozhi WebSocket endpoint |
223296
224297* Required for auto-login and default operations
225298
@@ -289,11 +362,38 @@ python main.py
289362
290363## ✨ Features
291364
365+ - ✅ ** Unified Entry Point** - Single ` main.py ` supports both stdio and WebSocket clients
366+ - ✅ ** Environment Controlled** - Switch modes via ` ENABLE_XIAOZHI ` environment variable
367+ - ✅ ** Multi-Client Support** - Simultaneous Claude/Cursor + Xiaozhi access
292368- ✅ ** Secure Authentication** - RSA encrypted password transmission
293369- ✅ ** Session Management** - Persistent sessions across multiple NAS devices
294370- ✅ ** Complete File Operations** - Create, delete, list, search, rename, move files with detailed metadata
295371- ✅ ** Directory Management** - Recursive directory operations with safety checks
296372- ✅ ** Download Station** - Complete torrent and download management
297373- ✅ ** Docker Support** - Easy containerized deployment
298- - ✅ ** Multi-Client Support** - Works with Claude, Continue, Cursor, Codeium and more
299- - ✅ ** Error Handling** - Comprehensive error reporting and recovery
374+ - ✅ ** Backward Compatible** - Existing configurations work unchanged
375+ - ✅ ** Error Handling** - Comprehensive error reporting and recovery
376+
377+ ## 🏗️ Architecture
378+
379+ ### File Structure
380+ ```
381+ mcp-server-synology/
382+ ├── main.py # 🎯 Unified entry point
383+ ├── src/
384+ │ ├── mcp_server.py # Standard MCP server
385+ │ ├── multiclient_bridge.py # Multi-client bridge
386+ │ ├── auth/ # Authentication modules
387+ │ ├── filestation/ # File operations
388+ │ └── downloadstation/ # Download management
389+ ├── docker-compose.yml # Single service, environment-controlled
390+ ├── Dockerfile
391+ ├── requirements.txt
392+ └── .env # Configuration
393+ ```
394+
395+ ### Mode Selection
396+ - ** ` ENABLE_XIAOZHI=false ` ** → ` main.py ` → ` mcp_server.py ` (stdio only)
397+ - ** ` ENABLE_XIAOZHI=true ` ** → ` main.py ` → ` multiclient_bridge.py ` → ` mcp_server.py ` (both clients)
398+
399+ ** Perfect for any workflow - from simple Claude/Cursor usage to advanced multi-client setups!** 🚀
0 commit comments