claude-mpm 4.1.0__py3-none-any.whl → 4.1.2__py3-none-any.whl
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- claude_mpm/BUILD_NUMBER +1 -1
- claude_mpm/VERSION +1 -1
- claude_mpm/__main__.py +1 -1
- claude_mpm/agents/BASE_PM.md +74 -46
- claude_mpm/agents/INSTRUCTIONS.md +11 -153
- claude_mpm/agents/WORKFLOW.md +61 -321
- claude_mpm/agents/__init__.py +11 -11
- claude_mpm/agents/agent_loader.py +23 -20
- claude_mpm/agents/agent_loader_integration.py +1 -1
- claude_mpm/agents/agents_metadata.py +27 -0
- claude_mpm/agents/async_agent_loader.py +5 -8
- claude_mpm/agents/base_agent_loader.py +36 -25
- claude_mpm/agents/frontmatter_validator.py +6 -6
- claude_mpm/agents/schema/agent_schema.json +1 -1
- claude_mpm/agents/system_agent_config.py +9 -9
- claude_mpm/agents/templates/api_qa.json +47 -2
- claude_mpm/agents/templates/imagemagick.json +256 -0
- claude_mpm/agents/templates/qa.json +41 -2
- claude_mpm/agents/templates/ticketing.json +5 -5
- claude_mpm/agents/templates/web_qa.json +133 -58
- claude_mpm/agents/templates/web_ui.json +3 -3
- claude_mpm/cli/__init__.py +51 -46
- claude_mpm/cli/__main__.py +1 -1
- claude_mpm/cli/commands/__init__.py +10 -12
- claude_mpm/cli/commands/agent_manager.py +186 -181
- claude_mpm/cli/commands/agents.py +271 -268
- claude_mpm/cli/commands/aggregate.py +30 -29
- claude_mpm/cli/commands/cleanup.py +50 -44
- claude_mpm/cli/commands/cleanup_orphaned_agents.py +25 -25
- claude_mpm/cli/commands/config.py +162 -127
- claude_mpm/cli/commands/doctor.py +52 -62
- claude_mpm/cli/commands/info.py +37 -25
- claude_mpm/cli/commands/mcp.py +3 -7
- claude_mpm/cli/commands/mcp_command_router.py +14 -18
- claude_mpm/cli/commands/mcp_install_commands.py +28 -23
- claude_mpm/cli/commands/mcp_pipx_config.py +58 -49
- claude_mpm/cli/commands/mcp_server_commands.py +23 -17
- claude_mpm/cli/commands/memory.py +192 -141
- claude_mpm/cli/commands/monitor.py +117 -88
- claude_mpm/cli/commands/run.py +120 -84
- claude_mpm/cli/commands/run_config_checker.py +4 -5
- claude_mpm/cli/commands/socketio_monitor.py +17 -19
- claude_mpm/cli/commands/tickets.py +92 -92
- claude_mpm/cli/parser.py +1 -5
- claude_mpm/cli/parsers/__init__.py +1 -1
- claude_mpm/cli/parsers/agent_manager_parser.py +50 -98
- claude_mpm/cli/parsers/agents_parser.py +2 -3
- claude_mpm/cli/parsers/base_parser.py +7 -5
- claude_mpm/cli/parsers/mcp_parser.py +4 -2
- claude_mpm/cli/parsers/monitor_parser.py +26 -18
- claude_mpm/cli/shared/__init__.py +10 -10
- claude_mpm/cli/shared/argument_patterns.py +57 -71
- claude_mpm/cli/shared/base_command.py +61 -53
- claude_mpm/cli/shared/error_handling.py +62 -58
- claude_mpm/cli/shared/output_formatters.py +78 -77
- claude_mpm/cli/startup_logging.py +204 -172
- claude_mpm/cli/utils.py +10 -11
- claude_mpm/cli_module/__init__.py +1 -1
- claude_mpm/cli_module/args.py +1 -1
- claude_mpm/cli_module/migration_example.py +5 -5
- claude_mpm/config/__init__.py +9 -9
- claude_mpm/config/agent_config.py +15 -14
- claude_mpm/config/experimental_features.py +4 -4
- claude_mpm/config/paths.py +0 -1
- claude_mpm/config/socketio_config.py +5 -6
- claude_mpm/constants.py +1 -2
- claude_mpm/core/__init__.py +8 -8
- claude_mpm/core/agent_name_normalizer.py +1 -1
- claude_mpm/core/agent_registry.py +20 -23
- claude_mpm/core/agent_session_manager.py +3 -3
- claude_mpm/core/base_service.py +7 -15
- claude_mpm/core/cache.py +4 -6
- claude_mpm/core/claude_runner.py +85 -113
- claude_mpm/core/config.py +43 -28
- claude_mpm/core/config_aliases.py +0 -9
- claude_mpm/core/config_constants.py +52 -30
- claude_mpm/core/constants.py +0 -1
- claude_mpm/core/container.py +18 -27
- claude_mpm/core/exceptions.py +2 -2
- claude_mpm/core/factories.py +10 -12
- claude_mpm/core/framework_loader.py +581 -280
- claude_mpm/core/hook_manager.py +26 -22
- claude_mpm/core/hook_performance_config.py +58 -47
- claude_mpm/core/injectable_service.py +1 -1
- claude_mpm/core/interactive_session.py +61 -152
- claude_mpm/core/interfaces.py +1 -100
- claude_mpm/core/lazy.py +5 -5
- claude_mpm/core/log_manager.py +587 -0
- claude_mpm/core/logger.py +125 -8
- claude_mpm/core/logging_config.py +15 -15
- claude_mpm/core/minimal_framework_loader.py +5 -8
- claude_mpm/core/oneshot_session.py +15 -33
- claude_mpm/core/optimized_agent_loader.py +4 -6
- claude_mpm/core/optimized_startup.py +2 -1
- claude_mpm/core/output_style_manager.py +147 -106
- claude_mpm/core/pm_hook_interceptor.py +0 -1
- claude_mpm/core/service_registry.py +11 -8
- claude_mpm/core/session_manager.py +1 -2
- claude_mpm/core/shared/__init__.py +1 -1
- claude_mpm/core/shared/config_loader.py +101 -97
- claude_mpm/core/shared/path_resolver.py +72 -68
- claude_mpm/core/shared/singleton_manager.py +56 -50
- claude_mpm/core/socketio_pool.py +26 -6
- claude_mpm/core/tool_access_control.py +4 -5
- claude_mpm/core/typing_utils.py +50 -59
- claude_mpm/core/unified_agent_registry.py +14 -19
- claude_mpm/core/unified_config.py +4 -6
- claude_mpm/core/unified_paths.py +197 -109
- claude_mpm/dashboard/open_dashboard.py +2 -4
- claude_mpm/experimental/cli_enhancements.py +51 -36
- claude_mpm/generators/agent_profile_generator.py +2 -4
- claude_mpm/hooks/base_hook.py +1 -2
- claude_mpm/hooks/claude_hooks/connection_pool.py +72 -26
- claude_mpm/hooks/claude_hooks/event_handlers.py +93 -38
- claude_mpm/hooks/claude_hooks/hook_handler.py +130 -76
- claude_mpm/hooks/claude_hooks/hook_handler_eventbus.py +104 -77
- claude_mpm/hooks/claude_hooks/memory_integration.py +2 -4
- claude_mpm/hooks/claude_hooks/response_tracking.py +15 -11
- claude_mpm/hooks/claude_hooks/tool_analysis.py +12 -18
- claude_mpm/hooks/memory_integration_hook.py +5 -5
- claude_mpm/hooks/tool_call_interceptor.py +1 -1
- claude_mpm/hooks/validation_hooks.py +4 -4
- claude_mpm/init.py +4 -9
- claude_mpm/models/__init__.py +2 -2
- claude_mpm/models/agent_session.py +11 -14
- claude_mpm/scripts/mcp_server.py +20 -11
- claude_mpm/scripts/mcp_wrapper.py +5 -5
- claude_mpm/scripts/mpm_doctor.py +321 -0
- claude_mpm/scripts/socketio_daemon.py +28 -25
- claude_mpm/scripts/socketio_daemon_hardened.py +298 -258
- claude_mpm/scripts/socketio_server_manager.py +116 -95
- claude_mpm/services/__init__.py +49 -49
- claude_mpm/services/agent_capabilities_service.py +12 -18
- claude_mpm/services/agents/__init__.py +22 -22
- claude_mpm/services/agents/agent_builder.py +140 -119
- claude_mpm/services/agents/deployment/__init__.py +3 -3
- claude_mpm/services/agents/deployment/agent_config_provider.py +9 -9
- claude_mpm/services/agents/deployment/agent_configuration_manager.py +19 -20
- claude_mpm/services/agents/deployment/agent_definition_factory.py +1 -5
- claude_mpm/services/agents/deployment/agent_deployment.py +136 -106
- claude_mpm/services/agents/deployment/agent_discovery_service.py +4 -8
- claude_mpm/services/agents/deployment/agent_environment_manager.py +2 -7
- claude_mpm/services/agents/deployment/agent_filesystem_manager.py +6 -10
- claude_mpm/services/agents/deployment/agent_format_converter.py +11 -15
- claude_mpm/services/agents/deployment/agent_frontmatter_validator.py +2 -3
- claude_mpm/services/agents/deployment/agent_lifecycle_manager.py +5 -5
- claude_mpm/services/agents/deployment/agent_metrics_collector.py +13 -19
- claude_mpm/services/agents/deployment/agent_restore_handler.py +0 -1
- claude_mpm/services/agents/deployment/agent_template_builder.py +26 -35
- claude_mpm/services/agents/deployment/agent_validator.py +0 -1
- claude_mpm/services/agents/deployment/agent_version_manager.py +7 -9
- claude_mpm/services/agents/deployment/agent_versioning.py +3 -3
- claude_mpm/services/agents/deployment/agents_directory_resolver.py +6 -7
- claude_mpm/services/agents/deployment/async_agent_deployment.py +51 -38
- claude_mpm/services/agents/deployment/config/__init__.py +1 -1
- claude_mpm/services/agents/deployment/config/deployment_config.py +7 -8
- claude_mpm/services/agents/deployment/deployment_type_detector.py +1 -1
- claude_mpm/services/agents/deployment/deployment_wrapper.py +18 -18
- claude_mpm/services/agents/deployment/facade/__init__.py +1 -1
- claude_mpm/services/agents/deployment/facade/deployment_executor.py +0 -3
- claude_mpm/services/agents/deployment/facade/deployment_facade.py +3 -4
- claude_mpm/services/agents/deployment/interface_adapter.py +5 -7
- claude_mpm/services/agents/deployment/multi_source_deployment_service.py +345 -276
- claude_mpm/services/agents/deployment/pipeline/__init__.py +2 -2
- claude_mpm/services/agents/deployment/pipeline/pipeline_builder.py +1 -1
- claude_mpm/services/agents/deployment/pipeline/pipeline_context.py +6 -4
- claude_mpm/services/agents/deployment/pipeline/pipeline_executor.py +3 -3
- claude_mpm/services/agents/deployment/pipeline/steps/__init__.py +2 -2
- claude_mpm/services/agents/deployment/pipeline/steps/agent_processing_step.py +14 -13
- claude_mpm/services/agents/deployment/pipeline/steps/base_step.py +0 -1
- claude_mpm/services/agents/deployment/pipeline/steps/configuration_step.py +1 -1
- claude_mpm/services/agents/deployment/pipeline/steps/target_directory_step.py +8 -9
- claude_mpm/services/agents/deployment/pipeline/steps/validation_step.py +1 -1
- claude_mpm/services/agents/deployment/processors/__init__.py +1 -1
- claude_mpm/services/agents/deployment/processors/agent_processor.py +20 -16
- claude_mpm/services/agents/deployment/refactored_agent_deployment_service.py +5 -12
- claude_mpm/services/agents/deployment/results/__init__.py +1 -1
- claude_mpm/services/agents/deployment/results/deployment_result_builder.py +1 -1
- claude_mpm/services/agents/deployment/strategies/__init__.py +2 -2
- claude_mpm/services/agents/deployment/strategies/base_strategy.py +1 -7
- claude_mpm/services/agents/deployment/strategies/project_strategy.py +1 -4
- claude_mpm/services/agents/deployment/strategies/system_strategy.py +2 -3
- claude_mpm/services/agents/deployment/strategies/user_strategy.py +3 -7
- claude_mpm/services/agents/deployment/validation/__init__.py +1 -1
- claude_mpm/services/agents/deployment/validation/agent_validator.py +1 -1
- claude_mpm/services/agents/deployment/validation/template_validator.py +2 -2
- claude_mpm/services/agents/deployment/validation/validation_result.py +2 -6
- claude_mpm/services/agents/loading/__init__.py +1 -1
- claude_mpm/services/agents/loading/agent_profile_loader.py +6 -12
- claude_mpm/services/agents/loading/base_agent_manager.py +5 -5
- claude_mpm/services/agents/loading/framework_agent_loader.py +2 -4
- claude_mpm/services/agents/management/__init__.py +1 -1
- claude_mpm/services/agents/management/agent_capabilities_generator.py +1 -3
- claude_mpm/services/agents/management/agent_management_service.py +5 -9
- claude_mpm/services/agents/memory/__init__.py +4 -4
- claude_mpm/services/agents/memory/agent_memory_manager.py +280 -160
- claude_mpm/services/agents/memory/agent_persistence_service.py +0 -2
- claude_mpm/services/agents/memory/content_manager.py +44 -38
- claude_mpm/services/agents/memory/template_generator.py +4 -6
- claude_mpm/services/agents/registry/__init__.py +10 -6
- claude_mpm/services/agents/registry/deployed_agent_discovery.py +30 -27
- claude_mpm/services/agents/registry/modification_tracker.py +3 -6
- claude_mpm/services/async_session_logger.py +1 -2
- claude_mpm/services/claude_session_logger.py +1 -2
- claude_mpm/services/command_deployment_service.py +173 -0
- claude_mpm/services/command_handler_service.py +20 -22
- claude_mpm/services/core/__init__.py +25 -25
- claude_mpm/services/core/base.py +0 -5
- claude_mpm/services/core/interfaces/__init__.py +32 -32
- claude_mpm/services/core/interfaces/agent.py +0 -21
- claude_mpm/services/core/interfaces/communication.py +0 -27
- claude_mpm/services/core/interfaces/infrastructure.py +0 -56
- claude_mpm/services/core/interfaces/service.py +0 -29
- claude_mpm/services/diagnostics/__init__.py +1 -1
- claude_mpm/services/diagnostics/checks/__init__.py +6 -6
- claude_mpm/services/diagnostics/checks/agent_check.py +89 -80
- claude_mpm/services/diagnostics/checks/base_check.py +12 -16
- claude_mpm/services/diagnostics/checks/claude_desktop_check.py +84 -81
- claude_mpm/services/diagnostics/checks/common_issues_check.py +99 -91
- claude_mpm/services/diagnostics/checks/configuration_check.py +82 -77
- claude_mpm/services/diagnostics/checks/filesystem_check.py +67 -68
- claude_mpm/services/diagnostics/checks/installation_check.py +254 -94
- claude_mpm/services/diagnostics/checks/mcp_check.py +90 -88
- claude_mpm/services/diagnostics/checks/monitor_check.py +75 -76
- claude_mpm/services/diagnostics/checks/startup_log_check.py +67 -73
- claude_mpm/services/diagnostics/diagnostic_runner.py +67 -59
- claude_mpm/services/diagnostics/doctor_reporter.py +107 -70
- claude_mpm/services/diagnostics/models.py +21 -19
- claude_mpm/services/event_aggregator.py +10 -17
- claude_mpm/services/event_bus/__init__.py +1 -1
- claude_mpm/services/event_bus/config.py +54 -35
- claude_mpm/services/event_bus/event_bus.py +76 -71
- claude_mpm/services/event_bus/relay.py +74 -64
- claude_mpm/services/events/__init__.py +11 -11
- claude_mpm/services/events/consumers/__init__.py +3 -3
- claude_mpm/services/events/consumers/dead_letter.py +71 -63
- claude_mpm/services/events/consumers/logging.py +39 -37
- claude_mpm/services/events/consumers/metrics.py +56 -57
- claude_mpm/services/events/consumers/socketio.py +82 -81
- claude_mpm/services/events/core.py +110 -99
- claude_mpm/services/events/interfaces.py +56 -72
- claude_mpm/services/events/producers/__init__.py +1 -1
- claude_mpm/services/events/producers/hook.py +38 -38
- claude_mpm/services/events/producers/system.py +46 -44
- claude_mpm/services/exceptions.py +81 -80
- claude_mpm/services/framework_claude_md_generator/__init__.py +2 -4
- claude_mpm/services/framework_claude_md_generator/content_assembler.py +3 -5
- claude_mpm/services/framework_claude_md_generator/content_validator.py +1 -1
- claude_mpm/services/framework_claude_md_generator/deployment_manager.py +4 -4
- claude_mpm/services/framework_claude_md_generator/section_generators/__init__.py +0 -1
- claude_mpm/services/framework_claude_md_generator/section_generators/agents.py +0 -2
- claude_mpm/services/framework_claude_md_generator/version_manager.py +4 -5
- claude_mpm/services/hook_service.py +6 -9
- claude_mpm/services/infrastructure/__init__.py +1 -1
- claude_mpm/services/infrastructure/context_preservation.py +8 -12
- claude_mpm/services/infrastructure/monitoring.py +21 -23
- claude_mpm/services/mcp_gateway/__init__.py +37 -37
- claude_mpm/services/mcp_gateway/auto_configure.py +95 -103
- claude_mpm/services/mcp_gateway/config/__init__.py +1 -1
- claude_mpm/services/mcp_gateway/config/config_loader.py +23 -25
- claude_mpm/services/mcp_gateway/config/config_schema.py +5 -5
- claude_mpm/services/mcp_gateway/config/configuration.py +9 -6
- claude_mpm/services/mcp_gateway/core/__init__.py +10 -10
- claude_mpm/services/mcp_gateway/core/base.py +0 -3
- claude_mpm/services/mcp_gateway/core/interfaces.py +1 -38
- claude_mpm/services/mcp_gateway/core/process_pool.py +99 -93
- claude_mpm/services/mcp_gateway/core/singleton_manager.py +65 -62
- claude_mpm/services/mcp_gateway/core/startup_verification.py +75 -74
- claude_mpm/services/mcp_gateway/main.py +2 -1
- claude_mpm/services/mcp_gateway/registry/service_registry.py +5 -8
- claude_mpm/services/mcp_gateway/registry/tool_registry.py +1 -1
- claude_mpm/services/mcp_gateway/server/__init__.py +1 -1
- claude_mpm/services/mcp_gateway/server/mcp_gateway.py +12 -19
- claude_mpm/services/mcp_gateway/server/stdio_handler.py +4 -3
- claude_mpm/services/mcp_gateway/server/stdio_server.py +79 -71
- claude_mpm/services/mcp_gateway/tools/__init__.py +2 -2
- claude_mpm/services/mcp_gateway/tools/base_adapter.py +5 -6
- claude_mpm/services/mcp_gateway/tools/document_summarizer.py +13 -22
- claude_mpm/services/mcp_gateway/tools/health_check_tool.py +79 -78
- claude_mpm/services/mcp_gateway/tools/hello_world.py +12 -14
- claude_mpm/services/mcp_gateway/tools/ticket_tools.py +42 -49
- claude_mpm/services/mcp_gateway/tools/unified_ticket_tool.py +51 -55
- claude_mpm/services/memory/__init__.py +3 -3
- claude_mpm/services/memory/builder.py +3 -6
- claude_mpm/services/memory/cache/__init__.py +1 -1
- claude_mpm/services/memory/cache/shared_prompt_cache.py +3 -5
- claude_mpm/services/memory/cache/simple_cache.py +1 -1
- claude_mpm/services/memory/indexed_memory.py +5 -7
- claude_mpm/services/memory/optimizer.py +7 -10
- claude_mpm/services/memory/router.py +8 -9
- claude_mpm/services/memory_hook_service.py +48 -34
- claude_mpm/services/monitor_build_service.py +77 -73
- claude_mpm/services/port_manager.py +130 -108
- claude_mpm/services/project/analyzer.py +12 -10
- claude_mpm/services/project/registry.py +11 -11
- claude_mpm/services/recovery_manager.py +10 -19
- claude_mpm/services/response_tracker.py +0 -1
- claude_mpm/services/runner_configuration_service.py +19 -20
- claude_mpm/services/session_management_service.py +7 -11
- claude_mpm/services/shared/__init__.py +1 -1
- claude_mpm/services/shared/async_service_base.py +58 -50
- claude_mpm/services/shared/config_service_base.py +73 -67
- claude_mpm/services/shared/lifecycle_service_base.py +82 -78
- claude_mpm/services/shared/manager_base.py +94 -82
- claude_mpm/services/shared/service_factory.py +96 -98
- claude_mpm/services/socketio/__init__.py +3 -3
- claude_mpm/services/socketio/client_proxy.py +5 -5
- claude_mpm/services/socketio/event_normalizer.py +199 -181
- claude_mpm/services/socketio/handlers/__init__.py +3 -3
- claude_mpm/services/socketio/handlers/base.py +5 -4
- claude_mpm/services/socketio/handlers/connection.py +163 -136
- claude_mpm/services/socketio/handlers/file.py +13 -14
- claude_mpm/services/socketio/handlers/git.py +12 -7
- claude_mpm/services/socketio/handlers/hook.py +49 -44
- claude_mpm/services/socketio/handlers/memory.py +0 -1
- claude_mpm/services/socketio/handlers/project.py +0 -1
- claude_mpm/services/socketio/handlers/registry.py +37 -19
- claude_mpm/services/socketio/migration_utils.py +98 -84
- claude_mpm/services/socketio/server/__init__.py +1 -1
- claude_mpm/services/socketio/server/broadcaster.py +81 -87
- claude_mpm/services/socketio/server/core.py +65 -54
- claude_mpm/services/socketio/server/eventbus_integration.py +95 -56
- claude_mpm/services/socketio/server/main.py +64 -38
- claude_mpm/services/socketio_client_manager.py +10 -12
- claude_mpm/services/subprocess_launcher_service.py +4 -7
- claude_mpm/services/system_instructions_service.py +13 -14
- claude_mpm/services/ticket_manager.py +2 -2
- claude_mpm/services/utility_service.py +5 -13
- claude_mpm/services/version_control/__init__.py +16 -16
- claude_mpm/services/version_control/branch_strategy.py +5 -8
- claude_mpm/services/version_control/conflict_resolution.py +9 -23
- claude_mpm/services/version_control/git_operations.py +5 -7
- claude_mpm/services/version_control/semantic_versioning.py +16 -17
- claude_mpm/services/version_control/version_parser.py +13 -18
- claude_mpm/services/version_service.py +10 -11
- claude_mpm/storage/__init__.py +1 -1
- claude_mpm/storage/state_storage.py +22 -28
- claude_mpm/utils/__init__.py +6 -6
- claude_mpm/utils/agent_dependency_loader.py +47 -33
- claude_mpm/utils/config_manager.py +11 -14
- claude_mpm/utils/dependency_cache.py +1 -1
- claude_mpm/utils/dependency_manager.py +13 -17
- claude_mpm/utils/dependency_strategies.py +8 -10
- claude_mpm/utils/environment_context.py +3 -9
- claude_mpm/utils/error_handler.py +3 -13
- claude_mpm/utils/file_utils.py +1 -1
- claude_mpm/utils/path_operations.py +8 -12
- claude_mpm/utils/robust_installer.py +110 -33
- claude_mpm/utils/subprocess_utils.py +5 -6
- claude_mpm/validation/agent_validator.py +3 -6
- claude_mpm/validation/frontmatter_validator.py +1 -1
- {claude_mpm-4.1.0.dist-info → claude_mpm-4.1.2.dist-info}/METADATA +1 -1
- claude_mpm-4.1.2.dist-info/RECORD +498 -0
- claude_mpm-4.1.0.dist-info/RECORD +0 -494
- {claude_mpm-4.1.0.dist-info → claude_mpm-4.1.2.dist-info}/WHEEL +0 -0
- {claude_mpm-4.1.0.dist-info → claude_mpm-4.1.2.dist-info}/entry_points.txt +0 -0
- {claude_mpm-4.1.0.dist-info → claude_mpm-4.1.2.dist-info}/licenses/LICENSE +0 -0
- {claude_mpm-4.1.0.dist-info → claude_mpm-4.1.2.dist-info}/top_level.txt +0 -0
|
@@ -20,7 +20,7 @@ from ...services.diagnostics import DiagnosticRunner, DoctorReporter
|
|
|
20
20
|
|
|
21
21
|
def add_doctor_parser(subparsers):
|
|
22
22
|
"""Add doctor command parser.
|
|
23
|
-
|
|
23
|
+
|
|
24
24
|
WHY: This command helps users diagnose and fix issues with their
|
|
25
25
|
claude-mpm installation, providing clear actionable feedback.
|
|
26
26
|
"""
|
|
@@ -28,72 +28,67 @@ def add_doctor_parser(subparsers):
|
|
|
28
28
|
"doctor",
|
|
29
29
|
aliases=["diagnose", "check-health"],
|
|
30
30
|
help="Run comprehensive diagnostics on claude-mpm installation",
|
|
31
|
-
description="Run comprehensive health checks on your claude-mpm installation and configuration"
|
|
31
|
+
description="Run comprehensive health checks on your claude-mpm installation and configuration",
|
|
32
32
|
)
|
|
33
|
-
|
|
33
|
+
|
|
34
34
|
parser.add_argument(
|
|
35
35
|
"--verbose",
|
|
36
36
|
"-v",
|
|
37
37
|
action="store_true",
|
|
38
|
-
help="Show detailed diagnostic information"
|
|
38
|
+
help="Show detailed diagnostic information",
|
|
39
39
|
)
|
|
40
|
-
|
|
40
|
+
|
|
41
41
|
parser.add_argument(
|
|
42
|
-
"--json",
|
|
43
|
-
action="store_true",
|
|
44
|
-
help="Output results in JSON format"
|
|
42
|
+
"--json", action="store_true", help="Output results in JSON format"
|
|
45
43
|
)
|
|
46
|
-
|
|
44
|
+
|
|
47
45
|
parser.add_argument(
|
|
48
|
-
"--markdown",
|
|
49
|
-
action="store_true",
|
|
50
|
-
help="Output results in Markdown format"
|
|
46
|
+
"--markdown", action="store_true", help="Output results in Markdown format"
|
|
51
47
|
)
|
|
52
|
-
|
|
48
|
+
|
|
53
49
|
parser.add_argument(
|
|
54
50
|
"--fix",
|
|
55
51
|
action="store_true",
|
|
56
|
-
help="Attempt to fix issues automatically (experimental)"
|
|
52
|
+
help="Attempt to fix issues automatically (experimental)",
|
|
57
53
|
)
|
|
58
|
-
|
|
54
|
+
|
|
59
55
|
parser.add_argument(
|
|
60
56
|
"--checks",
|
|
61
57
|
nargs="+",
|
|
62
58
|
choices=[
|
|
63
|
-
"installation",
|
|
64
|
-
"
|
|
59
|
+
"installation",
|
|
60
|
+
"configuration",
|
|
61
|
+
"filesystem",
|
|
62
|
+
"claude",
|
|
63
|
+
"agents",
|
|
64
|
+
"mcp",
|
|
65
|
+
"monitor",
|
|
66
|
+
"common",
|
|
65
67
|
],
|
|
66
|
-
help="Run only specific checks"
|
|
68
|
+
help="Run only specific checks",
|
|
67
69
|
)
|
|
68
|
-
|
|
70
|
+
|
|
69
71
|
parser.add_argument(
|
|
70
72
|
"--parallel",
|
|
71
73
|
action="store_true",
|
|
72
|
-
help="Run checks in parallel for faster execution"
|
|
74
|
+
help="Run checks in parallel for faster execution",
|
|
73
75
|
)
|
|
74
|
-
|
|
75
|
-
parser.add_argument(
|
|
76
|
-
"--no-color",
|
|
77
|
-
action="store_true",
|
|
78
|
-
help="Disable colored output"
|
|
79
|
-
)
|
|
80
|
-
|
|
76
|
+
|
|
81
77
|
parser.add_argument(
|
|
82
|
-
"--output"
|
|
83
|
-
"-o",
|
|
84
|
-
type=Path,
|
|
85
|
-
help="Save output to file"
|
|
78
|
+
"--no-color", action="store_true", help="Disable colored output"
|
|
86
79
|
)
|
|
87
|
-
|
|
80
|
+
|
|
81
|
+
parser.add_argument("--output", "-o", type=Path, help="Save output to file")
|
|
82
|
+
|
|
88
83
|
parser.set_defaults(func=doctor_command)
|
|
89
84
|
|
|
90
85
|
|
|
91
86
|
def run_doctor(args):
|
|
92
87
|
"""Main entry point for doctor command (used by CLI).
|
|
93
|
-
|
|
88
|
+
|
|
94
89
|
Args:
|
|
95
90
|
args: Parsed command-line arguments
|
|
96
|
-
|
|
91
|
+
|
|
97
92
|
Returns:
|
|
98
93
|
Exit code (0 for success, 1 for warnings, 2 for errors)
|
|
99
94
|
"""
|
|
@@ -102,19 +97,19 @@ def run_doctor(args):
|
|
|
102
97
|
|
|
103
98
|
def doctor_command(args):
|
|
104
99
|
"""Execute the doctor command.
|
|
105
|
-
|
|
100
|
+
|
|
106
101
|
WHY: Provides a single entry point for system diagnostics, helping users
|
|
107
102
|
quickly identify and resolve issues with their claude-mpm setup.
|
|
108
|
-
|
|
103
|
+
|
|
109
104
|
Args:
|
|
110
105
|
args: Parsed command-line arguments
|
|
111
|
-
|
|
106
|
+
|
|
112
107
|
Returns:
|
|
113
108
|
Exit code (0 for success, 1 for warnings, 2 for errors)
|
|
114
109
|
"""
|
|
115
110
|
# Configure logging
|
|
116
111
|
logger = logging.getLogger(__name__)
|
|
117
|
-
|
|
112
|
+
|
|
118
113
|
# Determine output format
|
|
119
114
|
if args.json:
|
|
120
115
|
output_format = "json"
|
|
@@ -122,13 +117,10 @@ def doctor_command(args):
|
|
|
122
117
|
output_format = "markdown"
|
|
123
118
|
else:
|
|
124
119
|
output_format = "terminal"
|
|
125
|
-
|
|
120
|
+
|
|
126
121
|
# Create diagnostic runner
|
|
127
|
-
runner = DiagnosticRunner(
|
|
128
|
-
|
|
129
|
-
fix=args.fix
|
|
130
|
-
)
|
|
131
|
-
|
|
122
|
+
runner = DiagnosticRunner(verbose=args.verbose, fix=args.fix)
|
|
123
|
+
|
|
132
124
|
# Run diagnostics
|
|
133
125
|
try:
|
|
134
126
|
if args.checks:
|
|
@@ -143,57 +135,55 @@ def doctor_command(args):
|
|
|
143
135
|
# Run all checks sequentially
|
|
144
136
|
logger.info("Running comprehensive diagnostics")
|
|
145
137
|
summary = runner.run_diagnostics()
|
|
146
|
-
|
|
138
|
+
|
|
147
139
|
except KeyboardInterrupt:
|
|
148
140
|
print("\nDiagnostics interrupted by user")
|
|
149
141
|
return 130
|
|
150
142
|
except Exception as e:
|
|
151
143
|
logger.error(f"Diagnostic failed: {e}")
|
|
152
|
-
print(f"\n❌ Diagnostic failed: {
|
|
144
|
+
print(f"\n❌ Diagnostic failed: {e!s}")
|
|
153
145
|
if args.verbose:
|
|
154
146
|
import traceback
|
|
147
|
+
|
|
155
148
|
traceback.print_exc()
|
|
156
149
|
return 2
|
|
157
|
-
|
|
150
|
+
|
|
158
151
|
# Create reporter
|
|
159
|
-
reporter = DoctorReporter(
|
|
160
|
-
|
|
161
|
-
verbose=args.verbose
|
|
162
|
-
)
|
|
163
|
-
|
|
152
|
+
reporter = DoctorReporter(use_color=not args.no_color, verbose=args.verbose)
|
|
153
|
+
|
|
164
154
|
# Output results
|
|
165
155
|
if args.output:
|
|
166
156
|
# Save to file
|
|
167
157
|
try:
|
|
168
158
|
import sys
|
|
159
|
+
|
|
169
160
|
original_stdout = sys.stdout
|
|
170
|
-
with open(args.output,
|
|
161
|
+
with open(args.output, "w") as f:
|
|
171
162
|
sys.stdout = f
|
|
172
163
|
reporter.report(summary, format=output_format)
|
|
173
164
|
sys.stdout = original_stdout
|
|
174
165
|
print(f"Report saved to: {args.output}")
|
|
175
166
|
except Exception as e:
|
|
176
167
|
logger.error(f"Failed to save report: {e}")
|
|
177
|
-
print(f"❌ Failed to save report: {
|
|
168
|
+
print(f"❌ Failed to save report: {e!s}")
|
|
178
169
|
# Still output to terminal
|
|
179
170
|
reporter.report(summary, format=output_format)
|
|
180
171
|
else:
|
|
181
172
|
# Output to terminal
|
|
182
173
|
reporter.report(summary, format=output_format)
|
|
183
|
-
|
|
174
|
+
|
|
184
175
|
# Determine exit code based on results
|
|
185
176
|
if summary.error_count > 0:
|
|
186
177
|
return 2 # Errors found
|
|
187
|
-
|
|
178
|
+
if summary.warning_count > 0:
|
|
188
179
|
return 1 # Warnings found
|
|
189
|
-
|
|
190
|
-
return 0 # All OK
|
|
180
|
+
return 0 # All OK
|
|
191
181
|
|
|
192
182
|
|
|
193
183
|
# Optional: Standalone execution for testing
|
|
194
184
|
if __name__ == "__main__":
|
|
195
185
|
import argparse
|
|
196
|
-
|
|
186
|
+
|
|
197
187
|
parser = argparse.ArgumentParser(description="Claude MPM Doctor")
|
|
198
188
|
parser.add_argument("--verbose", "-v", action="store_true")
|
|
199
189
|
parser.add_argument("--json", action="store_true")
|
|
@@ -201,9 +191,9 @@ if __name__ == "__main__":
|
|
|
201
191
|
parser.add_argument("--no-color", action="store_true")
|
|
202
192
|
parser.add_argument("--checks", nargs="+")
|
|
203
193
|
parser.add_argument("--parallel", action="store_true")
|
|
204
|
-
|
|
194
|
+
|
|
205
195
|
args = parser.parse_args()
|
|
206
196
|
args.markdown = False
|
|
207
197
|
args.output = None
|
|
208
|
-
|
|
209
|
-
sys.exit(doctor_command(args))
|
|
198
|
+
|
|
199
|
+
sys.exit(doctor_command(args))
|
claude_mpm/cli/commands/info.py
CHANGED
|
@@ -13,7 +13,7 @@ DESIGN DECISIONS:
|
|
|
13
13
|
|
|
14
14
|
import shutil
|
|
15
15
|
from pathlib import Path
|
|
16
|
-
from typing import
|
|
16
|
+
from typing import Any, Dict
|
|
17
17
|
|
|
18
18
|
from ..shared import BaseCommand, CommandResult
|
|
19
19
|
|
|
@@ -35,15 +35,16 @@ class InfoCommand(BaseCommand):
|
|
|
35
35
|
# Gather system information
|
|
36
36
|
info_data = self._gather_system_info(args)
|
|
37
37
|
|
|
38
|
-
output_format = getattr(args,
|
|
38
|
+
output_format = getattr(args, "format", "text")
|
|
39
39
|
|
|
40
|
-
if output_format in [
|
|
40
|
+
if output_format in ["json", "yaml"]:
|
|
41
41
|
# Structured output
|
|
42
|
-
return CommandResult.success_result(
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
42
|
+
return CommandResult.success_result(
|
|
43
|
+
"System information retrieved", data=info_data
|
|
44
|
+
)
|
|
45
|
+
# Text output
|
|
46
|
+
self._display_text_info(info_data)
|
|
47
|
+
return CommandResult.success_result("System information displayed")
|
|
47
48
|
|
|
48
49
|
except Exception as e:
|
|
49
50
|
self.logger.error(f"Error gathering system info: {e}", exc_info=True)
|
|
@@ -57,20 +58,26 @@ class InfoCommand(BaseCommand):
|
|
|
57
58
|
from claude_mpm.core.framework_loader import FrameworkLoader
|
|
58
59
|
|
|
59
60
|
# Framework information
|
|
60
|
-
framework_path = getattr(args,
|
|
61
|
+
framework_path = getattr(args, "framework_path", None)
|
|
61
62
|
loader = FrameworkLoader(framework_path)
|
|
62
63
|
|
|
63
64
|
framework_info = {
|
|
64
65
|
"loaded": loader.framework_content["loaded"],
|
|
65
|
-
"name":
|
|
66
|
-
|
|
66
|
+
"name": (
|
|
67
|
+
"claude-multiagent-pm"
|
|
68
|
+
if loader.framework_content["loaded"]
|
|
69
|
+
else "Not found"
|
|
70
|
+
),
|
|
71
|
+
"version": loader.framework_content.get("version", "unknown"),
|
|
67
72
|
"path": str(loader.framework_path) if loader.framework_path else None,
|
|
68
|
-
"agents":
|
|
73
|
+
"agents": (
|
|
74
|
+
loader.get_agent_list() if loader.framework_content["loaded"] else []
|
|
75
|
+
),
|
|
69
76
|
}
|
|
70
77
|
|
|
71
78
|
# Configuration information
|
|
72
79
|
config_info = {
|
|
73
|
-
"log_directory": getattr(args,
|
|
80
|
+
"log_directory": getattr(args, "log_dir", None) or "~/.claude-mpm/logs"
|
|
74
81
|
}
|
|
75
82
|
|
|
76
83
|
# Agent hierarchy
|
|
@@ -79,12 +86,12 @@ class InfoCommand(BaseCommand):
|
|
|
79
86
|
if loader.agent_registry:
|
|
80
87
|
hierarchy = loader.agent_registry.get_agent_hierarchy()
|
|
81
88
|
agent_hierarchy = {
|
|
82
|
-
"project_agents": len(hierarchy[
|
|
83
|
-
"user_agents": len(hierarchy[
|
|
84
|
-
"system_agents": len(hierarchy[
|
|
85
|
-
"project_agent_list": hierarchy[
|
|
86
|
-
"user_agent_list": hierarchy[
|
|
87
|
-
"system_agent_list": hierarchy[
|
|
89
|
+
"project_agents": len(hierarchy["project"]),
|
|
90
|
+
"user_agents": len(hierarchy["user"]),
|
|
91
|
+
"system_agents": len(hierarchy["system"]),
|
|
92
|
+
"project_agent_list": hierarchy["project"],
|
|
93
|
+
"user_agent_list": hierarchy["user"],
|
|
94
|
+
"system_agent_list": hierarchy["system"],
|
|
88
95
|
}
|
|
89
96
|
core_agents = loader.agent_registry.get_core_agents()
|
|
90
97
|
|
|
@@ -96,7 +103,7 @@ class InfoCommand(BaseCommand):
|
|
|
96
103
|
"configuration": config_info,
|
|
97
104
|
"agent_hierarchy": agent_hierarchy,
|
|
98
105
|
"core_agents": core_agents,
|
|
99
|
-
"dependencies": dependencies
|
|
106
|
+
"dependencies": dependencies,
|
|
100
107
|
}
|
|
101
108
|
|
|
102
109
|
def _check_dependencies(self) -> Dict[str, Any]:
|
|
@@ -108,20 +115,21 @@ class InfoCommand(BaseCommand):
|
|
|
108
115
|
dependencies["claude_cli"] = {
|
|
109
116
|
"installed": bool(claude_path),
|
|
110
117
|
"path": claude_path,
|
|
111
|
-
"status": "✓ Installed" if claude_path else "✗ Not found in PATH"
|
|
118
|
+
"status": "✓ Installed" if claude_path else "✗ Not found in PATH",
|
|
112
119
|
}
|
|
113
120
|
|
|
114
121
|
# Check ai-trackdown-pytools
|
|
115
122
|
try:
|
|
116
123
|
import ai_trackdown_pytools
|
|
124
|
+
|
|
117
125
|
dependencies["ai_trackdown_pytools"] = {
|
|
118
126
|
"installed": True,
|
|
119
|
-
"status": "✓ Installed"
|
|
127
|
+
"status": "✓ Installed",
|
|
120
128
|
}
|
|
121
129
|
except ImportError:
|
|
122
130
|
dependencies["ai_trackdown_pytools"] = {
|
|
123
131
|
"installed": False,
|
|
124
|
-
"status": "✗ Not installed"
|
|
132
|
+
"status": "✗ Not installed",
|
|
125
133
|
}
|
|
126
134
|
|
|
127
135
|
# Check Claude Code hooks
|
|
@@ -130,7 +138,11 @@ class InfoCommand(BaseCommand):
|
|
|
130
138
|
"installed": claude_settings.exists(),
|
|
131
139
|
"settings_path": str(claude_settings),
|
|
132
140
|
"status": "✓ Installed" if claude_settings.exists() else "✗ Not installed",
|
|
133
|
-
"install_command":
|
|
141
|
+
"install_command": (
|
|
142
|
+
"python scripts/install_hooks.py"
|
|
143
|
+
if not claude_settings.exists()
|
|
144
|
+
else None
|
|
145
|
+
),
|
|
134
146
|
}
|
|
135
147
|
|
|
136
148
|
return dependencies
|
|
@@ -193,7 +205,7 @@ def show_info(args):
|
|
|
193
205
|
result = command.execute(args)
|
|
194
206
|
|
|
195
207
|
# Print result if structured output format is requested
|
|
196
|
-
if hasattr(args,
|
|
208
|
+
if hasattr(args, "format") and args.format in ["json", "yaml"]:
|
|
197
209
|
command.print_result(result, args)
|
|
198
210
|
|
|
199
211
|
return result.exit_code
|
claude_mpm/cli/commands/mcp.py
CHANGED
|
@@ -1,5 +1,3 @@
|
|
|
1
|
-
from pathlib import Path
|
|
2
|
-
|
|
3
1
|
"""
|
|
4
2
|
MCP Gateway command implementation for claude-mpm.
|
|
5
3
|
|
|
@@ -11,11 +9,9 @@ that dispatches to specific subcommand handlers, maintaining consistency
|
|
|
11
9
|
with other command modules like agents.py and memory.py.
|
|
12
10
|
"""
|
|
13
11
|
|
|
14
|
-
import asyncio
|
|
15
12
|
import json
|
|
16
13
|
import sys
|
|
17
14
|
from pathlib import Path
|
|
18
|
-
from typing import Any, Dict, List, Optional
|
|
19
15
|
|
|
20
16
|
from ...constants import MCPCommands
|
|
21
17
|
from ...core.logger import get_logger
|
|
@@ -70,7 +66,7 @@ def manage_mcp(args):
|
|
|
70
66
|
MCPGateway = None
|
|
71
67
|
else:
|
|
72
68
|
print(
|
|
73
|
-
|
|
69
|
+
"\nError: MCP Gateway services not fully available",
|
|
74
70
|
file=sys.stderr,
|
|
75
71
|
)
|
|
76
72
|
print(f"Details: {e}", file=sys.stderr)
|
|
@@ -185,9 +181,9 @@ def _show_status(
|
|
|
185
181
|
# Show available tools count
|
|
186
182
|
if ToolRegistry:
|
|
187
183
|
try:
|
|
188
|
-
|
|
184
|
+
ToolRegistry()
|
|
189
185
|
# Don't initialize fully, just check
|
|
190
|
-
print(
|
|
186
|
+
print("\n🔧 Tools: Check with 'claude-mpm mcp tools'")
|
|
191
187
|
except:
|
|
192
188
|
print("\n🔧 Tools: Registry not available")
|
|
193
189
|
|
|
@@ -5,9 +5,6 @@ Extracted from mcp.py to reduce complexity and improve maintainability.
|
|
|
5
5
|
"""
|
|
6
6
|
|
|
7
7
|
import asyncio
|
|
8
|
-
import os
|
|
9
|
-
import sys
|
|
10
|
-
from typing import Any
|
|
11
8
|
|
|
12
9
|
from ...constants import MCPCommands
|
|
13
10
|
|
|
@@ -24,38 +21,37 @@ class MCPCommandRouter:
|
|
|
24
21
|
if args.mcp_command == MCPCommands.START.value:
|
|
25
22
|
return asyncio.run(self._start_server(args))
|
|
26
23
|
|
|
27
|
-
|
|
24
|
+
if args.mcp_command == MCPCommands.STOP.value:
|
|
28
25
|
return self._stop_server(args)
|
|
29
26
|
|
|
30
|
-
|
|
27
|
+
if args.mcp_command == MCPCommands.STATUS.value:
|
|
31
28
|
return self._show_status(args)
|
|
32
29
|
|
|
33
|
-
|
|
30
|
+
if args.mcp_command == MCPCommands.TOOLS.value:
|
|
34
31
|
return self._manage_tools(args)
|
|
35
32
|
|
|
36
|
-
|
|
33
|
+
if args.mcp_command == MCPCommands.REGISTER.value:
|
|
37
34
|
return self._register_tool(args)
|
|
38
35
|
|
|
39
|
-
|
|
36
|
+
if args.mcp_command == MCPCommands.TEST.value:
|
|
40
37
|
return self._test_tool(args)
|
|
41
38
|
|
|
42
|
-
|
|
39
|
+
if args.mcp_command == MCPCommands.INSTALL.value:
|
|
43
40
|
return self._install_gateway(args)
|
|
44
41
|
|
|
45
|
-
|
|
42
|
+
if args.mcp_command == MCPCommands.CONFIG.value:
|
|
46
43
|
return self._manage_config(args)
|
|
47
44
|
|
|
48
|
-
|
|
45
|
+
if args.mcp_command == MCPCommands.SERVER.value:
|
|
49
46
|
return self._run_server(args)
|
|
50
47
|
|
|
51
|
-
|
|
48
|
+
if args.mcp_command == "cleanup":
|
|
52
49
|
return self._cleanup_locks(args)
|
|
53
50
|
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
return 1
|
|
51
|
+
self.logger.error(f"Unknown MCP command: {args.mcp_command}")
|
|
52
|
+
print(f"Unknown MCP command: {args.mcp_command}")
|
|
53
|
+
self._show_help()
|
|
54
|
+
return 1
|
|
59
55
|
|
|
60
56
|
async def _start_server(self, args) -> int:
|
|
61
57
|
"""Start server command handler."""
|
|
@@ -124,7 +120,7 @@ class MCPCommandRouter:
|
|
|
124
120
|
"""Run server command handler - direct server execution."""
|
|
125
121
|
# Simply delegate to the async start_server method using asyncio.run
|
|
126
122
|
from .mcp_server_commands import MCPServerCommands
|
|
127
|
-
|
|
123
|
+
|
|
128
124
|
handler = MCPServerCommands(self.logger)
|
|
129
125
|
return asyncio.run(handler.start_server(args))
|
|
130
126
|
|
|
@@ -33,6 +33,7 @@ class MCPInstallCommands:
|
|
|
33
33
|
print("\n1️⃣ Checking MCP package installation...")
|
|
34
34
|
try:
|
|
35
35
|
import mcp
|
|
36
|
+
|
|
36
37
|
print("✅ MCP package already installed")
|
|
37
38
|
except ImportError:
|
|
38
39
|
print("📦 Installing MCP package...")
|
|
@@ -56,9 +57,8 @@ class MCPInstallCommands:
|
|
|
56
57
|
print("2. Test the server: claude-mpm mcp server --test")
|
|
57
58
|
print("3. Check status: claude-mpm mcp status")
|
|
58
59
|
return 0
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
return 1
|
|
60
|
+
print("❌ Configuration failed")
|
|
61
|
+
return 1
|
|
62
62
|
|
|
63
63
|
except Exception as e:
|
|
64
64
|
print(f"❌ Error during configuration: {e}")
|
|
@@ -66,7 +66,7 @@ class MCPInstallCommands:
|
|
|
66
66
|
|
|
67
67
|
def _configure_claude_desktop(self, force=False):
|
|
68
68
|
"""Configure Claude Code to use the MCP gateway via CLI command.
|
|
69
|
-
|
|
69
|
+
|
|
70
70
|
WHY: Claude Code reads MCP server configurations from ~/.claude.json
|
|
71
71
|
(not ~/.claude/settings.local.json). This method updates that file
|
|
72
72
|
to include the claude-mpm-gateway server configuration.
|
|
@@ -77,10 +77,6 @@ class MCPInstallCommands:
|
|
|
77
77
|
Returns:
|
|
78
78
|
bool: True if configuration was successful
|
|
79
79
|
"""
|
|
80
|
-
import json
|
|
81
|
-
import platform
|
|
82
|
-
from pathlib import Path
|
|
83
|
-
from datetime import datetime
|
|
84
80
|
|
|
85
81
|
# Determine Claude Code config path
|
|
86
82
|
config_path = self._get_claude_config_path()
|
|
@@ -102,15 +98,15 @@ class MCPInstallCommands:
|
|
|
102
98
|
return False
|
|
103
99
|
|
|
104
100
|
# Determine if we need to use -m claude_mpm or direct command
|
|
105
|
-
if claude_mpm_path.endswith((
|
|
101
|
+
if claude_mpm_path.endswith(("python", "python3", "python.exe", "python3.exe")):
|
|
106
102
|
# Using Python interpreter directly
|
|
107
103
|
mcp_config = {
|
|
108
104
|
"command": claude_mpm_path,
|
|
109
105
|
"args": ["-m", "claude_mpm", "mcp", "server"],
|
|
110
106
|
"env": {
|
|
111
107
|
"PYTHONPATH": str(Path(__file__).parent.parent.parent.parent),
|
|
112
|
-
"MCP_MODE": "production"
|
|
113
|
-
}
|
|
108
|
+
"MCP_MODE": "production",
|
|
109
|
+
},
|
|
114
110
|
}
|
|
115
111
|
else:
|
|
116
112
|
# Using installed claude-mpm command
|
|
@@ -119,8 +115,8 @@ class MCPInstallCommands:
|
|
|
119
115
|
"args": ["mcp", "server"],
|
|
120
116
|
"env": {
|
|
121
117
|
"PYTHONPATH": str(Path(__file__).parent.parent.parent.parent),
|
|
122
|
-
"MCP_MODE": "production"
|
|
123
|
-
}
|
|
118
|
+
"MCP_MODE": "production",
|
|
119
|
+
},
|
|
124
120
|
}
|
|
125
121
|
|
|
126
122
|
# Update configuration
|
|
@@ -143,7 +139,6 @@ class MCPInstallCommands:
|
|
|
143
139
|
Returns:
|
|
144
140
|
Path or None: Path to Claude Code config file
|
|
145
141
|
"""
|
|
146
|
-
from pathlib import Path
|
|
147
142
|
|
|
148
143
|
# Claude Code reads MCP server configurations from ~/.claude.json
|
|
149
144
|
# This is the actual file that Claude Code uses for MCP servers
|
|
@@ -167,6 +162,7 @@ class MCPInstallCommands:
|
|
|
167
162
|
str or None: Path to claude-mpm executable
|
|
168
163
|
"""
|
|
169
164
|
import sys
|
|
165
|
+
|
|
170
166
|
from ...core.unified_paths import get_executable_path
|
|
171
167
|
|
|
172
168
|
# Use the enhanced unified path manager for executable detection
|
|
@@ -178,6 +174,7 @@ class MCPInstallCommands:
|
|
|
178
174
|
# Fallback: Use Python module invocation if no executable found
|
|
179
175
|
try:
|
|
180
176
|
import claude_mpm
|
|
177
|
+
|
|
181
178
|
print(f" Using Python module: {sys.executable} -m claude_mpm")
|
|
182
179
|
return sys.executable
|
|
183
180
|
except ImportError:
|
|
@@ -204,25 +201,33 @@ class MCPInstallCommands:
|
|
|
204
201
|
if not force:
|
|
205
202
|
# Check if claude-mpm-gateway already exists
|
|
206
203
|
try:
|
|
207
|
-
with open(config_path
|
|
204
|
+
with open(config_path) as f:
|
|
208
205
|
existing_config = json.load(f)
|
|
209
206
|
|
|
210
|
-
if (
|
|
211
|
-
|
|
207
|
+
if (
|
|
208
|
+
existing_config.get("mcpServers", {}).get("claude-mpm-gateway")
|
|
209
|
+
and not force
|
|
210
|
+
):
|
|
212
211
|
print("⚠️ claude-mpm-gateway is already configured")
|
|
213
|
-
response =
|
|
214
|
-
|
|
212
|
+
response = (
|
|
213
|
+
input("Do you want to overwrite it? (y/N): ")
|
|
214
|
+
.strip()
|
|
215
|
+
.lower()
|
|
216
|
+
)
|
|
217
|
+
if response not in ["y", "yes"]:
|
|
215
218
|
print("❌ Configuration cancelled")
|
|
216
219
|
return None
|
|
217
220
|
|
|
218
221
|
config = existing_config
|
|
219
222
|
|
|
220
|
-
except (json.JSONDecodeError
|
|
223
|
+
except (OSError, json.JSONDecodeError) as e:
|
|
221
224
|
print(f"⚠️ Error reading existing config: {e}")
|
|
222
225
|
print("Creating backup and starting fresh...")
|
|
223
226
|
|
|
224
227
|
# Create backup
|
|
225
|
-
backup_path = config_path.with_suffix(
|
|
228
|
+
backup_path = config_path.with_suffix(
|
|
229
|
+
f'.backup.{datetime.now().strftime("%Y%m%d_%H%M%S")}.json'
|
|
230
|
+
)
|
|
226
231
|
try:
|
|
227
232
|
config_path.rename(backup_path)
|
|
228
233
|
print(f" Backup created: {backup_path}")
|
|
@@ -231,7 +236,7 @@ class MCPInstallCommands:
|
|
|
231
236
|
else:
|
|
232
237
|
# Force mode - create backup but proceed
|
|
233
238
|
try:
|
|
234
|
-
with open(config_path
|
|
239
|
+
with open(config_path) as f:
|
|
235
240
|
existing_config = json.load(f)
|
|
236
241
|
config = existing_config
|
|
237
242
|
print(" Force mode: Overwriting existing configuration")
|
|
@@ -261,7 +266,7 @@ class MCPInstallCommands:
|
|
|
261
266
|
config_path.parent.mkdir(parents=True, exist_ok=True)
|
|
262
267
|
|
|
263
268
|
# Write configuration with nice formatting
|
|
264
|
-
with open(config_path,
|
|
269
|
+
with open(config_path, "w") as f:
|
|
265
270
|
json.dump(config, f, indent=2)
|
|
266
271
|
|
|
267
272
|
print(f"\n✅ Configuration saved to {config_path}")
|