claude-mpm 5.6.23__py3-none-any.whl → 5.6.73__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/auth/__init__.py +35 -0
- claude_mpm/auth/callback_server.py +328 -0
- claude_mpm/auth/models.py +104 -0
- claude_mpm/auth/oauth_manager.py +266 -0
- claude_mpm/auth/providers/__init__.py +12 -0
- claude_mpm/auth/providers/base.py +165 -0
- claude_mpm/auth/providers/google.py +261 -0
- claude_mpm/auth/token_storage.py +252 -0
- claude_mpm/cli/commands/commander.py +6 -6
- claude_mpm/cli/commands/mcp.py +29 -17
- claude_mpm/cli/commands/mcp_command_router.py +39 -0
- claude_mpm/cli/commands/mcp_service_commands.py +304 -0
- claude_mpm/cli/commands/oauth.py +481 -0
- claude_mpm/cli/executor.py +9 -0
- claude_mpm/cli/helpers.py +1 -1
- claude_mpm/cli/parsers/base_parser.py +13 -0
- claude_mpm/cli/parsers/mcp_parser.py +79 -0
- claude_mpm/cli/parsers/oauth_parser.py +165 -0
- claude_mpm/cli/startup.py +150 -33
- claude_mpm/cli/startup_display.py +3 -2
- claude_mpm/commander/chat/cli.py +5 -2
- claude_mpm/commander/chat/commands.py +42 -16
- claude_mpm/commander/chat/repl.py +1581 -70
- claude_mpm/commander/events/manager.py +61 -1
- claude_mpm/commander/frameworks/base.py +87 -0
- claude_mpm/commander/frameworks/mpm.py +9 -14
- claude_mpm/commander/git/__init__.py +5 -0
- claude_mpm/commander/git/worktree_manager.py +212 -0
- claude_mpm/commander/instance_manager.py +428 -13
- claude_mpm/commander/models/events.py +6 -0
- claude_mpm/commander/persistence/state_store.py +95 -1
- claude_mpm/commander/tmux_orchestrator.py +3 -2
- claude_mpm/constants.py +5 -0
- claude_mpm/core/hook_manager.py +2 -1
- claude_mpm/core/logging_utils.py +4 -2
- claude_mpm/core/output_style_manager.py +5 -2
- claude_mpm/core/socketio_pool.py +34 -10
- claude_mpm/hooks/claude_hooks/auto_pause_handler.py +1 -1
- claude_mpm/hooks/claude_hooks/event_handlers.py +206 -94
- claude_mpm/hooks/claude_hooks/hook_handler.py +115 -32
- claude_mpm/hooks/claude_hooks/installer.py +175 -51
- claude_mpm/hooks/claude_hooks/memory_integration.py +1 -1
- claude_mpm/hooks/claude_hooks/response_tracking.py +1 -1
- claude_mpm/hooks/claude_hooks/services/__init__.py +21 -0
- claude_mpm/hooks/claude_hooks/services/connection_manager.py +2 -2
- claude_mpm/hooks/claude_hooks/services/connection_manager_http.py +2 -2
- claude_mpm/hooks/claude_hooks/services/container.py +326 -0
- claude_mpm/hooks/claude_hooks/services/protocols.py +328 -0
- claude_mpm/hooks/claude_hooks/services/state_manager.py +2 -2
- claude_mpm/hooks/claude_hooks/services/subagent_processor.py +2 -2
- claude_mpm/hooks/templates/pre_tool_use_simple.py +6 -6
- claude_mpm/hooks/templates/pre_tool_use_template.py +6 -6
- claude_mpm/init.py +21 -14
- claude_mpm/mcp/__init__.py +9 -0
- claude_mpm/mcp/google_workspace_server.py +610 -0
- claude_mpm/scripts/claude-hook-handler.sh +3 -3
- claude_mpm/services/command_deployment_service.py +44 -26
- claude_mpm/services/hook_installer_service.py +77 -8
- claude_mpm/services/mcp_config_manager.py +99 -19
- claude_mpm/services/mcp_service_registry.py +294 -0
- claude_mpm/services/monitor/server.py +6 -1
- {claude_mpm-5.6.23.dist-info → claude_mpm-5.6.73.dist-info}/METADATA +24 -1
- {claude_mpm-5.6.23.dist-info → claude_mpm-5.6.73.dist-info}/RECORD +69 -64
- {claude_mpm-5.6.23.dist-info → claude_mpm-5.6.73.dist-info}/WHEEL +1 -1
- {claude_mpm-5.6.23.dist-info → claude_mpm-5.6.73.dist-info}/entry_points.txt +2 -0
- claude_mpm/hooks/claude_hooks/__pycache__/__init__.cpython-311.pyc +0 -0
- claude_mpm/hooks/claude_hooks/__pycache__/auto_pause_handler.cpython-311.pyc +0 -0
- claude_mpm/hooks/claude_hooks/__pycache__/correlation_manager.cpython-311.pyc +0 -0
- claude_mpm/hooks/claude_hooks/__pycache__/event_handlers.cpython-311.pyc +0 -0
- claude_mpm/hooks/claude_hooks/__pycache__/hook_handler.cpython-311.pyc +0 -0
- claude_mpm/hooks/claude_hooks/__pycache__/memory_integration.cpython-311.pyc +0 -0
- claude_mpm/hooks/claude_hooks/__pycache__/response_tracking.cpython-311.pyc +0 -0
- claude_mpm/hooks/claude_hooks/__pycache__/tool_analysis.cpython-311.pyc +0 -0
- claude_mpm/hooks/claude_hooks/services/__pycache__/__init__.cpython-311.pyc +0 -0
- claude_mpm/hooks/claude_hooks/services/__pycache__/connection_manager_http.cpython-311.pyc +0 -0
- claude_mpm/hooks/claude_hooks/services/__pycache__/duplicate_detector.cpython-311.pyc +0 -0
- claude_mpm/hooks/claude_hooks/services/__pycache__/state_manager.cpython-311.pyc +0 -0
- claude_mpm/hooks/claude_hooks/services/__pycache__/subagent_processor.cpython-311.pyc +0 -0
- {claude_mpm-5.6.23.dist-info → claude_mpm-5.6.73.dist-info}/licenses/LICENSE +0 -0
- {claude_mpm-5.6.23.dist-info → claude_mpm-5.6.73.dist-info}/licenses/LICENSE-FAQ.md +0 -0
- {claude_mpm-5.6.23.dist-info → claude_mpm-5.6.73.dist-info}/top_level.txt +0 -0
|
@@ -38,7 +38,7 @@ def main():
|
|
|
38
38
|
# Read event from stdin
|
|
39
39
|
event_data = sys.stdin.read()
|
|
40
40
|
if not event_data.strip():
|
|
41
|
-
print(json.dumps({"
|
|
41
|
+
print(json.dumps({"continue": True}))
|
|
42
42
|
return
|
|
43
43
|
|
|
44
44
|
event = json.loads(event_data)
|
|
@@ -49,7 +49,7 @@ def main():
|
|
|
49
49
|
if tool_name == "Grep" and "-n" not in tool_input:
|
|
50
50
|
modified_input = tool_input.copy()
|
|
51
51
|
modified_input["-n"] = True
|
|
52
|
-
print(json.dumps({"
|
|
52
|
+
print(json.dumps({"continue": True, "tool_input": modified_input}))
|
|
53
53
|
return
|
|
54
54
|
|
|
55
55
|
# Example: Block operations on .env files
|
|
@@ -59,19 +59,19 @@ def main():
|
|
|
59
59
|
print(
|
|
60
60
|
json.dumps(
|
|
61
61
|
{
|
|
62
|
-
"
|
|
63
|
-
"
|
|
62
|
+
"continue": False,
|
|
63
|
+
"stopReason": "Access to .env file blocked for security",
|
|
64
64
|
}
|
|
65
65
|
)
|
|
66
66
|
)
|
|
67
67
|
return
|
|
68
68
|
|
|
69
69
|
# Default: continue without modification
|
|
70
|
-
print(json.dumps({"
|
|
70
|
+
print(json.dumps({"continue": True}))
|
|
71
71
|
|
|
72
72
|
except Exception:
|
|
73
73
|
# Always continue on error to avoid blocking Claude
|
|
74
|
-
print(json.dumps({"
|
|
74
|
+
print(json.dumps({"continue": True}))
|
|
75
75
|
|
|
76
76
|
|
|
77
77
|
if __name__ == "__main__":
|
|
@@ -29,7 +29,7 @@ Input Format (stdin):
|
|
|
29
29
|
|
|
30
30
|
Output Format (stdout):
|
|
31
31
|
{
|
|
32
|
-
"
|
|
32
|
+
"continue": true,
|
|
33
33
|
"tool_input": {
|
|
34
34
|
"file_path": "/path/to/file.py",
|
|
35
35
|
"old_string": "foo",
|
|
@@ -39,13 +39,13 @@ Output Format (stdout):
|
|
|
39
39
|
|
|
40
40
|
Or to block execution:
|
|
41
41
|
{
|
|
42
|
-
"
|
|
43
|
-
"
|
|
42
|
+
"continue": false,
|
|
43
|
+
"stopReason": "Reason for blocking"
|
|
44
44
|
}
|
|
45
45
|
|
|
46
46
|
Or to continue without modification:
|
|
47
47
|
{
|
|
48
|
-
"
|
|
48
|
+
"continue": true
|
|
49
49
|
}
|
|
50
50
|
"""
|
|
51
51
|
|
|
@@ -94,14 +94,14 @@ class PreToolUseHook:
|
|
|
94
94
|
self, modified_input: Optional[Dict[str, Any]] = None
|
|
95
95
|
) -> None:
|
|
96
96
|
"""Continue execution with optional modified input."""
|
|
97
|
-
response = {"
|
|
97
|
+
response = {"continue": True}
|
|
98
98
|
if modified_input is not None:
|
|
99
99
|
response["tool_input"] = modified_input
|
|
100
100
|
print(json.dumps(response))
|
|
101
101
|
|
|
102
102
|
def block_execution(self, message: str) -> None:
|
|
103
103
|
"""Block execution with a message."""
|
|
104
|
-
response = {"
|
|
104
|
+
response = {"continue": False, "stopReason": message}
|
|
105
105
|
print(json.dumps(response))
|
|
106
106
|
|
|
107
107
|
def modify_input(
|
claude_mpm/init.py
CHANGED
|
@@ -147,9 +147,14 @@ class ProjectInitializer:
|
|
|
147
147
|
|
|
148
148
|
# Print appropriate message to console for visibility during startup
|
|
149
149
|
# BUT: Don't print to stdout when running MCP server (interferes with JSON-RPC)
|
|
150
|
+
# ALSO: Skip output for lightweight commands (oauth, version, help, doctor)
|
|
150
151
|
is_mcp_mode = "mcp" in sys.argv and "start" in sys.argv
|
|
152
|
+
is_lightweight_command = any(
|
|
153
|
+
cmd in sys.argv
|
|
154
|
+
for cmd in ["oauth", "--version", "-v", "--help", "-h", "doctor"]
|
|
155
|
+
)
|
|
151
156
|
|
|
152
|
-
if not is_mcp_mode:
|
|
157
|
+
if not is_mcp_mode and not is_lightweight_command:
|
|
153
158
|
if directory_existed:
|
|
154
159
|
print(f"✓ Found existing .claude-mpm/ directory in {project_root}")
|
|
155
160
|
else:
|
|
@@ -164,13 +169,15 @@ class ProjectInitializer:
|
|
|
164
169
|
)
|
|
165
170
|
|
|
166
171
|
# Verify and deploy PM skills (non-blocking)
|
|
167
|
-
|
|
172
|
+
# Skip for lightweight commands that should run immediately
|
|
173
|
+
suppress_output = is_mcp_mode or is_lightweight_command
|
|
174
|
+
self._verify_and_deploy_pm_skills(project_root, suppress_output)
|
|
168
175
|
|
|
169
176
|
# Setup security hooks (auto-install pre-commit, detect-secrets)
|
|
170
|
-
self._setup_security_hooks(project_root,
|
|
177
|
+
self._setup_security_hooks(project_root, suppress_output)
|
|
171
178
|
|
|
172
179
|
# Perform security checks (non-blocking)
|
|
173
|
-
self._check_security_risks(project_root,
|
|
180
|
+
self._check_security_risks(project_root, suppress_output)
|
|
174
181
|
|
|
175
182
|
return True
|
|
176
183
|
|
|
@@ -406,7 +413,7 @@ class ProjectInitializer:
|
|
|
406
413
|
is_mcp_mode: Whether running in MCP mode (suppress console output)
|
|
407
414
|
"""
|
|
408
415
|
try:
|
|
409
|
-
import subprocess
|
|
416
|
+
import subprocess # nosec B404 - required for git/pre-commit operations
|
|
410
417
|
|
|
411
418
|
# Only set up hooks if this is a git repository
|
|
412
419
|
if not (project_root / ".git").exists():
|
|
@@ -415,7 +422,7 @@ class ProjectInitializer:
|
|
|
415
422
|
|
|
416
423
|
# Check/install pre-commit
|
|
417
424
|
try:
|
|
418
|
-
subprocess.run(
|
|
425
|
+
subprocess.run( # nosec B603 B607 - trusted pre-commit command
|
|
419
426
|
["pre-commit", "--version"],
|
|
420
427
|
capture_output=True,
|
|
421
428
|
text=True,
|
|
@@ -429,7 +436,7 @@ class ProjectInitializer:
|
|
|
429
436
|
):
|
|
430
437
|
self.logger.info("Installing pre-commit...")
|
|
431
438
|
try:
|
|
432
|
-
subprocess.run(
|
|
439
|
+
subprocess.run( # nosec B603 B607 - trusted pip install command
|
|
433
440
|
[sys.executable, "-m", "pip", "install", "pre-commit"],
|
|
434
441
|
capture_output=True,
|
|
435
442
|
text=True,
|
|
@@ -443,7 +450,7 @@ class ProjectInitializer:
|
|
|
443
450
|
|
|
444
451
|
# Check/install detect-secrets
|
|
445
452
|
try:
|
|
446
|
-
subprocess.run(
|
|
453
|
+
subprocess.run( # nosec B603 B607 - trusted detect-secrets command
|
|
447
454
|
["detect-secrets", "--version"],
|
|
448
455
|
capture_output=True,
|
|
449
456
|
text=True,
|
|
@@ -457,7 +464,7 @@ class ProjectInitializer:
|
|
|
457
464
|
):
|
|
458
465
|
self.logger.info("Installing detect-secrets...")
|
|
459
466
|
try:
|
|
460
|
-
subprocess.run(
|
|
467
|
+
subprocess.run( # nosec B603 B607 - trusted pip install command
|
|
461
468
|
[sys.executable, "-m", "pip", "install", "detect-secrets"],
|
|
462
469
|
capture_output=True,
|
|
463
470
|
text=True,
|
|
@@ -486,7 +493,7 @@ class ProjectInitializer:
|
|
|
486
493
|
secrets_baseline = project_root / ".secrets.baseline"
|
|
487
494
|
if not secrets_baseline.exists():
|
|
488
495
|
try:
|
|
489
|
-
subprocess.run(
|
|
496
|
+
subprocess.run( # nosec B603 B607 - trusted detect-secrets command
|
|
490
497
|
["detect-secrets", "scan", "--baseline", ".secrets.baseline"],
|
|
491
498
|
cwd=str(project_root),
|
|
492
499
|
capture_output=True,
|
|
@@ -500,7 +507,7 @@ class ProjectInitializer:
|
|
|
500
507
|
|
|
501
508
|
# Install git hooks
|
|
502
509
|
try:
|
|
503
|
-
subprocess.run(
|
|
510
|
+
subprocess.run( # nosec B603 B607 - trusted pre-commit command
|
|
504
511
|
["pre-commit", "install"],
|
|
505
512
|
cwd=str(project_root),
|
|
506
513
|
capture_output=True,
|
|
@@ -532,7 +539,7 @@ class ProjectInitializer:
|
|
|
532
539
|
is_mcp_mode: Whether running in MCP mode (suppress console output)
|
|
533
540
|
"""
|
|
534
541
|
try:
|
|
535
|
-
import subprocess
|
|
542
|
+
import subprocess # nosec B404 - required for git operations
|
|
536
543
|
|
|
537
544
|
security_issues = []
|
|
538
545
|
|
|
@@ -552,7 +559,7 @@ class ProjectInitializer:
|
|
|
552
559
|
if file_path.exists():
|
|
553
560
|
# Check if file is tracked by git
|
|
554
561
|
try:
|
|
555
|
-
result = subprocess.run(
|
|
562
|
+
result = subprocess.run( # nosec B603 B607 - trusted git command
|
|
556
563
|
["git", "ls-files", str(file_path)],
|
|
557
564
|
check=False,
|
|
558
565
|
cwd=str(project_root),
|
|
@@ -569,7 +576,7 @@ class ProjectInitializer:
|
|
|
569
576
|
|
|
570
577
|
# Check if file is ignored by .gitignore
|
|
571
578
|
try:
|
|
572
|
-
result = subprocess.run(
|
|
579
|
+
result = subprocess.run( # nosec B603 B607 - trusted git command
|
|
573
580
|
["git", "check-ignore", str(file_path)],
|
|
574
581
|
check=False,
|
|
575
582
|
cwd=str(project_root),
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
"""MCP servers for claude-mpm integration.
|
|
2
|
+
|
|
3
|
+
This module provides MCP (Model Context Protocol) servers that integrate
|
|
4
|
+
with claude-mpm's authentication and token management system.
|
|
5
|
+
"""
|
|
6
|
+
|
|
7
|
+
from claude_mpm.mcp.google_workspace_server import main
|
|
8
|
+
|
|
9
|
+
__all__ = ["main"]
|