claude-mpm 5.6.23__py3-none-any.whl → 5.6.72__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/__pycache__/auto_pause_handler.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/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/__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__/container.cpython-311.pyc +0 -0
- claude_mpm/hooks/claude_hooks/services/__pycache__/protocols.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/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.72.dist-info}/METADATA +24 -1
- {claude_mpm-5.6.23.dist-info → claude_mpm-5.6.72.dist-info}/RECORD +80 -60
- {claude_mpm-5.6.23.dist-info → claude_mpm-5.6.72.dist-info}/WHEEL +1 -1
- {claude_mpm-5.6.23.dist-info → claude_mpm-5.6.72.dist-info}/entry_points.txt +2 -0
- {claude_mpm-5.6.23.dist-info → claude_mpm-5.6.72.dist-info}/licenses/LICENSE +0 -0
- {claude_mpm-5.6.23.dist-info → claude_mpm-5.6.72.dist-info}/licenses/LICENSE-FAQ.md +0 -0
- {claude_mpm-5.6.23.dist-info → claude_mpm-5.6.72.dist-info}/top_level.txt +0 -0
|
@@ -0,0 +1,252 @@
|
|
|
1
|
+
"""Secure OAuth token storage with Fernet encryption and keyring.
|
|
2
|
+
|
|
3
|
+
This module provides encrypted persistence for OAuth tokens, using
|
|
4
|
+
the system keyring for encryption key storage and Fernet symmetric
|
|
5
|
+
encryption for the actual token data.
|
|
6
|
+
|
|
7
|
+
Security Features:
|
|
8
|
+
- Encryption keys stored in system keyring (not on disk)
|
|
9
|
+
- Fernet symmetric encryption for token data
|
|
10
|
+
- File permissions restricted to owner only (600)
|
|
11
|
+
- Credentials stored in user-specific directory
|
|
12
|
+
"""
|
|
13
|
+
|
|
14
|
+
import json
|
|
15
|
+
import stat
|
|
16
|
+
from pathlib import Path
|
|
17
|
+
from typing import Optional
|
|
18
|
+
|
|
19
|
+
import keyring
|
|
20
|
+
from cryptography.fernet import Fernet, InvalidToken
|
|
21
|
+
|
|
22
|
+
from claude_mpm.auth.models import OAuthToken, StoredToken, TokenMetadata, TokenStatus
|
|
23
|
+
|
|
24
|
+
# Keyring service identifier for encryption keys
|
|
25
|
+
KEYRING_SERVICE = "claude-mpm-oauth"
|
|
26
|
+
|
|
27
|
+
# Default credentials directory
|
|
28
|
+
CREDENTIALS_DIR = Path.home() / ".claude-mpm" / "credentials"
|
|
29
|
+
|
|
30
|
+
|
|
31
|
+
class TokenStorage:
|
|
32
|
+
"""Secure storage for OAuth tokens using Fernet encryption.
|
|
33
|
+
|
|
34
|
+
Tokens are encrypted using Fernet symmetric encryption with keys
|
|
35
|
+
stored securely in the system keyring. Token files are stored
|
|
36
|
+
with restricted permissions (600) in the credentials directory.
|
|
37
|
+
|
|
38
|
+
Attributes:
|
|
39
|
+
credentials_dir: Directory where encrypted tokens are stored.
|
|
40
|
+
|
|
41
|
+
Example:
|
|
42
|
+
```python
|
|
43
|
+
storage = TokenStorage()
|
|
44
|
+
|
|
45
|
+
# Store a token
|
|
46
|
+
token = OAuthToken(
|
|
47
|
+
access_token="abc123",
|
|
48
|
+
expires_at=datetime.now(timezone.utc) + timedelta(hours=1),
|
|
49
|
+
scopes=["read", "write"]
|
|
50
|
+
)
|
|
51
|
+
metadata = TokenMetadata(service_name="github-mcp", provider="github")
|
|
52
|
+
storage.store("github-mcp", token, metadata)
|
|
53
|
+
|
|
54
|
+
# Retrieve the token
|
|
55
|
+
stored = storage.retrieve("github-mcp")
|
|
56
|
+
if stored:
|
|
57
|
+
print(f"Token expires at: {stored.token.expires_at}")
|
|
58
|
+
```
|
|
59
|
+
"""
|
|
60
|
+
|
|
61
|
+
def __init__(self, credentials_dir: Optional[Path] = None) -> None:
|
|
62
|
+
"""Initialize token storage.
|
|
63
|
+
|
|
64
|
+
Args:
|
|
65
|
+
credentials_dir: Custom directory for storing encrypted tokens.
|
|
66
|
+
Defaults to ~/.claude-mpm/credentials/
|
|
67
|
+
"""
|
|
68
|
+
self.credentials_dir = credentials_dir or CREDENTIALS_DIR
|
|
69
|
+
self._ensure_credentials_dir()
|
|
70
|
+
|
|
71
|
+
def _ensure_credentials_dir(self) -> None:
|
|
72
|
+
"""Create credentials directory with secure permissions if needed."""
|
|
73
|
+
if not self.credentials_dir.exists():
|
|
74
|
+
self.credentials_dir.mkdir(parents=True, mode=0o700)
|
|
75
|
+
else:
|
|
76
|
+
# Ensure directory has correct permissions
|
|
77
|
+
self.credentials_dir.chmod(0o700)
|
|
78
|
+
|
|
79
|
+
def _get_encryption_key(self, service_name: str) -> bytes:
|
|
80
|
+
"""Get or create the Fernet encryption key for a service.
|
|
81
|
+
|
|
82
|
+
Keys are stored in the system keyring, not on disk.
|
|
83
|
+
|
|
84
|
+
Args:
|
|
85
|
+
service_name: Name of the service to get/create key for.
|
|
86
|
+
|
|
87
|
+
Returns:
|
|
88
|
+
Fernet encryption key as bytes.
|
|
89
|
+
"""
|
|
90
|
+
key_name = f"{service_name}-key"
|
|
91
|
+
existing_key = keyring.get_password(KEYRING_SERVICE, key_name)
|
|
92
|
+
|
|
93
|
+
if existing_key:
|
|
94
|
+
return existing_key.encode()
|
|
95
|
+
|
|
96
|
+
# Generate new key and store in keyring
|
|
97
|
+
new_key = Fernet.generate_key()
|
|
98
|
+
keyring.set_password(KEYRING_SERVICE, key_name, new_key.decode())
|
|
99
|
+
return new_key
|
|
100
|
+
|
|
101
|
+
def _delete_encryption_key(self, service_name: str) -> None:
|
|
102
|
+
"""Delete the encryption key for a service from keyring.
|
|
103
|
+
|
|
104
|
+
Args:
|
|
105
|
+
service_name: Name of the service to delete key for.
|
|
106
|
+
"""
|
|
107
|
+
key_name = f"{service_name}-key"
|
|
108
|
+
try:
|
|
109
|
+
keyring.delete_password(KEYRING_SERVICE, key_name)
|
|
110
|
+
except keyring.errors.PasswordDeleteError:
|
|
111
|
+
pass # Key doesn't exist, nothing to delete
|
|
112
|
+
|
|
113
|
+
def _get_token_path(self, service_name: str) -> Path:
|
|
114
|
+
"""Get the file path for a service's encrypted token.
|
|
115
|
+
|
|
116
|
+
Args:
|
|
117
|
+
service_name: Name of the service.
|
|
118
|
+
|
|
119
|
+
Returns:
|
|
120
|
+
Path to the encrypted token file.
|
|
121
|
+
"""
|
|
122
|
+
# Sanitize service name for filesystem
|
|
123
|
+
safe_name = "".join(
|
|
124
|
+
c if c.isalnum() or c in "-_" else "_" for c in service_name
|
|
125
|
+
)
|
|
126
|
+
return self.credentials_dir / f"{safe_name}.enc"
|
|
127
|
+
|
|
128
|
+
def store(
|
|
129
|
+
self,
|
|
130
|
+
service_name: str,
|
|
131
|
+
token: OAuthToken,
|
|
132
|
+
metadata: TokenMetadata,
|
|
133
|
+
) -> None:
|
|
134
|
+
"""Store an OAuth token securely.
|
|
135
|
+
|
|
136
|
+
The token is encrypted using Fernet symmetric encryption with
|
|
137
|
+
a key stored in the system keyring. The encrypted data is
|
|
138
|
+
written to a file with 600 permissions.
|
|
139
|
+
|
|
140
|
+
Args:
|
|
141
|
+
service_name: Unique identifier for the service.
|
|
142
|
+
token: OAuth token data to store.
|
|
143
|
+
metadata: Token metadata including provider info.
|
|
144
|
+
"""
|
|
145
|
+
stored_token = StoredToken(
|
|
146
|
+
version=1,
|
|
147
|
+
metadata=metadata,
|
|
148
|
+
token=token,
|
|
149
|
+
)
|
|
150
|
+
|
|
151
|
+
# Serialize to JSON
|
|
152
|
+
token_json = stored_token.model_dump_json()
|
|
153
|
+
|
|
154
|
+
# Encrypt the token data
|
|
155
|
+
key = self._get_encryption_key(service_name)
|
|
156
|
+
fernet = Fernet(key)
|
|
157
|
+
encrypted_data = fernet.encrypt(token_json.encode())
|
|
158
|
+
|
|
159
|
+
# Write encrypted data with secure permissions
|
|
160
|
+
token_path = self._get_token_path(service_name)
|
|
161
|
+
token_path.write_bytes(encrypted_data)
|
|
162
|
+
|
|
163
|
+
# Set file permissions to owner read/write only (600)
|
|
164
|
+
token_path.chmod(stat.S_IRUSR | stat.S_IWUSR)
|
|
165
|
+
|
|
166
|
+
def retrieve(self, service_name: str) -> Optional[StoredToken]:
|
|
167
|
+
"""Retrieve a stored OAuth token.
|
|
168
|
+
|
|
169
|
+
Args:
|
|
170
|
+
service_name: Unique identifier for the service.
|
|
171
|
+
|
|
172
|
+
Returns:
|
|
173
|
+
StoredToken if found and valid, None otherwise.
|
|
174
|
+
"""
|
|
175
|
+
token_path = self._get_token_path(service_name)
|
|
176
|
+
|
|
177
|
+
if not token_path.exists():
|
|
178
|
+
return None
|
|
179
|
+
|
|
180
|
+
try:
|
|
181
|
+
# Read encrypted data
|
|
182
|
+
encrypted_data = token_path.read_bytes()
|
|
183
|
+
|
|
184
|
+
# Decrypt
|
|
185
|
+
key = self._get_encryption_key(service_name)
|
|
186
|
+
fernet = Fernet(key)
|
|
187
|
+
decrypted_data = fernet.decrypt(encrypted_data)
|
|
188
|
+
|
|
189
|
+
# Deserialize
|
|
190
|
+
return StoredToken.model_validate_json(decrypted_data)
|
|
191
|
+
|
|
192
|
+
except (InvalidToken, json.JSONDecodeError, ValueError):
|
|
193
|
+
# Token is corrupted or invalid
|
|
194
|
+
return None
|
|
195
|
+
|
|
196
|
+
def delete(self, service_name: str) -> bool:
|
|
197
|
+
"""Delete a stored token and its encryption key.
|
|
198
|
+
|
|
199
|
+
Args:
|
|
200
|
+
service_name: Unique identifier for the service.
|
|
201
|
+
|
|
202
|
+
Returns:
|
|
203
|
+
True if token was deleted, False if it didn't exist.
|
|
204
|
+
"""
|
|
205
|
+
token_path = self._get_token_path(service_name)
|
|
206
|
+
|
|
207
|
+
if not token_path.exists():
|
|
208
|
+
return False
|
|
209
|
+
|
|
210
|
+
# Delete the token file
|
|
211
|
+
token_path.unlink()
|
|
212
|
+
|
|
213
|
+
# Delete the encryption key from keyring
|
|
214
|
+
self._delete_encryption_key(service_name)
|
|
215
|
+
|
|
216
|
+
return True
|
|
217
|
+
|
|
218
|
+
def list_services(self) -> list[str]:
|
|
219
|
+
"""List all services with stored tokens.
|
|
220
|
+
|
|
221
|
+
Returns:
|
|
222
|
+
List of service names that have stored tokens.
|
|
223
|
+
"""
|
|
224
|
+
services = []
|
|
225
|
+
for path in self.credentials_dir.glob("*.enc"):
|
|
226
|
+
# Extract service name from filename
|
|
227
|
+
service_name = path.stem
|
|
228
|
+
services.append(service_name)
|
|
229
|
+
return sorted(services)
|
|
230
|
+
|
|
231
|
+
def get_status(self, service_name: str) -> TokenStatus:
|
|
232
|
+
"""Get the status of a stored token.
|
|
233
|
+
|
|
234
|
+
Args:
|
|
235
|
+
service_name: Unique identifier for the service.
|
|
236
|
+
|
|
237
|
+
Returns:
|
|
238
|
+
TokenStatus indicating the token's current state.
|
|
239
|
+
"""
|
|
240
|
+
stored = self.retrieve(service_name)
|
|
241
|
+
|
|
242
|
+
if stored is None:
|
|
243
|
+
token_path = self._get_token_path(service_name)
|
|
244
|
+
if token_path.exists():
|
|
245
|
+
# File exists but couldn't be decrypted
|
|
246
|
+
return TokenStatus.INVALID
|
|
247
|
+
return TokenStatus.MISSING
|
|
248
|
+
|
|
249
|
+
if stored.token.is_expired():
|
|
250
|
+
return TokenStatus.EXPIRED
|
|
251
|
+
|
|
252
|
+
return TokenStatus.VALID
|
|
@@ -43,12 +43,12 @@ def display_commander_banner():
|
|
|
43
43
|
|
|
44
44
|
# Commander ASCII art banner
|
|
45
45
|
banner = f"""
|
|
46
|
-
{CYAN}╭{
|
|
47
|
-
{CYAN}│{RESET}{BOLD} ⚡ MPM Commander {RESET}{DIM}v{version}{RESET}{
|
|
48
|
-
{CYAN}│{RESET}{DIM} Multi-Project AI Orchestration{RESET}{
|
|
49
|
-
{CYAN}├{
|
|
50
|
-
{CYAN}│{RESET} {YELLOW}ALPHA{RESET} - APIs may change {
|
|
51
|
-
{CYAN}╰{
|
|
46
|
+
{CYAN}╭{"─" * (width - 2)}╮{RESET}
|
|
47
|
+
{CYAN}│{RESET}{BOLD} ⚡ MPM Commander {RESET}{DIM}v{version}{RESET}{" " * (width - 24 - len(version))}│
|
|
48
|
+
{CYAN}│{RESET}{DIM} Multi-Project AI Orchestration{RESET}{" " * (width - 36)}│
|
|
49
|
+
{CYAN}├{"─" * (width - 2)}┤{RESET}
|
|
50
|
+
{CYAN}│{RESET} {YELLOW}ALPHA{RESET} - APIs may change {" " * (width - 55)}│
|
|
51
|
+
{CYAN}╰{"─" * (width - 2)}╯{RESET}
|
|
52
52
|
"""
|
|
53
53
|
print(banner)
|
|
54
54
|
|
claude_mpm/cli/commands/mcp.py
CHANGED
|
@@ -33,7 +33,27 @@ def manage_mcp(args):
|
|
|
33
33
|
"""
|
|
34
34
|
logger = get_logger("cli.mcp")
|
|
35
35
|
|
|
36
|
-
#
|
|
36
|
+
# Commands that don't require full MCP Gateway or mcp package
|
|
37
|
+
# These only need mcp_service_registry which doesn't require the mcp package
|
|
38
|
+
service_mgmt_commands = {
|
|
39
|
+
MCPCommands.ENABLE.value,
|
|
40
|
+
MCPCommands.DISABLE.value,
|
|
41
|
+
MCPCommands.LIST.value,
|
|
42
|
+
}
|
|
43
|
+
|
|
44
|
+
# Route service management commands directly without any MCP dependencies
|
|
45
|
+
if args.mcp_command in service_mgmt_commands:
|
|
46
|
+
try:
|
|
47
|
+
from .mcp_command_router import MCPCommandRouter
|
|
48
|
+
|
|
49
|
+
router = MCPCommandRouter(logger)
|
|
50
|
+
return router.route_command(args)
|
|
51
|
+
except Exception as e:
|
|
52
|
+
logger.error(f"Error running service command: {e}", exc_info=True)
|
|
53
|
+
print(f"Error: {e}")
|
|
54
|
+
return 1
|
|
55
|
+
|
|
56
|
+
# Now check for mcp package for other commands
|
|
37
57
|
import importlib.util
|
|
38
58
|
|
|
39
59
|
mcp_spec = importlib.util.find_spec("mcp")
|
|
@@ -58,22 +78,14 @@ def manage_mcp(args):
|
|
|
58
78
|
except ImportError as e:
|
|
59
79
|
# Provide minimal fallbacks for basic commands
|
|
60
80
|
logger.warning(f"Some MCP Gateway services not available: {e}")
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
print(
|
|
70
|
-
"\nError: MCP Gateway services not fully available",
|
|
71
|
-
file=sys.stderr,
|
|
72
|
-
)
|
|
73
|
-
print(f"Details: {e}", file=sys.stderr)
|
|
74
|
-
print("\nTry running:", file=sys.stderr)
|
|
75
|
-
print(" claude-mpm mcp install", file=sys.stderr)
|
|
76
|
-
return 1
|
|
81
|
+
print(
|
|
82
|
+
"\nError: MCP Gateway services not fully available",
|
|
83
|
+
file=sys.stderr,
|
|
84
|
+
)
|
|
85
|
+
print(f"Details: {e}", file=sys.stderr)
|
|
86
|
+
print("\nTry running:", file=sys.stderr)
|
|
87
|
+
print(" claude-mpm mcp install", file=sys.stderr)
|
|
88
|
+
return 1
|
|
77
89
|
|
|
78
90
|
if not args.mcp_command:
|
|
79
91
|
# No subcommand - show status by default
|
|
@@ -48,6 +48,15 @@ class MCPCommandRouter:
|
|
|
48
48
|
if args.mcp_command == MCPCommands.EXTERNAL.value:
|
|
49
49
|
return self._manage_external(args)
|
|
50
50
|
|
|
51
|
+
if args.mcp_command == MCPCommands.ENABLE.value:
|
|
52
|
+
return self._enable_service(args)
|
|
53
|
+
|
|
54
|
+
if args.mcp_command == MCPCommands.DISABLE.value:
|
|
55
|
+
return self._disable_service(args)
|
|
56
|
+
|
|
57
|
+
if args.mcp_command == MCPCommands.LIST.value:
|
|
58
|
+
return self._list_services(args)
|
|
59
|
+
|
|
51
60
|
if args.mcp_command == "cleanup":
|
|
52
61
|
return self._cleanup_locks(args)
|
|
53
62
|
|
|
@@ -134,6 +143,27 @@ class MCPCommandRouter:
|
|
|
134
143
|
handler = MCPExternalCommands(self.logger)
|
|
135
144
|
return handler.manage_external(args)
|
|
136
145
|
|
|
146
|
+
def _enable_service(self, args) -> int:
|
|
147
|
+
"""Enable MCP service command handler."""
|
|
148
|
+
from .mcp_service_commands import MCPServiceCommands
|
|
149
|
+
|
|
150
|
+
handler = MCPServiceCommands(self.logger)
|
|
151
|
+
return handler.enable_service(args)
|
|
152
|
+
|
|
153
|
+
def _disable_service(self, args) -> int:
|
|
154
|
+
"""Disable MCP service command handler."""
|
|
155
|
+
from .mcp_service_commands import MCPServiceCommands
|
|
156
|
+
|
|
157
|
+
handler = MCPServiceCommands(self.logger)
|
|
158
|
+
return handler.disable_service(args)
|
|
159
|
+
|
|
160
|
+
def _list_services(self, args) -> int:
|
|
161
|
+
"""List MCP services command handler."""
|
|
162
|
+
from .mcp_service_commands import MCPServiceCommands
|
|
163
|
+
|
|
164
|
+
handler = MCPServiceCommands(self.logger)
|
|
165
|
+
return handler.list_services(args)
|
|
166
|
+
|
|
137
167
|
def _show_help(self):
|
|
138
168
|
"""Show available MCP commands."""
|
|
139
169
|
print("\nAvailable MCP commands:")
|
|
@@ -148,6 +178,10 @@ class MCPCommandRouter:
|
|
|
148
178
|
print(" config - View and manage configuration")
|
|
149
179
|
print(" external - Manage external MCP services")
|
|
150
180
|
print(" cleanup - Clean up legacy files")
|
|
181
|
+
print("\nService management:")
|
|
182
|
+
print(" enable - Enable an MCP service in configuration")
|
|
183
|
+
print(" disable - Disable an MCP service from configuration")
|
|
184
|
+
print(" list - List available and enabled MCP services")
|
|
151
185
|
print("\nFor help with a specific command:")
|
|
152
186
|
print(" claude-mpm mcp <command> --help")
|
|
153
187
|
print("\nExamples:")
|
|
@@ -159,3 +193,8 @@ class MCPCommandRouter:
|
|
|
159
193
|
print(" claude-mpm mcp tools")
|
|
160
194
|
print(" claude-mpm mcp register my-tool")
|
|
161
195
|
print(" claude-mpm mcp test my-tool")
|
|
196
|
+
print("\nService management examples:")
|
|
197
|
+
print(" claude-mpm mcp list --available # List all available services")
|
|
198
|
+
print(" claude-mpm mcp enable kuzu-memory # Enable a service")
|
|
199
|
+
print(" claude-mpm mcp enable mcp-github --interactive # Enable with prompts")
|
|
200
|
+
print(" claude-mpm mcp disable mcp-github # Disable a service")
|