Skip to content

Commit af191e9

Browse files
authored
Merge pull request #121 from smart-mcp-proxy/feature/docker-recovery-phase3
feat: Fix shutdown bugs and add Docker recovery Phase 3 features
2 parents e14f14c + 59c1209 commit af191e9

35 files changed

Lines changed: 3030 additions & 228 deletions

README.md

Lines changed: 62 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -457,6 +457,68 @@ docker logs <container-id>
457457

458458
---
459459

460+
## 🔄 Docker Recovery
461+
462+
MCPProxy includes **intelligent Docker recovery** that automatically detects and handles Docker engine outages:
463+
464+
### **Key Features**
465+
- **Automatic Detection**: Monitors Docker health every 2-60 seconds with exponential backoff
466+
- **Graceful Reconnection**: Automatically reconnects all Docker-based servers when Docker recovers
467+
- **System Notifications**: Native notifications keep you informed of recovery progress
468+
- **Container Cleanup**: Removes orphaned containers on shutdown
469+
- **Zero Configuration**: Works out-of-the-box with sensible defaults
470+
471+
### 🔧 **How It Works**
472+
1. **Health Monitoring**: Continuously checks Docker engine availability
473+
2. **Failure Detection**: Detects when Docker becomes unavailable (paused, stopped, crashed)
474+
3. **Exponential Backoff**: Starts with 2-second checks, backs off to 60 seconds to save resources
475+
4. **Automatic Reconnection**: When Docker recovers, all affected servers are reconnected
476+
5. **User Notification**: System notifications inform you of recovery status
477+
478+
### 📢 **Notifications**
479+
480+
MCPProxy shows native system notifications during Docker recovery:
481+
482+
| Event | Notification |
483+
|-------|-------------|
484+
| **Recovery Started** | "Docker engine detected offline. Reconnecting servers..." |
485+
| **Recovery Success** | "Successfully reconnected X server(s)" |
486+
| **Recovery Failed** | "Unable to reconnect servers. Check Docker status." |
487+
| **Retry Attempts** | "Retry attempt X. Next check in Y" |
488+
489+
### 🐛 **Troubleshooting Docker Recovery**
490+
491+
**Servers don't reconnect after Docker recovery:**
492+
```bash
493+
# 1. Check Docker is running
494+
docker ps
495+
496+
# 2. Check mcpproxy logs
497+
cat ~/.mcpproxy/logs/main.log | grep -i "docker recovery"
498+
499+
# 3. Verify container labels
500+
docker ps -a --filter label=com.mcpproxy.managed
501+
502+
# 4. Force reconnect via system tray
503+
# System Tray → Force Reconnect All Servers
504+
```
505+
506+
**Containers not cleaned up on shutdown:**
507+
```bash
508+
# Check for orphaned containers
509+
docker ps -a --filter label=com.mcpproxy.managed=true
510+
511+
# Manual cleanup if needed
512+
docker ps -a --filter label=com.mcpproxy.managed=true -q | xargs docker rm -f
513+
```
514+
515+
**Docker recovery taking too long:**
516+
- Docker recovery uses exponential backoff (2s → 60s intervals)
517+
- This is intentional to avoid wasting resources while Docker is offline
518+
- You can force an immediate reconnect via the system tray menu
519+
520+
---
521+
460522
## OAuth Authentication Support
461523

462524
MCPProxy provides **seamless OAuth 2.1 authentication** for MCP servers that require user authorization (like Cloudflare AutoRAG, GitHub, etc.):

0 commit comments

Comments
 (0)