claude-mpm 4.14.9__py3-none-any.whl → 4.15.1__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.
Potentially problematic release.
This version of claude-mpm might be problematic. Click here for more details.
- claude_mpm/VERSION +1 -1
- claude_mpm/agents/OUTPUT_STYLE.md +48 -3
- claude_mpm/agents/templates/project_organizer.json +3 -3
- claude_mpm/cli/commands/auto_configure.py +7 -9
- claude_mpm/cli/commands/local_deploy.py +3 -2
- claude_mpm/cli/commands/mpm_init.py +4 -4
- claude_mpm/cli/commands/mpm_init_handler.py +8 -3
- claude_mpm/core/base_service.py +13 -12
- claude_mpm/core/enums.py +36 -1
- claude_mpm/services/agents/auto_config_manager.py +9 -10
- claude_mpm/services/agents/deployment/pipeline/steps/agent_processing_step.py +7 -6
- claude_mpm/services/agents/deployment/pipeline/steps/base_step.py +7 -16
- claude_mpm/services/agents/deployment/pipeline/steps/configuration_step.py +4 -3
- claude_mpm/services/agents/deployment/pipeline/steps/target_directory_step.py +5 -3
- claude_mpm/services/agents/deployment/pipeline/steps/validation_step.py +6 -5
- claude_mpm/services/agents/deployment/refactored_agent_deployment_service.py +6 -4
- claude_mpm/services/agents/registry/modification_tracker.py +5 -2
- claude_mpm/services/command_handler_service.py +11 -5
- claude_mpm/services/core/interfaces/process.py +6 -6
- claude_mpm/services/core/models/__init__.py +0 -2
- claude_mpm/services/core/models/agent_config.py +12 -28
- claude_mpm/services/core/models/process.py +19 -42
- claude_mpm/services/diagnostics/__init__.py +2 -2
- claude_mpm/services/diagnostics/checks/agent_check.py +25 -24
- claude_mpm/services/diagnostics/checks/claude_code_check.py +24 -23
- claude_mpm/services/diagnostics/checks/common_issues_check.py +25 -24
- claude_mpm/services/diagnostics/checks/configuration_check.py +24 -23
- claude_mpm/services/diagnostics/checks/filesystem_check.py +18 -17
- claude_mpm/services/diagnostics/checks/installation_check.py +28 -28
- claude_mpm/services/diagnostics/checks/instructions_check.py +20 -19
- claude_mpm/services/diagnostics/checks/mcp_check.py +31 -31
- claude_mpm/services/diagnostics/checks/mcp_services_check.py +36 -31
- claude_mpm/services/diagnostics/checks/monitor_check.py +23 -22
- claude_mpm/services/diagnostics/checks/startup_log_check.py +9 -8
- claude_mpm/services/diagnostics/diagnostic_runner.py +6 -5
- claude_mpm/services/diagnostics/doctor_reporter.py +28 -25
- claude_mpm/services/diagnostics/models.py +19 -24
- claude_mpm/services/local_ops/__init__.py +3 -3
- claude_mpm/services/local_ops/process_manager.py +12 -12
- claude_mpm/services/local_ops/state_manager.py +6 -5
- claude_mpm/services/local_ops/unified_manager.py +2 -2
- claude_mpm/services/mcp_config_manager.py +7 -2
- claude_mpm/services/mcp_gateway/core/__init__.py +1 -2
- claude_mpm/services/mcp_gateway/core/base.py +18 -31
- claude_mpm/services/mcp_gateway/tools/external_mcp_services.py +71 -24
- claude_mpm/services/mcp_gateway/tools/health_check_tool.py +23 -22
- claude_mpm/services/unified/analyzer_strategies/code_analyzer.py +2 -2
- claude_mpm/services/unified/analyzer_strategies/security_analyzer.py +2 -2
- claude_mpm/services/unified/deployment_strategies/local.py +3 -3
- claude_mpm/services/unified/deployment_strategies/utils.py +5 -5
- claude_mpm/services/unified/deployment_strategies/vercel.py +6 -6
- claude_mpm/services/unified/unified_analyzer.py +8 -5
- claude_mpm/services/unified/unified_deployment.py +2 -2
- {claude_mpm-4.14.9.dist-info → claude_mpm-4.15.1.dist-info}/METADATA +1 -1
- {claude_mpm-4.14.9.dist-info → claude_mpm-4.15.1.dist-info}/RECORD +59 -59
- {claude_mpm-4.14.9.dist-info → claude_mpm-4.15.1.dist-info}/WHEEL +0 -0
- {claude_mpm-4.14.9.dist-info → claude_mpm-4.15.1.dist-info}/entry_points.txt +0 -0
- {claude_mpm-4.14.9.dist-info → claude_mpm-4.15.1.dist-info}/licenses/LICENSE +0 -0
- {claude_mpm-4.14.9.dist-info → claude_mpm-4.15.1.dist-info}/top_level.txt +0 -0
|
@@ -11,8 +11,8 @@ import sys
|
|
|
11
11
|
from pathlib import Path
|
|
12
12
|
from typing import Optional
|
|
13
13
|
|
|
14
|
-
from ....core.enums import OperationResult
|
|
15
|
-
from ..models import DiagnosticResult
|
|
14
|
+
from ....core.enums import OperationResult, ValidationSeverity
|
|
15
|
+
from ..models import DiagnosticResult
|
|
16
16
|
from .base_check import BaseDiagnosticCheck
|
|
17
17
|
|
|
18
18
|
|
|
@@ -55,14 +55,14 @@ class InstallationCheck(BaseDiagnosticCheck):
|
|
|
55
55
|
details["dependencies"] = deps_result.details.get("status")
|
|
56
56
|
|
|
57
57
|
# Determine overall status
|
|
58
|
-
if any(r.status ==
|
|
59
|
-
status =
|
|
58
|
+
if any(r.status == ValidationSeverity.ERROR for r in sub_results):
|
|
59
|
+
status = ValidationSeverity.ERROR
|
|
60
60
|
message = "Installation has critical issues"
|
|
61
|
-
elif any(r.status ==
|
|
62
|
-
status =
|
|
61
|
+
elif any(r.status == ValidationSeverity.WARNING for r in sub_results):
|
|
62
|
+
status = ValidationSeverity.WARNING
|
|
63
63
|
message = "Installation has minor issues"
|
|
64
64
|
else:
|
|
65
|
-
status =
|
|
65
|
+
status = OperationResult.SUCCESS
|
|
66
66
|
message = "Installation is healthy"
|
|
67
67
|
|
|
68
68
|
return DiagnosticResult(
|
|
@@ -76,7 +76,7 @@ class InstallationCheck(BaseDiagnosticCheck):
|
|
|
76
76
|
except Exception as e:
|
|
77
77
|
return DiagnosticResult(
|
|
78
78
|
category=self.category,
|
|
79
|
-
status=
|
|
79
|
+
status=ValidationSeverity.ERROR,
|
|
80
80
|
message=f"Installation check failed: {e!s}",
|
|
81
81
|
details={"error": str(e)},
|
|
82
82
|
)
|
|
@@ -92,7 +92,7 @@ class InstallationCheck(BaseDiagnosticCheck):
|
|
|
92
92
|
if version_info < min_version:
|
|
93
93
|
return DiagnosticResult(
|
|
94
94
|
category="Python Version",
|
|
95
|
-
status=
|
|
95
|
+
status=ValidationSeverity.ERROR,
|
|
96
96
|
message=f"Python {version_info.major}.{version_info.minor} is below minimum required {min_version[0]}.{min_version[1]}",
|
|
97
97
|
details={"version": version},
|
|
98
98
|
fix_description="Upgrade Python to 3.9 or higher",
|
|
@@ -100,13 +100,13 @@ class InstallationCheck(BaseDiagnosticCheck):
|
|
|
100
100
|
if version_info < recommended_version:
|
|
101
101
|
return DiagnosticResult(
|
|
102
102
|
category="Python Version",
|
|
103
|
-
status=
|
|
103
|
+
status=ValidationSeverity.WARNING,
|
|
104
104
|
message=f"Python {version_info.major}.{version_info.minor} works but {recommended_version[0]}.{recommended_version[1]}+ is recommended",
|
|
105
105
|
details={"version": version},
|
|
106
106
|
)
|
|
107
107
|
return DiagnosticResult(
|
|
108
108
|
category="Python Version",
|
|
109
|
-
status=
|
|
109
|
+
status=OperationResult.SUCCESS,
|
|
110
110
|
message=f"Python {version_info.major}.{version_info.minor}.{version_info.micro}",
|
|
111
111
|
details={"version": version},
|
|
112
112
|
)
|
|
@@ -123,7 +123,7 @@ class InstallationCheck(BaseDiagnosticCheck):
|
|
|
123
123
|
|
|
124
124
|
return DiagnosticResult(
|
|
125
125
|
category="Claude MPM Version",
|
|
126
|
-
status=
|
|
126
|
+
status=OperationResult.SUCCESS,
|
|
127
127
|
message=f"Version: {version}",
|
|
128
128
|
details={
|
|
129
129
|
"version": semantic_version,
|
|
@@ -134,7 +134,7 @@ class InstallationCheck(BaseDiagnosticCheck):
|
|
|
134
134
|
except Exception as e:
|
|
135
135
|
return DiagnosticResult(
|
|
136
136
|
category="Claude MPM Version",
|
|
137
|
-
status=
|
|
137
|
+
status=ValidationSeverity.WARNING,
|
|
138
138
|
message="Could not determine version",
|
|
139
139
|
details={"error": str(e)},
|
|
140
140
|
)
|
|
@@ -244,7 +244,7 @@ class InstallationCheck(BaseDiagnosticCheck):
|
|
|
244
244
|
if not methods_found:
|
|
245
245
|
return DiagnosticResult(
|
|
246
246
|
category="Installation Method",
|
|
247
|
-
status=
|
|
247
|
+
status=ValidationSeverity.WARNING,
|
|
248
248
|
message="Installation method unknown",
|
|
249
249
|
details=details,
|
|
250
250
|
)
|
|
@@ -260,7 +260,7 @@ class InstallationCheck(BaseDiagnosticCheck):
|
|
|
260
260
|
container_msg += " with virtual environment"
|
|
261
261
|
return DiagnosticResult(
|
|
262
262
|
category="Installation Method",
|
|
263
|
-
status=
|
|
263
|
+
status=OperationResult.SUCCESS,
|
|
264
264
|
message=container_msg,
|
|
265
265
|
details=details,
|
|
266
266
|
)
|
|
@@ -269,7 +269,7 @@ class InstallationCheck(BaseDiagnosticCheck):
|
|
|
269
269
|
if "pipx" in methods_found:
|
|
270
270
|
return DiagnosticResult(
|
|
271
271
|
category="Installation Method",
|
|
272
|
-
status=
|
|
272
|
+
status=OperationResult.SUCCESS,
|
|
273
273
|
message="Running from pipx environment (recommended)",
|
|
274
274
|
details=details,
|
|
275
275
|
)
|
|
@@ -279,7 +279,7 @@ class InstallationCheck(BaseDiagnosticCheck):
|
|
|
279
279
|
venv_name = Path(sys.prefix).name
|
|
280
280
|
return DiagnosticResult(
|
|
281
281
|
category="Installation Method",
|
|
282
|
-
status=
|
|
282
|
+
status=OperationResult.SUCCESS,
|
|
283
283
|
message=f"Development mode in virtual environment '{venv_name}'",
|
|
284
284
|
details=details,
|
|
285
285
|
)
|
|
@@ -289,7 +289,7 @@ class InstallationCheck(BaseDiagnosticCheck):
|
|
|
289
289
|
venv_name = Path(sys.prefix).name
|
|
290
290
|
return DiagnosticResult(
|
|
291
291
|
category="Installation Method",
|
|
292
|
-
status=
|
|
292
|
+
status=OperationResult.SUCCESS,
|
|
293
293
|
message=f"Virtual environment '{venv_name}'",
|
|
294
294
|
details=details,
|
|
295
295
|
)
|
|
@@ -298,7 +298,7 @@ class InstallationCheck(BaseDiagnosticCheck):
|
|
|
298
298
|
if "development" in methods_found and "homebrew" in methods_found:
|
|
299
299
|
return DiagnosticResult(
|
|
300
300
|
category="Installation Method",
|
|
301
|
-
status=
|
|
301
|
+
status=OperationResult.SUCCESS,
|
|
302
302
|
message="Development mode with Homebrew Python",
|
|
303
303
|
details=details,
|
|
304
304
|
)
|
|
@@ -306,7 +306,7 @@ class InstallationCheck(BaseDiagnosticCheck):
|
|
|
306
306
|
if "development" in methods_found:
|
|
307
307
|
return DiagnosticResult(
|
|
308
308
|
category="Installation Method",
|
|
309
|
-
status=
|
|
309
|
+
status=OperationResult.SUCCESS,
|
|
310
310
|
message="Development mode",
|
|
311
311
|
details=details,
|
|
312
312
|
)
|
|
@@ -316,9 +316,9 @@ class InstallationCheck(BaseDiagnosticCheck):
|
|
|
316
316
|
msg = "Homebrew Python"
|
|
317
317
|
if details.get("pipx_installed"):
|
|
318
318
|
msg += " (pipx is installed but not active - consider using 'pipx run claude-mpm')"
|
|
319
|
-
status =
|
|
319
|
+
status = ValidationSeverity.WARNING
|
|
320
320
|
else:
|
|
321
|
-
status =
|
|
321
|
+
status = OperationResult.SUCCESS
|
|
322
322
|
return DiagnosticResult(
|
|
323
323
|
category="Installation Method",
|
|
324
324
|
status=status,
|
|
@@ -330,7 +330,7 @@ class InstallationCheck(BaseDiagnosticCheck):
|
|
|
330
330
|
if "pip" in methods_found:
|
|
331
331
|
return DiagnosticResult(
|
|
332
332
|
category="Installation Method",
|
|
333
|
-
status=
|
|
333
|
+
status=ValidationSeverity.WARNING,
|
|
334
334
|
message="System pip installation (consider using pipx or venv instead)",
|
|
335
335
|
details=details,
|
|
336
336
|
fix_description="Consider reinstalling with pipx for isolated environment",
|
|
@@ -340,7 +340,7 @@ class InstallationCheck(BaseDiagnosticCheck):
|
|
|
340
340
|
if "system" in methods_found:
|
|
341
341
|
return DiagnosticResult(
|
|
342
342
|
category="Installation Method",
|
|
343
|
-
status=
|
|
343
|
+
status=ValidationSeverity.WARNING,
|
|
344
344
|
message="System Python (consider using pipx or venv)",
|
|
345
345
|
details=details,
|
|
346
346
|
)
|
|
@@ -348,7 +348,7 @@ class InstallationCheck(BaseDiagnosticCheck):
|
|
|
348
348
|
# Fallback for any other combination
|
|
349
349
|
return DiagnosticResult(
|
|
350
350
|
category="Installation Method",
|
|
351
|
-
status=
|
|
351
|
+
status=OperationResult.SUCCESS,
|
|
352
352
|
message=f"Installed via {', '.join(methods_found)}",
|
|
353
353
|
details=details,
|
|
354
354
|
)
|
|
@@ -400,7 +400,7 @@ class InstallationCheck(BaseDiagnosticCheck):
|
|
|
400
400
|
|
|
401
401
|
return DiagnosticResult(
|
|
402
402
|
category="Dependencies",
|
|
403
|
-
status=
|
|
403
|
+
status=ValidationSeverity.ERROR,
|
|
404
404
|
message=f"Missing critical dependencies: {', '.join(missing)}",
|
|
405
405
|
details={
|
|
406
406
|
"missing": missing,
|
|
@@ -415,7 +415,7 @@ class InstallationCheck(BaseDiagnosticCheck):
|
|
|
415
415
|
if warnings:
|
|
416
416
|
return DiagnosticResult(
|
|
417
417
|
category="Dependencies",
|
|
418
|
-
status=
|
|
418
|
+
status=ValidationSeverity.WARNING,
|
|
419
419
|
message=f"Missing optional dependencies: {', '.join(warnings)}",
|
|
420
420
|
details={
|
|
421
421
|
"optional_missing": warnings,
|
|
@@ -427,7 +427,7 @@ class InstallationCheck(BaseDiagnosticCheck):
|
|
|
427
427
|
)
|
|
428
428
|
return DiagnosticResult(
|
|
429
429
|
category="Dependencies",
|
|
430
|
-
status=
|
|
430
|
+
status=OperationResult.SUCCESS,
|
|
431
431
|
message="All dependencies installed",
|
|
432
432
|
details={
|
|
433
433
|
"status": OperationResult.COMPLETED,
|
|
@@ -11,7 +11,8 @@ from collections import defaultdict
|
|
|
11
11
|
from pathlib import Path
|
|
12
12
|
from typing import Dict
|
|
13
13
|
|
|
14
|
-
from
|
|
14
|
+
from ....core.enums import OperationResult, ValidationSeverity
|
|
15
|
+
from ..models import DiagnosticResult
|
|
15
16
|
from .base_check import BaseDiagnosticCheck
|
|
16
17
|
|
|
17
18
|
|
|
@@ -77,14 +78,14 @@ class InstructionsCheck(BaseDiagnosticCheck):
|
|
|
77
78
|
sub_results.append(separation_result)
|
|
78
79
|
|
|
79
80
|
# Determine overall status
|
|
80
|
-
if any(r.status ==
|
|
81
|
-
status =
|
|
81
|
+
if any(r.status == ValidationSeverity.ERROR for r in sub_results):
|
|
82
|
+
status = ValidationSeverity.ERROR
|
|
82
83
|
message = "Found critical issues with instruction files"
|
|
83
|
-
elif any(r.status ==
|
|
84
|
-
status =
|
|
84
|
+
elif any(r.status == ValidationSeverity.WARNING for r in sub_results):
|
|
85
|
+
status = ValidationSeverity.WARNING
|
|
85
86
|
message = "Found minor issues with instruction files"
|
|
86
87
|
else:
|
|
87
|
-
status =
|
|
88
|
+
status = OperationResult.SUCCESS
|
|
88
89
|
message = "Instruction files are properly configured"
|
|
89
90
|
|
|
90
91
|
return DiagnosticResult(
|
|
@@ -98,7 +99,7 @@ class InstructionsCheck(BaseDiagnosticCheck):
|
|
|
98
99
|
except Exception as e:
|
|
99
100
|
return DiagnosticResult(
|
|
100
101
|
category=self.category,
|
|
101
|
-
status=
|
|
102
|
+
status=ValidationSeverity.ERROR,
|
|
102
103
|
message=f"Instructions check failed: {e!s}",
|
|
103
104
|
details={"error": str(e)},
|
|
104
105
|
)
|
|
@@ -146,7 +147,7 @@ class InstructionsCheck(BaseDiagnosticCheck):
|
|
|
146
147
|
if not claude_files:
|
|
147
148
|
return DiagnosticResult(
|
|
148
149
|
category="CLAUDE.md Placement",
|
|
149
|
-
status=
|
|
150
|
+
status=OperationResult.SUCCESS,
|
|
150
151
|
message="No CLAUDE.md files found",
|
|
151
152
|
details={},
|
|
152
153
|
)
|
|
@@ -170,7 +171,7 @@ class InstructionsCheck(BaseDiagnosticCheck):
|
|
|
170
171
|
if issues:
|
|
171
172
|
return DiagnosticResult(
|
|
172
173
|
category="CLAUDE.md Placement",
|
|
173
|
-
status=
|
|
174
|
+
status=ValidationSeverity.WARNING,
|
|
174
175
|
message=f"Found {len(issues)} misplaced CLAUDE.md file(s)",
|
|
175
176
|
details={"issues": issues},
|
|
176
177
|
fix_description=(
|
|
@@ -181,7 +182,7 @@ class InstructionsCheck(BaseDiagnosticCheck):
|
|
|
181
182
|
|
|
182
183
|
return DiagnosticResult(
|
|
183
184
|
category="CLAUDE.md Placement",
|
|
184
|
-
status=
|
|
185
|
+
status=OperationResult.SUCCESS,
|
|
185
186
|
message="CLAUDE.md properly placed in project root",
|
|
186
187
|
details={"count": len(claude_files)},
|
|
187
188
|
)
|
|
@@ -191,7 +192,7 @@ class InstructionsCheck(BaseDiagnosticCheck):
|
|
|
191
192
|
if len(files) < 2:
|
|
192
193
|
return DiagnosticResult(
|
|
193
194
|
category="Duplicate Content",
|
|
194
|
-
status=
|
|
195
|
+
status=OperationResult.SUCCESS,
|
|
195
196
|
message="No duplicate content detected",
|
|
196
197
|
details={},
|
|
197
198
|
)
|
|
@@ -226,7 +227,7 @@ class InstructionsCheck(BaseDiagnosticCheck):
|
|
|
226
227
|
if duplicates:
|
|
227
228
|
return DiagnosticResult(
|
|
228
229
|
category="Duplicate Content",
|
|
229
|
-
status=
|
|
230
|
+
status=ValidationSeverity.WARNING,
|
|
230
231
|
message=f"Found {len(duplicates)} duplicate content block(s)",
|
|
231
232
|
details={"duplicates": duplicates[:5]}, # Limit to first 5
|
|
232
233
|
fix_description=(
|
|
@@ -238,7 +239,7 @@ class InstructionsCheck(BaseDiagnosticCheck):
|
|
|
238
239
|
|
|
239
240
|
return DiagnosticResult(
|
|
240
241
|
category="Duplicate Content",
|
|
241
|
-
status=
|
|
242
|
+
status=OperationResult.SUCCESS,
|
|
242
243
|
message="No significant duplicate content found",
|
|
243
244
|
details={},
|
|
244
245
|
)
|
|
@@ -280,7 +281,7 @@ class InstructionsCheck(BaseDiagnosticCheck):
|
|
|
280
281
|
if conflicts:
|
|
281
282
|
return DiagnosticResult(
|
|
282
283
|
category="Conflicting Directives",
|
|
283
|
-
status=
|
|
284
|
+
status=ValidationSeverity.ERROR,
|
|
284
285
|
message=f"Found {len(conflicts)} potential conflict(s)",
|
|
285
286
|
details={"conflicts": conflicts},
|
|
286
287
|
fix_description=(
|
|
@@ -292,7 +293,7 @@ class InstructionsCheck(BaseDiagnosticCheck):
|
|
|
292
293
|
|
|
293
294
|
return DiagnosticResult(
|
|
294
295
|
category="Conflicting Directives",
|
|
295
|
-
status=
|
|
296
|
+
status=OperationResult.SUCCESS,
|
|
296
297
|
message="No conflicting directives detected",
|
|
297
298
|
details={},
|
|
298
299
|
)
|
|
@@ -330,7 +331,7 @@ class InstructionsCheck(BaseDiagnosticCheck):
|
|
|
330
331
|
if duplicates:
|
|
331
332
|
return DiagnosticResult(
|
|
332
333
|
category="Agent Definitions",
|
|
333
|
-
status=
|
|
334
|
+
status=ValidationSeverity.WARNING,
|
|
334
335
|
message=f"Found {len(duplicates)} duplicate agent definition(s)",
|
|
335
336
|
details={"duplicates": duplicates},
|
|
336
337
|
fix_description=(
|
|
@@ -341,7 +342,7 @@ class InstructionsCheck(BaseDiagnosticCheck):
|
|
|
341
342
|
|
|
342
343
|
return DiagnosticResult(
|
|
343
344
|
category="Agent Definitions",
|
|
344
|
-
status=
|
|
345
|
+
status=OperationResult.SUCCESS,
|
|
345
346
|
message="Agent definitions are unique",
|
|
346
347
|
details={"total_agents": len(agent_definitions)},
|
|
347
348
|
)
|
|
@@ -396,7 +397,7 @@ class InstructionsCheck(BaseDiagnosticCheck):
|
|
|
396
397
|
if issues:
|
|
397
398
|
return DiagnosticResult(
|
|
398
399
|
category="Separation of Concerns",
|
|
399
|
-
status=
|
|
400
|
+
status=ValidationSeverity.WARNING,
|
|
400
401
|
message=f"Found {len(issues)} separation of concerns issue(s)",
|
|
401
402
|
details={"issues": issues},
|
|
402
403
|
fix_description=(
|
|
@@ -409,7 +410,7 @@ class InstructionsCheck(BaseDiagnosticCheck):
|
|
|
409
410
|
|
|
410
411
|
return DiagnosticResult(
|
|
411
412
|
category="Separation of Concerns",
|
|
412
|
-
status=
|
|
413
|
+
status=OperationResult.SUCCESS,
|
|
413
414
|
message="Instruction files properly separated",
|
|
414
415
|
details={},
|
|
415
416
|
)
|
|
@@ -9,9 +9,9 @@ import json
|
|
|
9
9
|
import subprocess
|
|
10
10
|
from pathlib import Path
|
|
11
11
|
|
|
12
|
-
from claude_mpm.core.enums import ServiceState
|
|
12
|
+
from claude_mpm.core.enums import OperationResult, ServiceState, ValidationSeverity
|
|
13
13
|
|
|
14
|
-
from ..models import DiagnosticResult
|
|
14
|
+
from ..models import DiagnosticResult
|
|
15
15
|
from .base_check import BaseDiagnosticCheck
|
|
16
16
|
|
|
17
17
|
|
|
@@ -36,13 +36,13 @@ class MCPCheck(BaseDiagnosticCheck):
|
|
|
36
36
|
# Check if MCP is installed
|
|
37
37
|
install_result = self._check_installation()
|
|
38
38
|
sub_results.append(install_result)
|
|
39
|
-
details["installed"] = install_result.status ==
|
|
39
|
+
details["installed"] = install_result.status == OperationResult.SUCCESS
|
|
40
40
|
|
|
41
|
-
if install_result.status ==
|
|
41
|
+
if install_result.status == OperationResult.SUCCESS:
|
|
42
42
|
# Check MCP configuration
|
|
43
43
|
config_result = self._check_configuration()
|
|
44
44
|
sub_results.append(config_result)
|
|
45
|
-
details["configured"] = config_result.status ==
|
|
45
|
+
details["configured"] = config_result.status == OperationResult.SUCCESS
|
|
46
46
|
|
|
47
47
|
# Check MCP server status
|
|
48
48
|
status_result = self._check_server_status()
|
|
@@ -54,17 +54,17 @@ class MCPCheck(BaseDiagnosticCheck):
|
|
|
54
54
|
sub_results.append(startup_result)
|
|
55
55
|
|
|
56
56
|
# Determine overall status
|
|
57
|
-
if any(r.status ==
|
|
58
|
-
status =
|
|
57
|
+
if any(r.status == ValidationSeverity.ERROR for r in sub_results):
|
|
58
|
+
status = ValidationSeverity.ERROR
|
|
59
59
|
message = "MCP server has critical issues"
|
|
60
60
|
elif not details.get("installed", False):
|
|
61
|
-
status =
|
|
61
|
+
status = ValidationSeverity.WARNING
|
|
62
62
|
message = "MCP server not installed"
|
|
63
|
-
elif any(r.status ==
|
|
64
|
-
status =
|
|
63
|
+
elif any(r.status == ValidationSeverity.WARNING for r in sub_results):
|
|
64
|
+
status = ValidationSeverity.WARNING
|
|
65
65
|
message = "MCP server needs configuration"
|
|
66
66
|
else:
|
|
67
|
-
status =
|
|
67
|
+
status = OperationResult.SUCCESS
|
|
68
68
|
message = "MCP server properly configured"
|
|
69
69
|
|
|
70
70
|
return DiagnosticResult(
|
|
@@ -78,7 +78,7 @@ class MCPCheck(BaseDiagnosticCheck):
|
|
|
78
78
|
except Exception as e:
|
|
79
79
|
return DiagnosticResult(
|
|
80
80
|
category=self.category,
|
|
81
|
-
status=
|
|
81
|
+
status=ValidationSeverity.ERROR,
|
|
82
82
|
message=f"MCP check failed: {e!s}",
|
|
83
83
|
details={"error": str(e)},
|
|
84
84
|
)
|
|
@@ -96,7 +96,7 @@ class MCPCheck(BaseDiagnosticCheck):
|
|
|
96
96
|
if mcp_path.exists():
|
|
97
97
|
return DiagnosticResult(
|
|
98
98
|
category="MCP Installation",
|
|
99
|
-
status=
|
|
99
|
+
status=OperationResult.SUCCESS,
|
|
100
100
|
message="MCP server installed",
|
|
101
101
|
details={"path": str(mcp_path), "installed": True},
|
|
102
102
|
)
|
|
@@ -114,7 +114,7 @@ class MCPCheck(BaseDiagnosticCheck):
|
|
|
114
114
|
path = result.stdout.strip()
|
|
115
115
|
return DiagnosticResult(
|
|
116
116
|
category="MCP Installation",
|
|
117
|
-
status=
|
|
117
|
+
status=OperationResult.SUCCESS,
|
|
118
118
|
message="MCP server installed",
|
|
119
119
|
details={"path": path, "installed": True},
|
|
120
120
|
)
|
|
@@ -123,7 +123,7 @@ class MCPCheck(BaseDiagnosticCheck):
|
|
|
123
123
|
|
|
124
124
|
return DiagnosticResult(
|
|
125
125
|
category="MCP Installation",
|
|
126
|
-
status=
|
|
126
|
+
status=ValidationSeverity.WARNING,
|
|
127
127
|
message="MCP server not installed",
|
|
128
128
|
details={"installed": False},
|
|
129
129
|
fix_command="claude-mpm mcp install",
|
|
@@ -148,7 +148,7 @@ class MCPCheck(BaseDiagnosticCheck):
|
|
|
148
148
|
if not config_path:
|
|
149
149
|
return DiagnosticResult(
|
|
150
150
|
category="MCP Configuration",
|
|
151
|
-
status=
|
|
151
|
+
status=ValidationSeverity.WARNING,
|
|
152
152
|
message="Claude Code config not found",
|
|
153
153
|
details={"configured": False},
|
|
154
154
|
fix_command="claude-mpm mcp config",
|
|
@@ -165,7 +165,7 @@ class MCPCheck(BaseDiagnosticCheck):
|
|
|
165
165
|
if not gateway:
|
|
166
166
|
return DiagnosticResult(
|
|
167
167
|
category="MCP Configuration",
|
|
168
|
-
status=
|
|
168
|
+
status=ValidationSeverity.WARNING,
|
|
169
169
|
message="MCP gateway not configured",
|
|
170
170
|
details={"configured": False, "config_path": str(config_path)},
|
|
171
171
|
fix_command="claude-mpm mcp config",
|
|
@@ -177,7 +177,7 @@ class MCPCheck(BaseDiagnosticCheck):
|
|
|
177
177
|
if not command:
|
|
178
178
|
return DiagnosticResult(
|
|
179
179
|
category="MCP Configuration",
|
|
180
|
-
status=
|
|
180
|
+
status=ValidationSeverity.ERROR,
|
|
181
181
|
message="MCP gateway misconfigured (no command)",
|
|
182
182
|
details={
|
|
183
183
|
"configured": True,
|
|
@@ -190,7 +190,7 @@ class MCPCheck(BaseDiagnosticCheck):
|
|
|
190
190
|
|
|
191
191
|
return DiagnosticResult(
|
|
192
192
|
category="MCP Configuration",
|
|
193
|
-
status=
|
|
193
|
+
status=OperationResult.SUCCESS,
|
|
194
194
|
message="MCP gateway configured",
|
|
195
195
|
details={
|
|
196
196
|
"configured": True,
|
|
@@ -202,7 +202,7 @@ class MCPCheck(BaseDiagnosticCheck):
|
|
|
202
202
|
except json.JSONDecodeError as e:
|
|
203
203
|
return DiagnosticResult(
|
|
204
204
|
category="MCP Configuration",
|
|
205
|
-
status=
|
|
205
|
+
status=ValidationSeverity.ERROR,
|
|
206
206
|
message="Invalid JSON in config file",
|
|
207
207
|
details={"error": str(e), "config_path": str(config_path)},
|
|
208
208
|
fix_description="Fix JSON syntax in Claude Code config",
|
|
@@ -210,7 +210,7 @@ class MCPCheck(BaseDiagnosticCheck):
|
|
|
210
210
|
except Exception as e:
|
|
211
211
|
return DiagnosticResult(
|
|
212
212
|
category="MCP Configuration",
|
|
213
|
-
status=
|
|
213
|
+
status=ValidationSeverity.WARNING,
|
|
214
214
|
message=f"Could not check configuration: {e!s}",
|
|
215
215
|
details={"error": str(e)},
|
|
216
216
|
)
|
|
@@ -231,13 +231,13 @@ class MCPCheck(BaseDiagnosticCheck):
|
|
|
231
231
|
if ServiceState.RUNNING.value in result.stdout.lower():
|
|
232
232
|
return DiagnosticResult(
|
|
233
233
|
category="MCP Server Status",
|
|
234
|
-
status=
|
|
234
|
+
status=OperationResult.SUCCESS,
|
|
235
235
|
message="MCP server is running",
|
|
236
236
|
details={"running": True, "state": ServiceState.RUNNING},
|
|
237
237
|
)
|
|
238
238
|
return DiagnosticResult(
|
|
239
239
|
category="MCP Server Status",
|
|
240
|
-
status=
|
|
240
|
+
status=ValidationSeverity.WARNING,
|
|
241
241
|
message="MCP server not running",
|
|
242
242
|
details={"running": False, "state": ServiceState.STOPPED},
|
|
243
243
|
fix_command="claude-mpm mcp start",
|
|
@@ -245,7 +245,7 @@ class MCPCheck(BaseDiagnosticCheck):
|
|
|
245
245
|
)
|
|
246
246
|
return DiagnosticResult(
|
|
247
247
|
category="MCP Server Status",
|
|
248
|
-
status=
|
|
248
|
+
status=ValidationSeverity.WARNING,
|
|
249
249
|
message="Could not determine server status",
|
|
250
250
|
details={
|
|
251
251
|
"running": "unknown",
|
|
@@ -257,7 +257,7 @@ class MCPCheck(BaseDiagnosticCheck):
|
|
|
257
257
|
except subprocess.TimeoutExpired:
|
|
258
258
|
return DiagnosticResult(
|
|
259
259
|
category="MCP Server Status",
|
|
260
|
-
status=
|
|
260
|
+
status=ValidationSeverity.WARNING,
|
|
261
261
|
message="Server status check timed out",
|
|
262
262
|
details={
|
|
263
263
|
"running": "unknown",
|
|
@@ -268,7 +268,7 @@ class MCPCheck(BaseDiagnosticCheck):
|
|
|
268
268
|
except Exception as e:
|
|
269
269
|
return DiagnosticResult(
|
|
270
270
|
category="MCP Server Status",
|
|
271
|
-
status=
|
|
271
|
+
status=ValidationSeverity.WARNING,
|
|
272
272
|
message=f"Could not check server status: {e!s}",
|
|
273
273
|
details={
|
|
274
274
|
"running": "unknown",
|
|
@@ -290,7 +290,7 @@ class MCPCheck(BaseDiagnosticCheck):
|
|
|
290
290
|
if not issues:
|
|
291
291
|
return DiagnosticResult(
|
|
292
292
|
category="MCP Startup Verification",
|
|
293
|
-
status=
|
|
293
|
+
status=OperationResult.SUCCESS,
|
|
294
294
|
message="Startup verification passed",
|
|
295
295
|
details={"issues": []},
|
|
296
296
|
)
|
|
@@ -304,20 +304,20 @@ class MCPCheck(BaseDiagnosticCheck):
|
|
|
304
304
|
if errors:
|
|
305
305
|
return DiagnosticResult(
|
|
306
306
|
category="MCP Startup Verification",
|
|
307
|
-
status=
|
|
307
|
+
status=ValidationSeverity.ERROR,
|
|
308
308
|
message=f"{len(errors)} critical issue(s) found",
|
|
309
309
|
details={"errors": errors, "warnings": warnings},
|
|
310
310
|
)
|
|
311
311
|
if warnings:
|
|
312
312
|
return DiagnosticResult(
|
|
313
313
|
category="MCP Startup Verification",
|
|
314
|
-
status=
|
|
314
|
+
status=ValidationSeverity.WARNING,
|
|
315
315
|
message=f"{len(warnings)} warning(s) found",
|
|
316
316
|
details={"warnings": warnings},
|
|
317
317
|
)
|
|
318
318
|
return DiagnosticResult(
|
|
319
319
|
category="MCP Startup Verification",
|
|
320
|
-
status=
|
|
320
|
+
status=OperationResult.SUCCESS,
|
|
321
321
|
message="Startup verification passed",
|
|
322
322
|
details={"issues": []},
|
|
323
323
|
)
|
|
@@ -325,7 +325,7 @@ class MCPCheck(BaseDiagnosticCheck):
|
|
|
325
325
|
except Exception as e:
|
|
326
326
|
return DiagnosticResult(
|
|
327
327
|
category="MCP Startup Verification",
|
|
328
|
-
status=
|
|
328
|
+
status=ValidationSeverity.WARNING,
|
|
329
329
|
message=f"Could not verify startup: {e!s}",
|
|
330
330
|
details={"error": str(e)},
|
|
331
331
|
)
|