-
Notifications
You must be signed in to change notification settings - Fork 87
BREAKING CHANGE: introducing mcpm v2 #202
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
Conversation
614f6bf to
d1aa74d
Compare
PR Reviewer Guide 🔍(Review updated until commit 396fb81)Here are some key observations to aid the review process:
|
PR Code Suggestions ✨Latest suggestions up to 396fb81
Previous suggestions✅ Suggestions up to commit 614f6bf
|
||||||||||||||||||||||||||||||||||||
Remove legacy router daemon and active profile concepts while maintaining all v2 command functionalities. Profiles now work as virtual tags only. ## Major Changes ### Removed Router Infrastructure - Router command and all subcommands (mcpm router on/off/status/set/share/unshare) - Router daemon functionality (/src/mcpm/router/ directory) - Router configuration management methods - Router-based tunneling and sharing ### Removed Active Profile Concept - activate_profile() and deactivate_profile() methods from client managers - client_add_profile() function that used router for profile activation - Router server formatting utilities ### Preserved Core Functionality - All v2 commands work as before (mcpm install, mcpm profile, mcpm share, etc.) - Profile system now works as virtual tags only - FastMCP-based sharing via mcpm share and mcpm profile share - Client configuration management ### Backward Compatibility - Created minimal RouterConfig class for FastMCP middleware compatibility - Created simple Tunnel class to replace router-based tunneling - Updated imports throughout codebase - Fixed all tests (113 passing) ### Technical Details - No daemon processes required anymore - Sharing uses FastMCP proxies directly - Profile activation shows proper error message for v2.0 - Updated connection URLs to show streamable HTTP and SSE endpoints 🤖 Generated with [Claude Code](https://claude.ai/code) Co-Authored-By: Claude <[email protected]>
- Fixed 760 linting issues automatically with ruff check --fix --unsafe-fixes - Formatted 36 files with ruff format for consistent code style - Removed unused variables and improved code quality - Fixed whitespace, trailing spaces, and formatting inconsistencies - All 113 tests still passing after formatting 🤖 Generated with [Claude Code](https://claude.ai/code) Co-Authored-By: Claude <[email protected]>
- Add --verbose/-v flag for detailed server configurations - Show only server names and profiles by default for cleaner output - Change "tags" to "profiles" in UI for better user understanding - Remove duplicate server names (shown only once) - Highlight profile names in bright yellow for better visibility - Add helpful tip about -v flag when not using verbose mode - Maintain backward compatibility with show_name parameter 🤖 Generated with [Claude Code](https://claude.ai/code) Co-Authored-By: Claude <[email protected]>
- Add profile support to client edit and ls commands - Implement mixed selection UI allowing both profiles and servers - Replace color coding with emoji icons (📦 for profiles, 🔧 for servers) - Add conflict detection to prevent duplicate servers across profiles - Implement retry loop for better UX when conflicts occur - Show blank instead of "No description" for servers without descriptions - Display actual server names in profile descriptions - Update tests to reflect new table structure with profiles column 🤖 Generated with [Claude Code](https://claude.ai/code) Co-Authored-By: Claude <[email protected]>
- Add new mcpm edit command for interactive server configuration editing - Support STDIO servers (command, args, env) and remote servers (URL, headers) - Interactive form-based editing with InquirerPy for better UX - Real-time validation and confirmation before applying changes - Graceful fallback with clear messaging in non-terminal environments - Comprehensive test suite with proper error handling - Clean, single-file implementation for maintainability 🤖 Generated with [Claude Code](https://claude.ai/code) Co-Authored-By: Claude <[email protected]>
Adds two new arguments to enhance the edit command functionality: - -N/--new: Interactive creation of new server configurations - -e/--editor: Opens global config file in external editor Also fixes help formatting and config path reference bug. 🤖 Generated with [Claude Code](https://claude.ai/code) Co-Authored-By: Claude <[email protected]>
Implements a global error handler using a decorator to catch all unhandled exceptions. This improves user experience by providing a clear message and a link to the GitHub issues page. Tracebacks are now pretty-printed using the 'rich' library for better readability and easier debugging.
Adds a GEMINI.md file to document project-specific conventions for the Gemini assistant. This includes instructions to use 'ruff' for formatting and 'uv' for dependency management.
Adds links to the GitHub Issues and Discussions pages in the main help documentation. This makes it easier for users to report bugs, request features, or provide feedback.
- Remove active_client, active_target, and active_profile concepts - Remove stashed_servers functionality - Remove save_share_config and read_share_config methods - Simplify ClientConfigManager to only essential methods - Update client ls command to remove ACTIVE indicator - Fix all tests to work without outdated concepts - Update test fixtures to use config_path_override parameter 🤖 Generated with Claude Code Co-Authored-By: Claude <[email protected]>
- Add V1ConfigDetector to identify v1 configurations with smart detection - Add V1ToV2Migrator with progressive disclosure migration prompts - Support three migration paths: migrate, start fresh, or ignore - Create timestamped backups in ~/.config/mcpm/backups/ with documentation - Migrate v1 profiles to v2 virtual profiles with global servers - Handle stashed servers with restore or documentation options - Remove v1 config.json completely after migration (not just null values) - Exclude auth.json from v1 detection as it's a v2 feature - Add cross-platform "press any key" functionality - Integrate migration check into all CLI commands - Add manual migration command: mcpm migrate 🤖 Generated with [Claude Code](https://claude.ai/code) Co-Authored-By: Claude <[email protected]>
This commit completes the middleware consolidation by removing deprecated components and switching to a unified event-driven architecture: **Removed old middleware classes:** - MCPMMonitoringMiddleware -> replaced by MCPMUnifiedTrackingMiddleware - MCPMUsageTrackingMiddleware -> replaced by MCPMUnifiedTrackingMiddleware **Removed deprecated database code:** - usage_sessions table and all related queries - track_session method from AccessMonitor interface - session_tracker.py module and its exports **Updated tracking approach:** - All tracking now uses events (SESSION_START/SESSION_END) with session_id linking - Usage statistics computed at query time from events table - Simplified method delegation to computed stats - Maintained backward compatibility for metadata formats **Benefits:** - Single unified middleware handles all tracking automatically - Event-driven architecture enables rich analytics - Simplified codebase with consistent patterns - Better session correlation via session_id All tests pass and usage command works correctly with computed statistics. 🤖 Generated with [Claude Code](https://claude.ai/code) Co-Authored-By: Claude <[email protected]>
This commit enhances the CLI experience with rich-click integration, providing modern, colorful, and well-organized help screens. **Added rich-click integration:** - Added rich-click>=1.8.0 dependency - Created comprehensive configuration in utils/rich_click_config.py - Updated all 26 command files to use rich-click module - Preserved custom main help with ASCII art while enhancing subcommands **Enhanced CLI features:** - Beautiful colored output with syntax highlighting - Arguments and options in bordered boxes for clarity - Consistent color scheme (cyan for options/commands, yellow for metavars) - Smart width handling and better typography - Enhanced error messages with helpful suggestions - Professional formatting matching modern CLI tools **Code quality improvements:** - Applied ruff formatting to all Python files - Fixed all linting issues (unused variables, trailing whitespace) - Fixed test failures for changed output format - Cleaned up imports and formatting inconsistencies **Benefits:** - More intuitive and visually appealing help screens - Better organization of command options and arguments - Consistent styling across all commands - Improved readability with proper spacing and colors - Modern CLI experience while maintaining MCPM branding All tests pass (122 passed, 6 skipped). 🤖 Generated with [Claude Code](https://claude.ai/code) Co-Authored-By: Claude <[email protected]>
- Remove inspector command and related code (separate from inspect command) - Reorganize command groups with new structure: * Server Execution: run, share, inspect, usage * Reorder: Server Management → Server Execution → Client → Profile → System & Configuration * Move migrate to System & Configuration group * Remove empty Advanced Tools group - Update CLI imports and command registration - Clean up test files for removed inspector functionality - Update migration help text references 🤖 Generated with [Claude Code](https://claude.ai/code) Co-Authored-By: Claude <[email protected]>
- Update main CLI description to be more direct about MCPM capabilities - Improve client and profile command descriptions with specific examples - Add consistent grey-purple footer to all commands for GitHub issues - Remove header/footer from subcommands while keeping for main CLI help - Implement custom help handling for main command with proper header/footer display - Remove duplicate information and streamline footer messaging - Use Text objects instead of markup strings to fix rendering issues Key improvements: - Main CLI: Centralized MCP server management with clear value proposition - Client command: Explains MCP clients and supported applications - Profile command: Describes workflow organization with concrete examples - Consistent support footer across all commands with proper styling - Clean main command help with ASCII art header and minimal footer 🤖 Generated with [Claude Code](https://claude.ai/code) Co-Authored-By: Claude <[email protected]>
Remove unused configuration fields and deprecated modules: - Remove deprecated REQUIRED_FIELDS and OPTIONAL_FIELDS ClassVar from FullServerConfig - Delete deprecated server_config.py module - Remove deprecated --target options from add.py and list.py commands - Fix import order and remove unused variables to pass ruff checks - Update test expectations for new help output format - Restore rich-click command grouping configuration 🤖 Generated with [Claude Code](https://claude.ai/code) Co-Authored-By: Claude <[email protected]>
PR SummaryLarge-scale refactor that removes the legacy router/middleware stack and replaces it with a unified, event-driven tracking system. Adds FastMCP integration, global config, new CLI command groups (profile, usage, migrate, etc.), switches monitoring from DuckDB to SQLite, updates docs/tests, and cleans up obsolete code. ReviewGreat cleanup and architectural simplification! A few points to double-check before merge:
Overall, the consolidation and new features are very welcome—just tighten the migration and docs for a smooth upgrade. |
Previously, ProfileConfigManager would automatically migrate v1 profiles.json files on initialization, which happened before users confirmed they wanted to migrate. This caused profiles to be migrated prematurely. Changes: - Removed automatic migration from ProfileConfigManager.__init__ - Removed unused _migrate_legacy_profiles methods from ProfileConfigManager - Added create_profile() method to ProfileConfigManager for V1ToV2Migrator - Updated V1ToV2Migrator to also remove profiles.json after migration - Updated test to reflect that ProfileConfigManager no longer auto-migrates - Fixed ASCII art logo spacing in cli.py and rich_click_config.py Now profile migration only happens after user explicitly chooses to migrate via the V1ToV2Migrator prompt. 🤖 Generated with [Claude Code](https://claude.ai/code) Co-Authored-By: Claude <[email protected]>
Comprehensive documentation overhaul to reflect the new v2.0 architecture and commands. Based on the actual CLI help output and current implementation. Changes: - Removed MCPM_Command_Specification.md (no longer needed) - Updated MIGRATION_GUIDE.md with accurate migration flow and options - Updated README.md with correct v2.0 command structure and features - Updated docs/advanced_features.md for v2.0 FastMCP integration - Updated docs/router_share.md for new sharing system (no separate router) All documentation now accurately reflects: - Global configuration model with virtual profiles - Correct command names and options from CLI help - v2.0 migration process with user confirmation - FastMCP-based sharing instead of router daemon - Client integration features - Current feature set without deprecated v1 concepts 🤖 Generated with [Claude Code](https://claude.ai/code) Co-Authored-By: Claude <[email protected]>
Comprehensive update of all documentation to accurately reflect the v2.0 implementation and command structure based on actual CLI help output. Major changes: - Removed MCPM_Command_Specification.md (no longer needed) - Completely rewrote MIGRATION_GUIDE.md to match actual migration flow - Updated README.md with correct v2.0 command structure and features - Updated README.zh-CN.md to match English version with v2.0 content - Rewrote docs/advanced_features.md for FastMCP integration - Updated docs/router_share.md for new sharing system (no router daemon) - Completely rewrote docs/router_tech_design.md for v2.0 architecture Key updates: - Global configuration model with virtual profiles - Correct command names from CLI help (install/uninstall vs add/rm) - v2.0 migration process with user confirmation options - FastMCP-based execution and sharing instead of router daemon - Client integration commands (mcpm client ls/edit/import) - Removed all deprecated v1 target-based concepts - Updated Chinese documentation to match English version - Consistent terminology and examples throughout All documentation now accurately reflects the current v2.0 implementation without any outdated v1 references. 🤖 Generated with [Claude Code](https://claude.ai/code) Co-Authored-By: Claude <[email protected]>
|
🎉 This PR is included in version 2.0.0 🎉 The release is available on GitHub release Your semantic-release bot 📦🚀 |
PR Type
Enhancement, Tests, Bug fix
Description
• Complete architectural overhaul from MCPM v1 to v2, introducing global server configuration management and virtual profile system
• Implemented comprehensive v1 to v2 migration system with interactive prompts, backup creation, and conflict detection
• Added FastMCP integration replacing mcp-proxy, including authentication, middleware, and proxy factory for server aggregation
• Introduced SQLite-based access monitoring with async event tracking, session management, and usage analytics
• Created interactive command interfaces using InquirerPy for server/profile selection, editing, and configuration management
• Added new commands:
edit(interactive server editor),inspect(MCP Inspector integration),usage(analytics), and profile sharing• Implemented secure tunneling system for public server sharing with authentication and port management
• Deprecated v1 commands (stash, pop, mv, cp, target) with proper migration guidance and error messages
• Updated all client managers and configurations to align with v2 architecture
• Comprehensive test suite updates covering new functionality, migration system, and deprecated command handling
Changes walkthrough 📝
18 files
client.py
Complete rewrite of client commands for v2 architecturesrc/mcpm/commands/client.py
• Complete rewrite of client command functionality from v1 to v2
architecture
• Added interactive server/profile selection using
InquirerPy with checkbox interface
• Implemented new client import
functionality to migrate server configurations
• Added support for
MCPM profiles and individual server management in client configs
v1_migrator.py
New v1 to v2 migration system implementationsrc/mcpm/migration/v1_migrator.py
• New migration system to handle v1 to v2 configuration upgrades
•
Interactive migration prompts with comprehensive user guidance
•
Backup creation and cleanup functionality for v1 configurations
•
Profile and server migration with conflict detection
share.py
Modernized share command with FastMCP integrationsrc/mcpm/commands/share.py
• Replaced mcp-proxy dependency with FastMCP proxy integration
• Added
authentication support with API key generation
• Simplified server
sharing using global configuration lookup
• Improved error handling
and async operation support
edit.py
Interactive Server Configuration Editor Implementationsrc/mcpm/commands/edit.py
• Added comprehensive interactive server configuration editor with
InquirerPy forms
• Supports editing existing servers, creating new
servers, and opening global config in external editor
• Includes
validation, confirmation prompts, and real-time feedback for server
properties
• Handles both STDIO and Remote server types with
type-specific configuration fields
sqlite.py
SQLite Access Monitor with Async Event Trackingsrc/mcpm/monitor/sqlite.py
• Implemented SQLite-based access monitoring with async operations
using thread pools
• Added comprehensive event tracking for sessions,
tools, resources, and prompts
• Includes database schema with proper
indexing and WAL mode for performance
• Computes usage statistics from
events rather than separate session tracking
cli.py
CLI Restructure for MCPM V2.0 Architecturesrc/mcpm/cli.py
• Major CLI restructure for MCPM v2.0 with simplified global
configuration model
• Removed active target system, added v1 to v2
migration detection and prompts
• Added deprecated command handlers
with migration guidance for removed commands
• Updated command
registration and help system for new architecture
middleware.py
FastMCP Middleware for Authentication and Trackingsrc/mcpm/fastmcp_integration/middleware.py
• Added FastMCP middleware for MCPM authentication and unified
tracking
• Implements session-level analytics with request origin
classification
• Includes comprehensive event tracking for tools,
resources, and prompts
• Provides client IP extraction and origin
detection for security monitoring
global_config.py
Global Server Configuration Manager Implementationsrc/mcpm/global_config.py
• Implemented global server configuration manager for MCPM v2.0
•
Manages centralized server registry with virtual profile tagging
system
• Includes profile metadata management and server-to-profile
relationships
• Provides comprehensive server lifecycle management
with JSON persistence
proxy.py
FastMCP Proxy Factory for Server Aggregationsrc/mcpm/fastmcp_integration/proxy.py
• Created FastMCP proxy factory for MCPM server aggregation
• Supports
both STDIO and Remote server configurations with proper middleware
integration
• Includes authentication and monitoring middleware setup
for proxy instances
• Provides convenience functions for profile-based
and server-based proxy creation
usage.py
Enhanced usage analytics command with SQLite integrationsrc/mcpm/commands/usage.py
• Added comprehensive usage analytics command with SQLite backend
•
Displays server/profile statistics, session data, and activity
patterns
• Supports filtering by days, server name, or profile name
•
Includes rich formatting with tables and panels for data visualization
profile_config.py
Virtual profile system migration with backward compatibilitysrc/mcpm/profile/profile_config.py
• Migrated from file-based profiles to virtual profile system using
server tags
• Added backward compatibility for legacy
profiles.jsonmigration
• Implemented profile metadata management and server tagging
functionality
• Enhanced profile operations with global configuration
integration
tunnel.py
Tunnel implementation for secure public sharingsrc/mcpm/core/tunnel.py
• Added complete tunnel implementation for sharing functionality
•
Includes binary download, checksum verification, and process
management
• Supports HTTP/HTTPS tunneling with configurable
parameters
• Implements frpc client integration for secure public
access
share.py
Profile sharing command with secure tunnelingsrc/mcpm/commands/profile/share.py
• Added profile sharing command with FastMCP proxy integration
•
Implements secure tunneling with optional authentication
• Supports
multiple servers in a profile with unified endpoint
• Includes port
management and public URL generation
v1_detector.py
V1 configuration detection and backup systemsrc/mcpm/migration/v1_detector.py
• Added v1 configuration detection and analysis functionality
•
Implements backup creation with timestamped directories
• Provides
detailed analysis of v1 features and migration requirements
• Includes
comprehensive documentation generation for backups
inspect.py
MCP Inspector command with server integrationsrc/mcpm/commands/inspect.py
• Added inspect command for launching MCP Inspector with server
configurations
• Supports both specific server inspection and raw
inspector mode
• Integrates with global configuration for server
discovery
• Includes comprehensive error handling and user guidance
base.py
Enhanced monitoring base with session tracking and statisticssrc/mcpm/monitor/base.py
• Enhanced monitoring base classes with session tracking and usage
statistics
• Added new event types for session management and
transport tracking
• Implemented comprehensive statistics models for
servers and profiles
• Extended abstract methods for usage analytics
and reporting
add.py
Migrated add command to global configuration modelsrc/mcpm/commands/target_operations/add.py
• Migrated add command to use global configuration instead of
client-specific configs
• Deprecated target parameter and simplified
installation flow
• Removed profile-to-client functionality in favor
of global server management
• Updated command description and examples
for v2.0 architecture
edit.py
Interactive profile editing command with modern UIsrc/mcpm/commands/profile/edit.py
• Added interactive profile editing command with modern UI
• Supports
both interactive form-based editing and non-interactive options
•
Implements server selection with search and checkbox interface
•
Includes profile renaming and server tagging functionality
1 files
get_manifest.py
Code formatting and style improvementsscripts/get_manifest.py
• Code formatting improvements with consistent spacing and line breaks
• Simplified string concatenation and parameter formatting
• Removed
redundant whitespace and improved readability
8 files
test_stash_pop.py
Updated tests for deprecated v1 commandstests/test_stash_pop.py
• Replaced comprehensive stash/pop functionality tests with
deprecation error tests
• Added tests for deprecated commands (stash,
pop, mv, cp, target)
• Simplified test structure to verify proper
deprecation messages
test_profile.py
Virtual Profile System Test Updatestests/test_profile.py
• Updated tests for virtual profile system migration from legacy
profiles.json
• Added tests for profile metadata functionality and
server tagging system
• Includes legacy migration testing and virtual
profile-specific features
• Tests profile operations like creation,
deletion, renaming with global server management
test_client.py
Client Command Tests for V2.0 Architecturetests/test_client.py
• Updated client command tests for new v2.0 architecture without
active client concept
• Modified tests to handle client-specific
server management and MCPM server detection
• Added verbose flag
testing and mixed server type handling (MCPM vs other servers)
•
Updated command signatures to match new client management approach
test_run.py
Test suite for v2.0 run command functionalitytests/test_run.py
• Added comprehensive tests for v2.0 run command with global
configuration
• Tests server execution, error handling, and usage
recording
• Includes tests for missing servers, interrupts, and
command validation
• Note: Tests marked as skipped pending FastMCP
proxy architecture update
test_access_monitor.py
Updated access monitor tests for SQLite backendtests/test_access_monitor.py
• Updated tests to use
SQLiteAccessMonitorinstead ofDuckDBAccessMonitor• Modified test assertions to work with new query
response format
• Updated event querying to use monitor's
query_eventsmethod
• Enhanced test coverage for metadata handling and backward
compatibility
test_migration.py
Migration system test suite for v1 to v2 upgradetests/test_migration.py
• Added comprehensive test suite for v1 to v2 migration system
• Tests
configuration detection, backup creation, and migration logic
•
Includes tests for profile migration and stashed server handling
•
Validates CLI integration and start-fresh functionality
test_remove.py
Updated remove command tests for global configurationtests/test_remove.py
• Updated remove command tests for v2.0 global configuration model
•
Replaced client-specific tests with global configuration tests
• Added
tests for server removal, confirmation, and error handling
•
Simplified test structure to match new architecture
test_inspect.py
Inspect command test suite with global configurationtests/test_inspect.py
• Added comprehensive test suite for inspect command functionality
•
Tests server inspection, error handling, and raw inspector mode
•
Includes tests for missing servers, interrupts, and permission errors
• Validates integration with global configuration system
1 files
test_windsurf.py
Updated client manager parameter nametests/test_clients/test_windsurf.py
• Updated parameter name from
config_pathtoconfig_path_override•
Minor API change to align with new client manager interface
3 files
client_config.py
Simplified client configuration manager for v2.0src/mcpm/clients/client_config.py
• Simplified client configuration manager by removing scope-related
functionality
• Removed unused imports and methods related to v1
architecture
• Streamlined class to focus on core client configuration
management
claude_desktop.py
Updated Claude Desktop manager constructor parameterssrc/mcpm/clients/managers/claude_desktop.py
• Updated constructor parameter from
config_pathtoconfig_path_override• Removed router server import that's no longer
needed
• Maintained backward compatibility while aligning with new
architecture
goose.py
Updated Goose client manager constructor parameterssrc/mcpm/clients/managers/goose.py
• Updated constructor parameter from
config_pathtoconfig_path_override• Aligned parameter naming with other client
managers
• Maintained existing functionality while improving
consistency
80 files