claude-mpm 4.1.1__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 +50 -2
- 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.1.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.1.dist-info/RECORD +0 -494
- {claude_mpm-4.1.1.dist-info → claude_mpm-4.1.2.dist-info}/WHEEL +0 -0
- {claude_mpm-4.1.1.dist-info → claude_mpm-4.1.2.dist-info}/entry_points.txt +0 -0
- {claude_mpm-4.1.1.dist-info → claude_mpm-4.1.2.dist-info}/licenses/LICENSE +0 -0
- {claude_mpm-4.1.1.dist-info → claude_mpm-4.1.2.dist-info}/top_level.txt +0 -0
|
@@ -8,7 +8,6 @@ and functioning for enhanced Claude Desktop capabilities.
|
|
|
8
8
|
import json
|
|
9
9
|
import subprocess
|
|
10
10
|
from pathlib import Path
|
|
11
|
-
from typing import Dict, Any
|
|
12
11
|
|
|
13
12
|
from ..models import DiagnosticResult, DiagnosticStatus
|
|
14
13
|
from .base_check import BaseDiagnosticCheck
|
|
@@ -16,43 +15,42 @@ from .base_check import BaseDiagnosticCheck
|
|
|
16
15
|
|
|
17
16
|
class MCPCheck(BaseDiagnosticCheck):
|
|
18
17
|
"""Check MCP server installation and configuration."""
|
|
19
|
-
|
|
18
|
+
|
|
20
19
|
@property
|
|
21
20
|
def name(self) -> str:
|
|
22
21
|
return "mcp_check"
|
|
23
|
-
|
|
22
|
+
|
|
24
23
|
@property
|
|
25
24
|
def category(self) -> str:
|
|
26
25
|
return "MCP Server"
|
|
27
|
-
|
|
26
|
+
|
|
28
27
|
def run(self) -> DiagnosticResult:
|
|
29
28
|
"""Run MCP diagnostics."""
|
|
30
29
|
try:
|
|
31
|
-
|
|
32
|
-
|
|
30
|
+
|
|
33
31
|
sub_results = []
|
|
34
32
|
details = {}
|
|
35
|
-
|
|
33
|
+
|
|
36
34
|
# Check if MCP is installed
|
|
37
35
|
install_result = self._check_installation()
|
|
38
36
|
sub_results.append(install_result)
|
|
39
37
|
details["installed"] = install_result.status == DiagnosticStatus.OK
|
|
40
|
-
|
|
38
|
+
|
|
41
39
|
if install_result.status == DiagnosticStatus.OK:
|
|
42
40
|
# Check MCP configuration
|
|
43
41
|
config_result = self._check_configuration()
|
|
44
42
|
sub_results.append(config_result)
|
|
45
43
|
details["configured"] = config_result.status == DiagnosticStatus.OK
|
|
46
|
-
|
|
44
|
+
|
|
47
45
|
# Check MCP server status
|
|
48
46
|
status_result = self._check_server_status()
|
|
49
47
|
sub_results.append(status_result)
|
|
50
48
|
details["running"] = status_result.details.get("running", False)
|
|
51
|
-
|
|
49
|
+
|
|
52
50
|
# Verify startup
|
|
53
51
|
startup_result = self._check_startup_verification()
|
|
54
52
|
sub_results.append(startup_result)
|
|
55
|
-
|
|
53
|
+
|
|
56
54
|
# Determine overall status
|
|
57
55
|
if any(r.status == DiagnosticStatus.ERROR for r in sub_results):
|
|
58
56
|
status = DiagnosticStatus.ERROR
|
|
@@ -66,48 +64,49 @@ class MCPCheck(BaseDiagnosticCheck):
|
|
|
66
64
|
else:
|
|
67
65
|
status = DiagnosticStatus.OK
|
|
68
66
|
message = "MCP server properly configured"
|
|
69
|
-
|
|
67
|
+
|
|
70
68
|
return DiagnosticResult(
|
|
71
69
|
category=self.category,
|
|
72
70
|
status=status,
|
|
73
71
|
message=message,
|
|
74
72
|
details=details,
|
|
75
|
-
sub_results=sub_results if self.verbose else []
|
|
73
|
+
sub_results=sub_results if self.verbose else [],
|
|
76
74
|
)
|
|
77
|
-
|
|
75
|
+
|
|
78
76
|
except Exception as e:
|
|
79
77
|
return DiagnosticResult(
|
|
80
78
|
category=self.category,
|
|
81
79
|
status=DiagnosticStatus.ERROR,
|
|
82
|
-
message=f"MCP check failed: {
|
|
83
|
-
details={"error": str(e)}
|
|
80
|
+
message=f"MCP check failed: {e!s}",
|
|
81
|
+
details={"error": str(e)},
|
|
84
82
|
)
|
|
85
|
-
|
|
83
|
+
|
|
86
84
|
def _check_installation(self) -> DiagnosticResult:
|
|
87
85
|
"""Check if MCP server is installed."""
|
|
88
86
|
# Check for MCP binary
|
|
89
87
|
mcp_paths = [
|
|
90
88
|
Path("/usr/local/bin/claude-mpm-mcp"),
|
|
91
89
|
Path.home() / ".local/bin/claude-mpm-mcp",
|
|
92
|
-
Path("/opt/claude-mpm/bin/claude-mpm-mcp")
|
|
90
|
+
Path("/opt/claude-mpm/bin/claude-mpm-mcp"),
|
|
93
91
|
]
|
|
94
|
-
|
|
92
|
+
|
|
95
93
|
for mcp_path in mcp_paths:
|
|
96
94
|
if mcp_path.exists():
|
|
97
95
|
return DiagnosticResult(
|
|
98
96
|
category="MCP Installation",
|
|
99
97
|
status=DiagnosticStatus.OK,
|
|
100
98
|
message="MCP server installed",
|
|
101
|
-
details={"path": str(mcp_path), "installed": True}
|
|
99
|
+
details={"path": str(mcp_path), "installed": True},
|
|
102
100
|
)
|
|
103
|
-
|
|
101
|
+
|
|
104
102
|
# Check if it's available via command
|
|
105
103
|
try:
|
|
106
104
|
result = subprocess.run(
|
|
107
105
|
["which", "claude-mpm-mcp"],
|
|
108
106
|
capture_output=True,
|
|
109
107
|
text=True,
|
|
110
|
-
timeout=2
|
|
108
|
+
timeout=2,
|
|
109
|
+
check=False,
|
|
111
110
|
)
|
|
112
111
|
if result.returncode == 0:
|
|
113
112
|
path = result.stdout.strip()
|
|
@@ -115,34 +114,35 @@ class MCPCheck(BaseDiagnosticCheck):
|
|
|
115
114
|
category="MCP Installation",
|
|
116
115
|
status=DiagnosticStatus.OK,
|
|
117
116
|
message="MCP server installed",
|
|
118
|
-
details={"path": path, "installed": True}
|
|
117
|
+
details={"path": path, "installed": True},
|
|
119
118
|
)
|
|
120
119
|
except (subprocess.SubprocessError, FileNotFoundError):
|
|
121
120
|
pass
|
|
122
|
-
|
|
121
|
+
|
|
123
122
|
return DiagnosticResult(
|
|
124
123
|
category="MCP Installation",
|
|
125
124
|
status=DiagnosticStatus.WARNING,
|
|
126
125
|
message="MCP server not installed",
|
|
127
126
|
details={"installed": False},
|
|
128
127
|
fix_command="claude-mpm mcp install",
|
|
129
|
-
fix_description="Install MCP server for enhanced capabilities"
|
|
128
|
+
fix_description="Install MCP server for enhanced capabilities",
|
|
130
129
|
)
|
|
131
|
-
|
|
130
|
+
|
|
132
131
|
def _check_configuration(self) -> DiagnosticResult:
|
|
133
132
|
"""Check MCP configuration in Claude Desktop."""
|
|
134
133
|
config_paths = [
|
|
135
134
|
Path.home() / ".config/claude/claude_desktop_config.json",
|
|
136
|
-
Path.home()
|
|
137
|
-
|
|
135
|
+
Path.home()
|
|
136
|
+
/ "Library/Application Support/Claude/claude_desktop_config.json",
|
|
137
|
+
Path.home() / "AppData/Roaming/Claude/claude_desktop_config.json",
|
|
138
138
|
]
|
|
139
|
-
|
|
139
|
+
|
|
140
140
|
config_path = None
|
|
141
141
|
for path in config_paths:
|
|
142
142
|
if path.exists():
|
|
143
143
|
config_path = path
|
|
144
144
|
break
|
|
145
|
-
|
|
145
|
+
|
|
146
146
|
if not config_path:
|
|
147
147
|
return DiagnosticResult(
|
|
148
148
|
category="MCP Configuration",
|
|
@@ -150,16 +150,16 @@ class MCPCheck(BaseDiagnosticCheck):
|
|
|
150
150
|
message="Claude Desktop config not found",
|
|
151
151
|
details={"configured": False},
|
|
152
152
|
fix_command="claude-mpm mcp config",
|
|
153
|
-
fix_description="Configure MCP server in Claude Desktop"
|
|
153
|
+
fix_description="Configure MCP server in Claude Desktop",
|
|
154
154
|
)
|
|
155
|
-
|
|
155
|
+
|
|
156
156
|
try:
|
|
157
|
-
with open(config_path
|
|
157
|
+
with open(config_path) as f:
|
|
158
158
|
config = json.load(f)
|
|
159
|
-
|
|
159
|
+
|
|
160
160
|
mcp_servers = config.get("mcpServers", {})
|
|
161
161
|
gateway = mcp_servers.get("claude-mpm-gateway", {})
|
|
162
|
-
|
|
162
|
+
|
|
163
163
|
if not gateway:
|
|
164
164
|
return DiagnosticResult(
|
|
165
165
|
category="MCP Configuration",
|
|
@@ -167,9 +167,9 @@ class MCPCheck(BaseDiagnosticCheck):
|
|
|
167
167
|
message="MCP gateway not configured",
|
|
168
168
|
details={"configured": False, "config_path": str(config_path)},
|
|
169
169
|
fix_command="claude-mpm mcp config",
|
|
170
|
-
fix_description="Add MCP gateway to Claude Desktop configuration"
|
|
170
|
+
fix_description="Add MCP gateway to Claude Desktop configuration",
|
|
171
171
|
)
|
|
172
|
-
|
|
172
|
+
|
|
173
173
|
# Check configuration validity
|
|
174
174
|
command = gateway.get("command")
|
|
175
175
|
if not command:
|
|
@@ -180,12 +180,12 @@ class MCPCheck(BaseDiagnosticCheck):
|
|
|
180
180
|
details={
|
|
181
181
|
"configured": True,
|
|
182
182
|
"valid": False,
|
|
183
|
-
"config_path": str(config_path)
|
|
183
|
+
"config_path": str(config_path),
|
|
184
184
|
},
|
|
185
185
|
fix_command="claude-mpm mcp config --force",
|
|
186
|
-
fix_description="Fix MCP gateway configuration"
|
|
186
|
+
fix_description="Fix MCP gateway configuration",
|
|
187
187
|
)
|
|
188
|
-
|
|
188
|
+
|
|
189
189
|
return DiagnosticResult(
|
|
190
190
|
category="MCP Configuration",
|
|
191
191
|
status=DiagnosticStatus.OK,
|
|
@@ -193,26 +193,26 @@ class MCPCheck(BaseDiagnosticCheck):
|
|
|
193
193
|
details={
|
|
194
194
|
"configured": True,
|
|
195
195
|
"command": command,
|
|
196
|
-
"config_path": str(config_path)
|
|
197
|
-
}
|
|
196
|
+
"config_path": str(config_path),
|
|
197
|
+
},
|
|
198
198
|
)
|
|
199
|
-
|
|
199
|
+
|
|
200
200
|
except json.JSONDecodeError as e:
|
|
201
201
|
return DiagnosticResult(
|
|
202
202
|
category="MCP Configuration",
|
|
203
203
|
status=DiagnosticStatus.ERROR,
|
|
204
204
|
message="Invalid JSON in config file",
|
|
205
205
|
details={"error": str(e), "config_path": str(config_path)},
|
|
206
|
-
fix_description="Fix JSON syntax in Claude Desktop config"
|
|
206
|
+
fix_description="Fix JSON syntax in Claude Desktop config",
|
|
207
207
|
)
|
|
208
208
|
except Exception as e:
|
|
209
209
|
return DiagnosticResult(
|
|
210
210
|
category="MCP Configuration",
|
|
211
211
|
status=DiagnosticStatus.WARNING,
|
|
212
|
-
message=f"Could not check configuration: {
|
|
213
|
-
details={"error": str(e)}
|
|
212
|
+
message=f"Could not check configuration: {e!s}",
|
|
213
|
+
details={"error": str(e)},
|
|
214
214
|
)
|
|
215
|
-
|
|
215
|
+
|
|
216
216
|
def _check_server_status(self) -> DiagnosticResult:
|
|
217
217
|
"""Check if MCP server is running."""
|
|
218
218
|
try:
|
|
@@ -221,95 +221,97 @@ class MCPCheck(BaseDiagnosticCheck):
|
|
|
221
221
|
["claude-mpm", "mcp", "status"],
|
|
222
222
|
capture_output=True,
|
|
223
223
|
text=True,
|
|
224
|
-
timeout=5
|
|
224
|
+
timeout=5,
|
|
225
|
+
check=False,
|
|
225
226
|
)
|
|
226
|
-
|
|
227
|
+
|
|
227
228
|
if result.returncode == 0:
|
|
228
229
|
if "running" in result.stdout.lower():
|
|
229
230
|
return DiagnosticResult(
|
|
230
231
|
category="MCP Server Status",
|
|
231
232
|
status=DiagnosticStatus.OK,
|
|
232
233
|
message="MCP server is running",
|
|
233
|
-
details={"running": True}
|
|
234
|
+
details={"running": True},
|
|
234
235
|
)
|
|
235
|
-
else:
|
|
236
|
-
return DiagnosticResult(
|
|
237
|
-
category="MCP Server Status",
|
|
238
|
-
status=DiagnosticStatus.WARNING,
|
|
239
|
-
message="MCP server not running",
|
|
240
|
-
details={"running": False},
|
|
241
|
-
fix_command="claude-mpm mcp start",
|
|
242
|
-
fix_description="Start the MCP server"
|
|
243
|
-
)
|
|
244
|
-
else:
|
|
245
236
|
return DiagnosticResult(
|
|
246
237
|
category="MCP Server Status",
|
|
247
238
|
status=DiagnosticStatus.WARNING,
|
|
248
|
-
message="
|
|
249
|
-
details={"running":
|
|
239
|
+
message="MCP server not running",
|
|
240
|
+
details={"running": False},
|
|
241
|
+
fix_command="claude-mpm mcp start",
|
|
242
|
+
fix_description="Start the MCP server",
|
|
250
243
|
)
|
|
251
|
-
|
|
244
|
+
return DiagnosticResult(
|
|
245
|
+
category="MCP Server Status",
|
|
246
|
+
status=DiagnosticStatus.WARNING,
|
|
247
|
+
message="Could not determine server status",
|
|
248
|
+
details={"running": "unknown", "error": result.stderr},
|
|
249
|
+
)
|
|
250
|
+
|
|
252
251
|
except subprocess.TimeoutExpired:
|
|
253
252
|
return DiagnosticResult(
|
|
254
253
|
category="MCP Server Status",
|
|
255
254
|
status=DiagnosticStatus.WARNING,
|
|
256
255
|
message="Server status check timed out",
|
|
257
|
-
details={"running": "unknown", "error": "timeout"}
|
|
256
|
+
details={"running": "unknown", "error": "timeout"},
|
|
258
257
|
)
|
|
259
258
|
except Exception as e:
|
|
260
259
|
return DiagnosticResult(
|
|
261
260
|
category="MCP Server Status",
|
|
262
261
|
status=DiagnosticStatus.WARNING,
|
|
263
|
-
message=f"Could not check server status: {
|
|
264
|
-
details={"running": "unknown", "error": str(e)}
|
|
262
|
+
message=f"Could not check server status: {e!s}",
|
|
263
|
+
details={"running": "unknown", "error": str(e)},
|
|
265
264
|
)
|
|
266
|
-
|
|
265
|
+
|
|
267
266
|
def _check_startup_verification(self) -> DiagnosticResult:
|
|
268
267
|
"""Run MCP startup verification."""
|
|
269
268
|
try:
|
|
270
|
-
from ....services.mcp_gateway.core.startup_verification import
|
|
271
|
-
|
|
269
|
+
from ....services.mcp_gateway.core.startup_verification import (
|
|
270
|
+
MCPGatewayStartupVerifier,
|
|
271
|
+
)
|
|
272
|
+
|
|
272
273
|
verifier = MCPGatewayStartupVerifier()
|
|
273
274
|
issues = verifier.verify_startup()
|
|
274
|
-
|
|
275
|
+
|
|
275
276
|
if not issues:
|
|
276
277
|
return DiagnosticResult(
|
|
277
278
|
category="MCP Startup Verification",
|
|
278
279
|
status=DiagnosticStatus.OK,
|
|
279
280
|
message="Startup verification passed",
|
|
280
|
-
details={"issues": []}
|
|
281
|
+
details={"issues": []},
|
|
281
282
|
)
|
|
282
|
-
|
|
283
|
+
|
|
283
284
|
# Categorize issues by severity
|
|
284
|
-
errors = [
|
|
285
|
+
errors = [
|
|
286
|
+
i for i in issues if "error" in i.lower() or "critical" in i.lower()
|
|
287
|
+
]
|
|
285
288
|
warnings = [i for i in issues if i not in errors]
|
|
286
|
-
|
|
289
|
+
|
|
287
290
|
if errors:
|
|
288
291
|
return DiagnosticResult(
|
|
289
292
|
category="MCP Startup Verification",
|
|
290
293
|
status=DiagnosticStatus.ERROR,
|
|
291
294
|
message=f"{len(errors)} critical issue(s) found",
|
|
292
|
-
details={"errors": errors, "warnings": warnings}
|
|
295
|
+
details={"errors": errors, "warnings": warnings},
|
|
293
296
|
)
|
|
294
|
-
|
|
297
|
+
if warnings:
|
|
295
298
|
return DiagnosticResult(
|
|
296
299
|
category="MCP Startup Verification",
|
|
297
300
|
status=DiagnosticStatus.WARNING,
|
|
298
301
|
message=f"{len(warnings)} warning(s) found",
|
|
299
|
-
details={"warnings": warnings}
|
|
302
|
+
details={"warnings": warnings},
|
|
300
303
|
)
|
|
301
|
-
|
|
302
|
-
|
|
303
|
-
|
|
304
|
-
|
|
305
|
-
|
|
306
|
-
|
|
307
|
-
|
|
308
|
-
|
|
304
|
+
return DiagnosticResult(
|
|
305
|
+
category="MCP Startup Verification",
|
|
306
|
+
status=DiagnosticStatus.OK,
|
|
307
|
+
message="Startup verification passed",
|
|
308
|
+
details={"issues": []},
|
|
309
|
+
)
|
|
310
|
+
|
|
309
311
|
except Exception as e:
|
|
310
312
|
return DiagnosticResult(
|
|
311
313
|
category="MCP Startup Verification",
|
|
312
314
|
status=DiagnosticStatus.WARNING,
|
|
313
|
-
message=f"Could not verify startup: {
|
|
314
|
-
details={"error": str(e)}
|
|
315
|
-
)
|
|
315
|
+
message=f"Could not verify startup: {e!s}",
|
|
316
|
+
details={"error": str(e)},
|
|
317
|
+
)
|