-
Notifications
You must be signed in to change notification settings - Fork 70
feat: Add native Docker integration to MCPM #204
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
feat: Add native Docker integration to MCPM #204
Conversation
- Add 'mcpm docker' command group with sync, status, deploy, generate subcommands - Implement DockerIntegration class for Docker Compose orchestration - Add DockerSyncOperations for bidirectional profile ↔ Docker sync - Support PostgreSQL, Context7, GitHub, Obsidian server types - Include comprehensive test suite with 21 passing tests - Add RFC document outlining architecture and implementation plan - Maintain full backward compatibility with existing MCPM functionality This enables seamless container orchestration alongside MCPM's client management, bridging development and production deployment workflows.
PR Reviewer Guide 🔍Here are some key observations to aid the review process:
|
PR Code Suggestions ✨Explore these optional code suggestions:
|
🔒 Security Improvements: - Remove weak default credentials, require explicit environment variables - Fix Docker network connections to use service names instead of localhost - Add environment variable validation with warnings for missing credentials - Validate required vars: POSTGRES_USER, POSTGRES_PASSWORD, GITHUB_TOKEN, etc. 🐛 Logic Fixes: - Implement proper change detection using file/profile hashes - Replace always-true methods with real MD5-based change tracking - Add robust JSON parsing with error handling for malformed output - Include stderr in subprocess error messages for better debugging 🛠️ Error Handling: - Add graceful handling of malformed JSON in docker-compose output - Enhanced subprocess error reporting with detailed stderr - Better connection string parsing for Docker environment variables ✨ User Experience: - Add consistent -h, --help patterns with examples - Improved CLI documentation and usage examples - Better warning messages for configuration issues 🧪 Testing: - Add 7 new test cases for security and error handling - Test environment variable validation - Test change detection functionality - Test malformed JSON parsing - Total: 28 tests passing (up from 21) Addresses all security concerns and logic issues identified in bot review. Maintains 100% backward compatibility while improving robustness.
🛠️ Addressed Automated Review FindingsUpdated the implementation to address all issues identified in the automated review: 🔒 Security Improvements
🐛 Logic & Error Handling
✨ CLI & UX
🧪 Testing
All changes maintain 100% backward compatibility. |
self.profile_manager = ProfileConfigManager() | ||
|
||
# Server-to-Docker service mappings | ||
self.server_mappings = { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
are these the only mcpm servers supported by this docker command? i wonder if there is a more scalable way to do this for more mcp servers.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
hmm, it should support anything that mcpm already allows, but it may have been implemented wrong. A lot of this logic is based on some wrappers I wrote around mcpm to synchronize it with a docker-compose mcp hub system, so some of that logic may have been lost in translation. I'll give it another look-over today.
User description
Summary
This PR adds native Docker integration to MCPM, enabling seamless orchestration between MCP server profiles and Docker Compose services with bidirectional synchronization.
Features Added
🐳 New
mcpm docker
Command Groupmcpm docker sync PROFILE_NAME
- Sync profile to Docker Composemcpm docker status
- Show Docker integration statusmcpm docker deploy [SERVICES...]
- Deploy Docker servicesmcpm docker generate PROFILE_NAME
- Generate Docker Compose from profile🔄 Bidirectional Synchronization
🏗️ Production-Ready Architecture
mcp-network
Implementation
Core Components
DockerIntegration
class for Docker operations orchestrationDockerSyncOperations
class for bidirectional sync with conflict resolutionBackward Compatibility
Testing
Documentation
Value Proposition
This transforms MCPM from a client-side tool into a full-stack MCP orchestration platform, enabling:
The implementation maintains MCPM's core strengths while adding powerful containerization capabilities that bridge the gap between development and production.
PR Type
Enhancement
Description
Add native Docker integration with
mcpm docker
command groupImplement bidirectional sync between profiles and Docker Compose
Support PostgreSQL, Context7, GitHub, Obsidian server types
Include comprehensive test suite with 21 passing tests
Changes diagram
Changes walkthrough 📝
3 files
Add docker command to CLI
Implement Docker integration commands
Add bidirectional Docker sync operations
2 files
Add comprehensive Docker integration tests
Add test Docker Compose configuration
1 files
Set Python version to 3.11.11
1 files
Add Docker integration RFC document