claude-mpm 4.3.11__py3-none-any.whl → 4.3.12__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/VERSION +1 -1
- claude_mpm/agents/templates/research.json +20 -8
- claude_mpm/agents/templates/web_qa.json +25 -10
- claude_mpm/cli/__init__.py +1 -0
- claude_mpm/cli/commands/mcp_command_router.py +11 -0
- claude_mpm/cli/commands/mcp_config.py +157 -0
- claude_mpm/cli/commands/mcp_external_commands.py +241 -0
- claude_mpm/cli/commands/mcp_install_commands.py +64 -23
- claude_mpm/cli/commands/mcp_setup_external.py +829 -0
- claude_mpm/cli/commands/run.py +70 -0
- claude_mpm/cli/commands/search.py +285 -0
- claude_mpm/cli/parsers/base_parser.py +13 -0
- claude_mpm/cli/parsers/mcp_parser.py +17 -0
- claude_mpm/cli/parsers/run_parser.py +5 -0
- claude_mpm/cli/parsers/search_parser.py +239 -0
- claude_mpm/constants.py +1 -0
- claude_mpm/core/unified_agent_registry.py +7 -0
- claude_mpm/services/agents/deployment/agent_deployment.py +28 -13
- claude_mpm/services/agents/deployment/agent_discovery_service.py +16 -6
- claude_mpm/services/agents/deployment/multi_source_deployment_service.py +6 -4
- claude_mpm/services/cli/agent_cleanup_service.py +5 -0
- claude_mpm/services/mcp_config_manager.py +294 -0
- claude_mpm/services/mcp_gateway/config/configuration.py +17 -0
- claude_mpm/services/mcp_gateway/main.py +38 -0
- claude_mpm/services/mcp_gateway/tools/external_mcp_services.py +390 -0
- {claude_mpm-4.3.11.dist-info → claude_mpm-4.3.12.dist-info}/METADATA +4 -1
- {claude_mpm-4.3.11.dist-info → claude_mpm-4.3.12.dist-info}/RECORD +31 -24
- {claude_mpm-4.3.11.dist-info → claude_mpm-4.3.12.dist-info}/WHEEL +0 -0
- {claude_mpm-4.3.11.dist-info → claude_mpm-4.3.12.dist-info}/entry_points.txt +0 -0
- {claude_mpm-4.3.11.dist-info → claude_mpm-4.3.12.dist-info}/licenses/LICENSE +0 -0
- {claude_mpm-4.3.11.dist-info → claude_mpm-4.3.12.dist-info}/top_level.txt +0 -0
claude_mpm/VERSION
CHANGED
@@ -1 +1 @@
|
|
1
|
-
4.3.
|
1
|
+
4.3.12
|
@@ -1,9 +1,14 @@
|
|
1
1
|
{
|
2
2
|
"schema_version": "1.3.0",
|
3
3
|
"agent_id": "research-agent",
|
4
|
-
"agent_version": "4.
|
5
|
-
"template_version": "2.
|
4
|
+
"agent_version": "4.5.0",
|
5
|
+
"template_version": "2.4.0",
|
6
6
|
"template_changelog": [
|
7
|
+
{
|
8
|
+
"version": "4.5.0",
|
9
|
+
"date": "2025-09-23",
|
10
|
+
"description": "INTEGRATED MCP-VECTOR-SEARCH: Added mcp-vector-search as the primary tool for semantic code search, enabling efficient pattern discovery and code analysis without memory accumulation. Prioritized vector search over traditional grep/glob for better accuracy and performance."
|
11
|
+
},
|
7
12
|
{
|
8
13
|
"version": "4.4.0",
|
9
14
|
"date": "2025-08-25",
|
@@ -67,9 +72,11 @@
|
|
67
72
|
},
|
68
73
|
"knowledge": {
|
69
74
|
"domain_expertise": [
|
75
|
+
"Semantic code search with mcp-vector-search for efficient pattern discovery",
|
70
76
|
"Memory-efficient search strategies with immediate summarization",
|
71
77
|
"Strategic file sampling for pattern verification",
|
72
|
-
"
|
78
|
+
"Vector-based similarity search for finding related code patterns",
|
79
|
+
"Context-aware search for understanding code functionality",
|
73
80
|
"Sequential processing to prevent memory accumulation",
|
74
81
|
"85% minimum confidence through intelligent verification",
|
75
82
|
"Pattern extraction and immediate discard methodology",
|
@@ -80,18 +87,23 @@
|
|
80
87
|
],
|
81
88
|
"best_practices": [
|
82
89
|
"CRITICAL: Claude Code permanently retains ALL file contents - no memory release possible",
|
90
|
+
"TOP PRIORITY: Use mcp__mcp-vector-search__search_code for semantic pattern discovery",
|
83
91
|
"FIRST PRIORITY: Use mcp__claude-mpm-gateway__document_summarizer for ALL files >20KB",
|
84
|
-
"SECOND PRIORITY: Use
|
85
|
-
"
|
92
|
+
"SECOND PRIORITY: Use mcp__mcp-vector-search__search_similar to find related code patterns",
|
93
|
+
"THIRD PRIORITY: Use mcp__mcp-vector-search__search_context for understanding functionality",
|
94
|
+
"LAST RESORT: Read tool ONLY for files <20KB when other tools unavailable",
|
95
|
+
"Always index project first with mcp__mcp-vector-search__index_project if not indexed",
|
96
|
+
"Use mcp__mcp-vector-search__get_project_status to check indexing status",
|
86
97
|
"Extract key patterns from 3-5 representative files ABSOLUTE MAXIMUM",
|
87
98
|
"NEVER exceed 5 files even if task requests 'thorough' or 'complete' analysis",
|
88
|
-
"
|
99
|
+
"Leverage vector search for finding similar implementations and patterns",
|
100
|
+
"Use grep with line numbers (-n) only when vector search unavailable",
|
89
101
|
"MANDATORY: Leverage MCP summarizer tool for files exceeding 20KB thresholds",
|
90
102
|
"Trigger summarization at 20KB or 200 lines for single files",
|
91
103
|
"Apply batch summarization after 3 files or 50KB cumulative content",
|
92
104
|
"Use file type-specific thresholds for optimal processing",
|
93
105
|
"Process files sequentially to prevent memory accumulation",
|
94
|
-
"Check file sizes BEFORE reading - NEVER read files >1MB, use
|
106
|
+
"Check file sizes BEFORE reading - NEVER read files >1MB, use vector search instead",
|
95
107
|
"Reset cumulative counters after batch summarization",
|
96
108
|
"Extract and summarize patterns immediately (behavioral guidance only - memory persists)"
|
97
109
|
],
|
@@ -113,7 +125,7 @@
|
|
113
125
|
"PREFER mcp__claude-mpm-gateway__document_summarizer over Read tool in ALL cases >20KB"
|
114
126
|
]
|
115
127
|
},
|
116
|
-
"instructions": "You are an expert research analyst with deep expertise in codebase investigation, architectural analysis, and system understanding. Your approach combines systematic methodology with efficient resource management to deliver comprehensive insights while maintaining strict memory discipline.\n\n**Core Responsibilities:**\n\nYou will investigate and analyze systems with focus on:\n- Comprehensive codebase exploration and pattern identification\n- Architectural analysis and system boundary mapping\n- Technology stack assessment and dependency analysis\n- Security posture evaluation and vulnerability identification\n- Performance characteristics and bottleneck analysis\n- Code quality metrics and technical debt assessment\n\n**Research Methodology:**\n\nWhen conducting analysis, you will:\n\n1. **Plan Investigation Strategy**: Systematically approach research by:\n - Defining clear research objectives and scope boundaries\n - Prioritizing critical components and high-impact areas\n - Selecting appropriate tools and techniques for discovery\n - Establishing memory-efficient sampling strategies\n\n2. **Execute Strategic Discovery**: Conduct analysis using:\n - Pattern-based search techniques to identify key components\n - Architectural mapping through dependency analysis\n - Representative sampling of critical system components\n - Progressive refinement of understanding through iterations\n\n3. **Analyze Findings**: Process discovered information by:\n - Extracting meaningful patterns from code structures\n - Identifying architectural decisions and design principles\n - Documenting system boundaries and interaction patterns\n - Assessing technical debt and improvement opportunities\n\n4. **Synthesize Insights**: Create comprehensive understanding through:\n - Connecting disparate findings into coherent system view\n - Identifying risks, opportunities, and recommendations\n - Documenting key insights and architectural decisions\n - Providing actionable recommendations for improvement\n\n**Memory Management Excellence:**\n\nYou will maintain strict memory discipline through:\n- Strategic sampling of representative components (maximum 3-5 files per session)\n- Preference for
|
128
|
+
"instructions": "You are an expert research analyst with deep expertise in codebase investigation, architectural analysis, and system understanding. Your approach combines systematic methodology with efficient resource management to deliver comprehensive insights while maintaining strict memory discipline.\n\n**Core Responsibilities:**\n\nYou will investigate and analyze systems with focus on:\n- Comprehensive codebase exploration and pattern identification\n- Architectural analysis and system boundary mapping\n- Technology stack assessment and dependency analysis\n- Security posture evaluation and vulnerability identification\n- Performance characteristics and bottleneck analysis\n- Code quality metrics and technical debt assessment\n\n**Research Methodology:**\n\nWhen conducting analysis, you will:\n\n1. **Plan Investigation Strategy**: Systematically approach research by:\n - Checking project indexing status with mcp__mcp-vector-search__get_project_status\n - Running mcp__mcp-vector-search__index_project if needed for initial indexing\n - Defining clear research objectives and scope boundaries\n - Prioritizing critical components and high-impact areas\n - Selecting appropriate tools and techniques for discovery\n - Establishing memory-efficient sampling strategies\n\n2. **Execute Strategic Discovery**: Conduct analysis using:\n - Semantic search with mcp__mcp-vector-search__search_code for pattern discovery\n - Similarity analysis with mcp__mcp-vector-search__search_similar for related code\n - Context search with mcp__mcp-vector-search__search_context for functionality understanding\n - Pattern-based search techniques to identify key components\n - Architectural mapping through dependency analysis\n - Representative sampling of critical system components\n - Progressive refinement of understanding through iterations\n\n3. **Analyze Findings**: Process discovered information by:\n - Extracting meaningful patterns from code structures\n - Identifying architectural decisions and design principles\n - Documenting system boundaries and interaction patterns\n - Assessing technical debt and improvement opportunities\n\n4. **Synthesize Insights**: Create comprehensive understanding through:\n - Connecting disparate findings into coherent system view\n - Identifying risks, opportunities, and recommendations\n - Documenting key insights and architectural decisions\n - Providing actionable recommendations for improvement\n\n**Memory Management Excellence:**\n\nYou will maintain strict memory discipline through:\n- Prioritizing mcp-vector-search tools to avoid loading files into memory\n- Strategic sampling of representative components (maximum 3-5 files per session)\n- Preference for semantic search over traditional file reading\n- Mandatory use of document summarization for files exceeding 20KB\n- Sequential processing to prevent memory accumulation\n- Immediate extraction and summarization of key insights\n\n**Research Focus Areas:**\n\n**Architectural Analysis:**\n- System design patterns and architectural decisions\n- Service boundaries and interaction mechanisms\n- Data flow patterns and processing pipelines\n- Integration points and external dependencies\n\n**Code Quality Assessment:**\n- Design pattern usage and code organization\n- Technical debt identification and quantification\n- Security vulnerability assessment\n- Performance bottleneck identification\n\n**Technology Evaluation:**\n- Framework and library usage patterns\n- Configuration management approaches\n- Development and deployment practices\n- Tooling and automation strategies\n\n**Communication Style:**\n\nWhen presenting research findings, you will:\n- Provide clear, structured analysis with supporting evidence\n- Highlight key insights and their implications\n- Recommend specific actions based on discovered patterns\n- Document assumptions and limitations of the analysis\n- Present findings in actionable, prioritized format\n\n**Research Standards:**\n\nYou will maintain high standards through:\n- Systematic approach to investigation and analysis\n- Evidence-based conclusions with clear supporting data\n- Comprehensive documentation of methodology and findings\n- Regular validation of assumptions against discovered evidence\n- Clear separation of facts, inferences, and recommendations\n\nYour goal is to provide comprehensive, accurate, and actionable insights that enable informed decision-making about system architecture, code quality, and technical strategy while maintaining exceptional memory efficiency throughout the research process.",
|
117
129
|
"memory_routing": {
|
118
130
|
"description": "Stores analysis findings, domain knowledge, and architectural decisions",
|
119
131
|
"categories": [
|
@@ -1,11 +1,11 @@
|
|
1
1
|
{
|
2
2
|
"schema_version": "1.2.0",
|
3
3
|
"agent_id": "web-qa-agent",
|
4
|
-
"agent_version": "1.
|
4
|
+
"agent_version": "1.9.0",
|
5
5
|
"agent_type": "qa",
|
6
6
|
"metadata": {
|
7
7
|
"name": "Web QA Agent",
|
8
|
-
"description": "Progressive
|
8
|
+
"description": "Progressive 6-phase web testing with MCP browser integration, API validation, browser automation, and Safari testing",
|
9
9
|
"category": "quality",
|
10
10
|
"tags": [
|
11
11
|
"web_qa",
|
@@ -47,7 +47,11 @@
|
|
47
47
|
"client-side errors",
|
48
48
|
"JavaScript errors",
|
49
49
|
"console monitoring",
|
50
|
-
"browser logs"
|
50
|
+
"browser logs",
|
51
|
+
"mcp-browser",
|
52
|
+
"browser-extension",
|
53
|
+
"dom-inspection",
|
54
|
+
"network-interception"
|
51
55
|
],
|
52
56
|
"paths": [
|
53
57
|
"/components/",
|
@@ -66,7 +70,7 @@
|
|
66
70
|
],
|
67
71
|
"priority": 100,
|
68
72
|
"confidence_threshold": 0.7,
|
69
|
-
"description": "Use for
|
73
|
+
"description": "Use for 6-phase progressive web testing: MCP Browser Setup → API → Routes (fetch/curl) → Links2 → Safari (AppleScript) → Playwright automation with browser console monitoring"
|
70
74
|
},
|
71
75
|
"capabilities": {
|
72
76
|
"model": "sonnet",
|
@@ -98,10 +102,14 @@
|
|
98
102
|
]
|
99
103
|
}
|
100
104
|
},
|
101
|
-
"instructions": "# Web QA Agent\n\n**Inherits from**: BASE_QA_AGENT.md\n**Focus**: Progressive
|
105
|
+
"instructions": "# Web QA Agent\n\n**Inherits from**: BASE_QA_AGENT.md\n**Focus**: Progressive 6-phase web testing with MCP browser integration, granular tool escalation and browser console monitoring\n\n## Core Expertise\n\nGranular progressive testing approach: MCP Browser Setup → API → Routes (fetch/curl) → Text Browser (links2) → Safari (AppleScript on macOS) → Full Browser (Playwright) for optimal efficiency and feedback, with comprehensive browser console monitoring throughout. Enhanced capabilities available when MCP Browser Extension is installed.\n\n## Browser Console Monitoring Authority\n\nAs the Web QA agent, you have complete authority over browser console monitoring for comprehensive client-side testing:\n\n### Console Log Location\n- Browser console logs are stored in: `.claude-mpm/logs/client/`\n- Log files named: `browser-{browser_id}_{timestamp}.log`\n- Each browser session creates a new log file\n- You have full read access to monitor these logs in real-time\n\n### Monitoring Workflow\n1. **Request Script Injection**: Ask the PM to inject browser monitoring script into the target web application\n2. **Monitor Console Output**: Track `.claude-mpm/logs/client/` for real-time console events\n3. **Analyze Client Errors**: Review JavaScript errors, warnings, and debug messages\n4. **Correlate with UI Issues**: Match console errors with UI test failures\n5. **Report Findings**: Include console analysis in test reports\n\n### Usage Commands\n- View active browser logs: `ls -la .claude-mpm/logs/client/`\n- Monitor latest log: `tail -f .claude-mpm/logs/client/browser-*.log`\n- Search for errors: `grep ERROR .claude-mpm/logs/client/*.log`\n- Count warnings: `grep -c WARN .claude-mpm/logs/client/*.log`\n- View specific browser session: `cat .claude-mpm/logs/client/browser-{id}_*.log`\n\n### Testing Integration\nWhen performing web UI testing:\n1. Request browser monitoring activation: \"PM, please inject browser console monitoring\"\n2. Note the browser ID from the visual indicator\n3. Execute test scenarios\n4. Review corresponding log file for client-side issues\n5. Include console findings in test results\n\n### MCP Browser Integration\nWhen MCP Browser Extension is available:\n- Enhanced console monitoring with structured data format\n- Real-time DOM state synchronization\n- Network request/response capture with full headers and body\n- JavaScript context execution for advanced testing\n- Automated performance profiling\n- Direct browser control via MCP protocol\n\n### Error Categories to Monitor\n- **JavaScript Exceptions**: Runtime errors, syntax errors, type errors\n- **Network Failures**: Fetch/XHR errors, failed API calls, timeout errors\n- **Resource Loading**: 404s, CORS violations, mixed content warnings\n- **Performance Issues**: Long task warnings, memory leaks, render blocking\n- **Security Warnings**: CSP violations, insecure requests, XSS attempts\n- **Deprecation Notices**: Browser API deprecations, outdated practices\n- **Framework Errors**: React, Vue, Angular specific errors and warnings\n\n## 6-Phase Progressive Testing Protocol\n\n### Phase 0: MCP Browser Extension Setup (1-2 min)\n**Focus**: Verify browser extension availability for enhanced testing\n**Tools**: MCP status check, browser extension verification\n\n- Check if mcp-browser is installed: `npx mcp-browser status`\n- Verify browser extension availability: `npx mcp-browser check-extension`\n- If extension available, prefer browsers with extension installed\n- If not available, notify PM to prompt user: \"Please install the MCP Browser Extension for enhanced testing capabilities\"\n- Copy extension for manual installation if needed: `npx mcp-browser copy-extension ./browser-extension`\n\n**Benefits with Extension**:\n- Direct browser control via MCP protocol\n- Real-time DOM inspection and manipulation\n- Enhanced console monitoring with structured data\n- Network request interception and modification\n- JavaScript execution in browser context\n- Automated screenshot and video capture\n\n**Progression Rule**: Always attempt Phase 0 first. If extension available, integrate with subsequent phases for enhanced capabilities.\n\n### Phase 1: API Testing (2-3 min)\n**Focus**: Direct API endpoint validation before any UI testing\n**Tools**: Direct API calls, curl, REST clients\n\n- Test REST/GraphQL endpoints, data validation, authentication\n- Verify WebSocket communication and message handling \n- Validate token flows, CORS, and security headers\n- Test failure scenarios and error responses\n- Verify API response schemas and data integrity\n\n**Progression Rule**: Only proceed to Phase 2 if APIs are functional or if testing server-rendered content. Use MCP browser capabilities if available.\n\n### Phase 2: Routes Testing (3-5 min)\n**Focus**: Server responses, routing, and basic page delivery\n**Tools**: fetch API, curl for HTTP testing\n**Console Monitoring**: Request injection if JavaScript errors suspected. Use MCP browser for enhanced monitoring if available\n\n- Test all application routes and status codes\n- Verify proper HTTP headers and response codes\n- Test redirects, canonical URLs, and routing\n- Basic HTML delivery and server-side rendering\n- Validate HTTPS, CSP, and security configurations\n- Monitor for early JavaScript loading errors\n\n**Progression Rule**: Proceed to Phase 3 for HTML structure validation, Phase 4 for Safari testing on macOS, or Phase 5 if JavaScript testing needed.\n\n### Phase 3: Links2 Testing (5-8 min)\n**Focus**: HTML structure and text-based accessibility validation\n**Tool**: Use `links2` command via Bash for lightweight browser testing\n\n- Check semantic markup and document structure\n- Verify all links are accessible and return proper status codes\n- Test basic form submission without JavaScript\n- Validate text content, headings, and navigation\n- Check heading hierarchy, alt text presence\n- Test pages that work without JavaScript\n\n**Progression Rule**: Proceed to Phase 4 for Safari testing on macOS, or Phase 5 if full cross-browser testing needed.\n\n### Phase 4: Safari Testing (8-12 min) [macOS Only]\n**Focus**: Native macOS browser testing with console monitoring\n**Tool**: Safari + AppleScript + Browser Console Monitoring\n**Console Monitoring**: ALWAYS active during Safari testing. Enhanced with MCP browser if available\n\n- Test in native Safari environment with console monitoring\n- Monitor WebKit-specific JavaScript errors and warnings\n- Track console output during AppleScript automation\n- Identify WebKit rendering and JavaScript differences\n- Test system-level integrations (notifications, keychain, etc.)\n- Capture Safari-specific console errors and performance issues\n- Test Safari's enhanced privacy and security features\n\n**Progression Rule**: Proceed to Phase 5 for comprehensive cross-browser testing, or stop if Safari testing meets requirements.\n\n### Phase 5: Playwright Testing (15-30 min)\n**Focus**: Full browser automation with comprehensive console monitoring\n**Tool**: Playwright/Puppeteer + Browser Console Monitoring\n**Console Monitoring**: MANDATORY for all Playwright sessions. Use MCP browser for advanced DOM and network inspection if available\n\n- Dynamic content testing with console error tracking\n- Monitor JavaScript errors during SPA interactions\n- Track performance warnings and memory issues\n- Capture console output during complex user flows\n- Screenshots correlated with console errors\n- Visual regression with error state detection\n- Core Web Vitals with performance console warnings\n- Multi-browser console output comparison\n- Authentication flow error monitoring\n\n## Console Monitoring Reports\n\nInclude in all test reports:\n1. **Console Error Summary**: Total errors, warnings, and info messages\n2. **Critical Errors**: JavaScript exceptions that break functionality\n3. **Performance Issues**: Warnings about slow operations or memory\n4. **Network Failures**: Failed API calls or resource loading\n5. **Security Warnings**: CSP violations or insecure content\n6. **Error Trends**: Patterns across different test scenarios\n7. **Browser Differences**: Console variations between browsers\n\n## Quality Standards\n\n- **Console Monitoring**: Always monitor browser console during UI testing\n- **Error Correlation**: Link console errors to specific test failures\n- **Granular Progression**: Test lightest tools first, escalate only when needed\n- **Fail Fast**: Stop progression if fundamental issues found in early phases\n- **Tool Efficiency**: Use appropriate tool for each testing concern\n- **Resource Management**: Minimize heavy browser usage through smart progression\n- **Comprehensive Coverage**: Ensure all layers tested appropriately\n- **Clear Documentation**: Document console findings alongside test results",
|
102
106
|
"knowledge": {
|
103
107
|
"domain_expertise": [
|
104
|
-
"
|
108
|
+
"MCP Browser Extension setup and verification",
|
109
|
+
"Enhanced browser control via MCP protocol",
|
110
|
+
"DOM inspection and manipulation through extension",
|
111
|
+
"Network request interception with MCP browser",
|
112
|
+
"6-phase progressive web testing (MCP Setup → API → Routes → Links2 → Safari → Playwright)",
|
105
113
|
"Browser console monitoring and client-side error analysis",
|
106
114
|
"JavaScript error detection and debugging",
|
107
115
|
"Real-time console log monitoring in .claude-mpm/logs/client/",
|
@@ -121,7 +129,11 @@
|
|
121
129
|
"macOS system integration testing"
|
122
130
|
],
|
123
131
|
"best_practices": [
|
124
|
-
"
|
132
|
+
"Always check for MCP Browser Extension availability first",
|
133
|
+
"Prefer testing with browsers that have the extension installed",
|
134
|
+
"Use MCP browser for enhanced DOM and network inspection when available",
|
135
|
+
"Notify PM if extension not available to prompt user installation",
|
136
|
+
"6-phase granular progression: MCP Setup → API → Routes → Links2 → Safari → Playwright",
|
125
137
|
"API-first testing for backend validation",
|
126
138
|
"Routes testing with fetch/curl for server responses",
|
127
139
|
"Text browser validation before browser automation",
|
@@ -141,7 +153,8 @@
|
|
141
153
|
"Resource-efficient smart escalation"
|
142
154
|
],
|
143
155
|
"constraints": [
|
144
|
-
"
|
156
|
+
"6-phase testing workflow dependencies",
|
157
|
+
"MCP Browser Extension availability for enhanced features",
|
145
158
|
"API availability for Phase 1 testing",
|
146
159
|
"Routes accessibility for Phase 2 validation",
|
147
160
|
"Text browser limitations for JavaScript",
|
@@ -257,12 +270,14 @@
|
|
257
270
|
"chromium",
|
258
271
|
"firefox",
|
259
272
|
"safari",
|
260
|
-
"osascript"
|
273
|
+
"osascript",
|
274
|
+
"mcp-browser"
|
261
275
|
],
|
262
276
|
"npm": [
|
263
277
|
"@playwright/test",
|
264
278
|
"lighthouse",
|
265
|
-
"@axe-core/puppeteer"
|
279
|
+
"@axe-core/puppeteer",
|
280
|
+
"mcp-browser"
|
266
281
|
],
|
267
282
|
"optional": false
|
268
283
|
},
|
claude_mpm/cli/__init__.py
CHANGED
@@ -397,6 +397,7 @@ def _ensure_run_attributes(args):
|
|
397
397
|
# Also include monitor and force attributes
|
398
398
|
args.monitor = getattr(args, "monitor", False)
|
399
399
|
args.force = getattr(args, "force", False)
|
400
|
+
args.reload_agents = getattr(args, "reload_agents", False)
|
400
401
|
# Include dependency checking attributes
|
401
402
|
args.check_dependencies = getattr(args, "check_dependencies", True)
|
402
403
|
args.force_check_dependencies = getattr(args, "force_check_dependencies", False)
|
@@ -45,6 +45,9 @@ class MCPCommandRouter:
|
|
45
45
|
if args.mcp_command == MCPCommands.SERVER.value:
|
46
46
|
return self._run_server(args)
|
47
47
|
|
48
|
+
if args.mcp_command == MCPCommands.EXTERNAL.value:
|
49
|
+
return self._manage_external(args)
|
50
|
+
|
48
51
|
if args.mcp_command == "cleanup":
|
49
52
|
return self._cleanup_locks(args)
|
50
53
|
|
@@ -124,6 +127,13 @@ class MCPCommandRouter:
|
|
124
127
|
handler = MCPServerCommands(self.logger)
|
125
128
|
return asyncio.run(handler.start_server(args))
|
126
129
|
|
130
|
+
def _manage_external(self, args) -> int:
|
131
|
+
"""Manage external MCP services command handler."""
|
132
|
+
from .mcp_external_commands import MCPExternalCommands
|
133
|
+
|
134
|
+
handler = MCPExternalCommands(self.logger)
|
135
|
+
return handler.manage_external(args)
|
136
|
+
|
127
137
|
def _show_help(self):
|
128
138
|
"""Show available MCP commands."""
|
129
139
|
print("\nAvailable MCP commands:")
|
@@ -136,6 +146,7 @@ class MCPCommandRouter:
|
|
136
146
|
print(" register - Register a new tool")
|
137
147
|
print(" test - Test tool invocation")
|
138
148
|
print(" config - View and manage configuration")
|
149
|
+
print(" external - Manage external MCP services")
|
139
150
|
print(" cleanup - Clean up legacy files")
|
140
151
|
print("\nFor help with a specific command:")
|
141
152
|
print(" claude-mpm mcp <command> --help")
|
@@ -0,0 +1,157 @@
|
|
1
|
+
"""
|
2
|
+
MCP Configuration Command
|
3
|
+
=========================
|
4
|
+
|
5
|
+
Command for managing MCP service configurations with pipx preference.
|
6
|
+
"""
|
7
|
+
|
8
|
+
import json
|
9
|
+
import sys
|
10
|
+
from pathlib import Path
|
11
|
+
|
12
|
+
from ...services.mcp_config_manager import MCPConfigManager
|
13
|
+
from ..shared import BaseCommand, CommandResult
|
14
|
+
|
15
|
+
|
16
|
+
class MCPConfigCommand(BaseCommand):
|
17
|
+
"""Manage MCP service configurations."""
|
18
|
+
|
19
|
+
def __init__(self):
|
20
|
+
super().__init__("mcp-config")
|
21
|
+
|
22
|
+
def run(self, args) -> CommandResult:
|
23
|
+
"""Execute the MCP configuration command."""
|
24
|
+
manager = MCPConfigManager()
|
25
|
+
|
26
|
+
# Handle different sub-commands
|
27
|
+
if hasattr(args, "mcp_config_command"):
|
28
|
+
command = args.mcp_config_command
|
29
|
+
|
30
|
+
if command == "detect":
|
31
|
+
return self._detect_services(manager)
|
32
|
+
elif command == "update":
|
33
|
+
return self._update_config(manager, args)
|
34
|
+
elif command == "validate":
|
35
|
+
return self._validate_config(manager)
|
36
|
+
elif command == "install":
|
37
|
+
return self._install_services(manager)
|
38
|
+
else:
|
39
|
+
return self._show_status(manager)
|
40
|
+
else:
|
41
|
+
return self._show_status(manager)
|
42
|
+
|
43
|
+
def _detect_services(self, manager: MCPConfigManager) -> CommandResult:
|
44
|
+
"""Detect available MCP services."""
|
45
|
+
results = {}
|
46
|
+
for service in manager.PIPX_SERVICES:
|
47
|
+
path = manager.detect_service_path(service)
|
48
|
+
results[service] = {
|
49
|
+
"found": path is not None,
|
50
|
+
"path": path or "Not found",
|
51
|
+
}
|
52
|
+
|
53
|
+
return CommandResult(
|
54
|
+
success=True,
|
55
|
+
message="MCP service detection complete",
|
56
|
+
data=results,
|
57
|
+
)
|
58
|
+
|
59
|
+
def _update_config(self, manager: MCPConfigManager, args) -> CommandResult:
|
60
|
+
"""Update MCP configuration."""
|
61
|
+
force_pipx = getattr(args, "force_pipx", True)
|
62
|
+
success, message = manager.update_mcp_config(force_pipx=force_pipx)
|
63
|
+
|
64
|
+
if success:
|
65
|
+
# Show the updated configuration
|
66
|
+
config_path = Path.cwd() / ".mcp.json"
|
67
|
+
if config_path.exists():
|
68
|
+
with open(config_path, "r") as f:
|
69
|
+
config = json.load(f)
|
70
|
+
return CommandResult(
|
71
|
+
success=True,
|
72
|
+
message=message,
|
73
|
+
data=config,
|
74
|
+
)
|
75
|
+
|
76
|
+
return CommandResult(
|
77
|
+
success=success,
|
78
|
+
message=message,
|
79
|
+
)
|
80
|
+
|
81
|
+
def _validate_config(self, manager: MCPConfigManager) -> CommandResult:
|
82
|
+
"""Validate current MCP configuration."""
|
83
|
+
results = manager.validate_configuration()
|
84
|
+
|
85
|
+
all_valid = all(results.values()) if results else False
|
86
|
+
message = (
|
87
|
+
"All MCP services are properly configured"
|
88
|
+
if all_valid
|
89
|
+
else "Some MCP services are not accessible"
|
90
|
+
)
|
91
|
+
|
92
|
+
return CommandResult(
|
93
|
+
success=all_valid,
|
94
|
+
message=message,
|
95
|
+
data=results,
|
96
|
+
)
|
97
|
+
|
98
|
+
def _install_services(self, manager: MCPConfigManager) -> CommandResult:
|
99
|
+
"""Install missing MCP services."""
|
100
|
+
success, message = manager.install_missing_services()
|
101
|
+
return CommandResult(
|
102
|
+
success=success,
|
103
|
+
message=message,
|
104
|
+
)
|
105
|
+
|
106
|
+
def _show_status(self, manager: MCPConfigManager) -> CommandResult:
|
107
|
+
"""Show current MCP configuration status."""
|
108
|
+
# Detect services
|
109
|
+
detected = {}
|
110
|
+
for service in manager.PIPX_SERVICES:
|
111
|
+
path = manager.detect_service_path(service)
|
112
|
+
detected[service] = {
|
113
|
+
"installed": path is not None,
|
114
|
+
"path": path or "Not installed",
|
115
|
+
"via_pipx": path and "pipx" in path if path else False,
|
116
|
+
}
|
117
|
+
|
118
|
+
# Validate configuration
|
119
|
+
config_valid = manager.validate_configuration()
|
120
|
+
|
121
|
+
# Read current config
|
122
|
+
config_path = Path.cwd() / ".mcp.json"
|
123
|
+
current_config = {}
|
124
|
+
if config_path.exists():
|
125
|
+
try:
|
126
|
+
with open(config_path, "r") as f:
|
127
|
+
current_config = json.load(f)
|
128
|
+
except Exception:
|
129
|
+
pass
|
130
|
+
|
131
|
+
status_data = {
|
132
|
+
"services": detected,
|
133
|
+
"configuration_valid": config_valid,
|
134
|
+
"config_file_exists": config_path.exists(),
|
135
|
+
"configured_services": list(current_config.get("mcpServers", {}).keys()),
|
136
|
+
}
|
137
|
+
|
138
|
+
return CommandResult(
|
139
|
+
success=True,
|
140
|
+
message="MCP configuration status",
|
141
|
+
data=status_data,
|
142
|
+
)
|
143
|
+
|
144
|
+
|
145
|
+
def manage_mcp_config(args):
|
146
|
+
"""
|
147
|
+
Entry point for MCP configuration command.
|
148
|
+
|
149
|
+
Args:
|
150
|
+
args: Parsed command line arguments
|
151
|
+
|
152
|
+
Returns:
|
153
|
+
Exit code
|
154
|
+
"""
|
155
|
+
command = MCPConfigCommand()
|
156
|
+
result = command.execute(args)
|
157
|
+
return result.exit_code
|
@@ -0,0 +1,241 @@
|
|
1
|
+
"""MCP external services command implementations.
|
2
|
+
|
3
|
+
This module provides commands for managing external MCP services
|
4
|
+
like mcp-vector-search and mcp-browser.
|
5
|
+
"""
|
6
|
+
|
7
|
+
import sys
|
8
|
+
|
9
|
+
|
10
|
+
class MCPExternalCommands:
|
11
|
+
"""Handles MCP external service commands."""
|
12
|
+
|
13
|
+
def __init__(self, logger):
|
14
|
+
"""Initialize the MCP external commands handler."""
|
15
|
+
self.logger = logger
|
16
|
+
|
17
|
+
def manage_external(self, args):
|
18
|
+
"""Manage external MCP services.
|
19
|
+
|
20
|
+
Args:
|
21
|
+
args: Parsed command line arguments
|
22
|
+
|
23
|
+
Returns:
|
24
|
+
int: Exit code (0 for success, non-zero for failure)
|
25
|
+
"""
|
26
|
+
# Get the external subcommand if it exists
|
27
|
+
external_action = getattr(args, 'external_action', None)
|
28
|
+
|
29
|
+
if not external_action:
|
30
|
+
# No subcommand provided, show help
|
31
|
+
self._show_help()
|
32
|
+
return 0
|
33
|
+
|
34
|
+
# Route to appropriate handler
|
35
|
+
if external_action == "setup":
|
36
|
+
return self._setup_external(args)
|
37
|
+
elif external_action == "list":
|
38
|
+
return self._list_external(args)
|
39
|
+
elif external_action == "check":
|
40
|
+
return self._check_external(args)
|
41
|
+
elif external_action == "fix-browser":
|
42
|
+
return self._fix_browser(args)
|
43
|
+
elif external_action == "detect":
|
44
|
+
return self._detect_and_update(args)
|
45
|
+
else:
|
46
|
+
print(f"Unknown external subcommand: {external_action}")
|
47
|
+
self._show_help()
|
48
|
+
return 1
|
49
|
+
|
50
|
+
def _setup_external(self, args):
|
51
|
+
"""Setup external MCP services in Claude Desktop.
|
52
|
+
|
53
|
+
Args:
|
54
|
+
args: Command line arguments
|
55
|
+
|
56
|
+
Returns:
|
57
|
+
int: Exit code
|
58
|
+
"""
|
59
|
+
print("📦 Setting up External MCP Services")
|
60
|
+
print("=" * 50)
|
61
|
+
|
62
|
+
from .mcp_setup_external import MCPExternalServicesSetup
|
63
|
+
|
64
|
+
setup = MCPExternalServicesSetup(self.logger)
|
65
|
+
|
66
|
+
# First install Python packages
|
67
|
+
print("\n1️⃣ Installing Python packages...")
|
68
|
+
if not setup.check_and_install_pip_packages():
|
69
|
+
print("⚠️ Some Python packages could not be installed")
|
70
|
+
print(" You may need to install them manually:")
|
71
|
+
print(" pip install mcp-vector-search mcp-browser")
|
72
|
+
|
73
|
+
# Then configure in Claude Desktop
|
74
|
+
print("\n2️⃣ Configuring Claude Desktop...")
|
75
|
+
force = getattr(args, 'force', False)
|
76
|
+
if setup.setup_external_services(force=force):
|
77
|
+
print("\n✅ External services setup completed successfully!")
|
78
|
+
print("\nNext steps:")
|
79
|
+
print("1. Restart Claude Desktop to load the new services")
|
80
|
+
print("2. Check status with: claude-mpm mcp external list")
|
81
|
+
print("3. The services will be available in Claude as separate MCP servers")
|
82
|
+
return 0
|
83
|
+
else:
|
84
|
+
print("\n❌ Failed to setup external services")
|
85
|
+
print("Please check the error messages above and try again")
|
86
|
+
return 1
|
87
|
+
|
88
|
+
def _list_external(self, args):
|
89
|
+
"""List external MCP services and their status.
|
90
|
+
|
91
|
+
Args:
|
92
|
+
args: Command line arguments
|
93
|
+
|
94
|
+
Returns:
|
95
|
+
int: Exit code
|
96
|
+
"""
|
97
|
+
from .mcp_setup_external import MCPExternalServicesSetup
|
98
|
+
|
99
|
+
setup = MCPExternalServicesSetup(self.logger)
|
100
|
+
setup.list_external_services()
|
101
|
+
return 0
|
102
|
+
|
103
|
+
def _check_external(self, args):
|
104
|
+
"""Check if external services are properly configured.
|
105
|
+
|
106
|
+
Args:
|
107
|
+
args: Command line arguments
|
108
|
+
|
109
|
+
Returns:
|
110
|
+
int: Exit code
|
111
|
+
"""
|
112
|
+
print("🔍 Checking External MCP Services Configuration")
|
113
|
+
print("=" * 50)
|
114
|
+
|
115
|
+
from pathlib import Path
|
116
|
+
import json
|
117
|
+
|
118
|
+
# Check Claude Desktop configuration
|
119
|
+
config_paths = [
|
120
|
+
Path.home() / "Library" / "Application Support" / "Claude" / "claude_desktop_config.json", # macOS
|
121
|
+
Path.home() / ".config" / "Claude" / "claude_desktop_config.json", # Linux
|
122
|
+
Path.home() / "AppData" / "Roaming" / "Claude" / "claude_desktop_config.json", # Windows
|
123
|
+
Path.home() / ".claude" / "claude_desktop_config.json", # Alternative
|
124
|
+
Path.home() / ".claude.json" # Legacy
|
125
|
+
]
|
126
|
+
|
127
|
+
config_found = False
|
128
|
+
for config_path in config_paths:
|
129
|
+
if config_path.exists():
|
130
|
+
config_found = True
|
131
|
+
print(f"\n📄 Found config: {config_path}")
|
132
|
+
|
133
|
+
try:
|
134
|
+
with open(config_path) as f:
|
135
|
+
config = json.load(f)
|
136
|
+
|
137
|
+
mcp_servers = config.get("mcpServers", {})
|
138
|
+
|
139
|
+
# Check for external services
|
140
|
+
external_services = ["mcp-vector-search", "mcp-browser"]
|
141
|
+
for service in external_services:
|
142
|
+
if service in mcp_servers:
|
143
|
+
print(f" ✅ {service} is configured")
|
144
|
+
server_config = mcp_servers[service]
|
145
|
+
print(f" Command: {server_config.get('command')}")
|
146
|
+
print(f" Args: {server_config.get('args')}")
|
147
|
+
else:
|
148
|
+
print(f" ❌ {service} is NOT configured")
|
149
|
+
|
150
|
+
except Exception as e:
|
151
|
+
print(f" ❌ Error reading config: {e}")
|
152
|
+
|
153
|
+
break
|
154
|
+
|
155
|
+
if not config_found:
|
156
|
+
print("❌ No Claude Desktop configuration found")
|
157
|
+
print(" Please run: claude-mpm mcp install")
|
158
|
+
|
159
|
+
# Check Python packages
|
160
|
+
print("\n🐍 Python Package Status:")
|
161
|
+
from .mcp_setup_external import MCPExternalServicesSetup
|
162
|
+
|
163
|
+
setup = MCPExternalServicesSetup(self.logger)
|
164
|
+
|
165
|
+
packages = [
|
166
|
+
("mcp-vector-search", "mcp_vector_search"),
|
167
|
+
("mcp-browser", "mcp_browser")
|
168
|
+
]
|
169
|
+
|
170
|
+
for package_name, module_name in packages:
|
171
|
+
if setup._check_python_package(module_name):
|
172
|
+
print(f" ✅ {package_name} is installed")
|
173
|
+
else:
|
174
|
+
print(f" ❌ {package_name} is NOT installed")
|
175
|
+
|
176
|
+
return 0
|
177
|
+
|
178
|
+
def _fix_browser(self, args):
|
179
|
+
"""Fix mcp-browser configuration to use pipx installation.
|
180
|
+
|
181
|
+
Args:
|
182
|
+
args: Command line arguments
|
183
|
+
|
184
|
+
Returns:
|
185
|
+
int: Exit code
|
186
|
+
"""
|
187
|
+
from .mcp_setup_external import MCPExternalServicesSetup
|
188
|
+
|
189
|
+
setup = MCPExternalServicesSetup(self.logger)
|
190
|
+
if setup.fix_browser_configuration():
|
191
|
+
return 0
|
192
|
+
else:
|
193
|
+
return 1
|
194
|
+
|
195
|
+
def _detect_and_update(self, args):
|
196
|
+
"""Auto-detect MCP service installations and update configuration.
|
197
|
+
|
198
|
+
Prioritizes local development installations over pipx/system.
|
199
|
+
|
200
|
+
Args:
|
201
|
+
args: Command line arguments
|
202
|
+
|
203
|
+
Returns:
|
204
|
+
int: Exit code
|
205
|
+
"""
|
206
|
+
from .mcp_setup_external import MCPExternalServicesSetup
|
207
|
+
|
208
|
+
setup = MCPExternalServicesSetup(self.logger)
|
209
|
+
force = getattr(args, 'force', False)
|
210
|
+
|
211
|
+
if setup.update_mcp_json_with_detected(force=force):
|
212
|
+
print("\n✅ Configuration updated successfully!")
|
213
|
+
print("\nNext steps:")
|
214
|
+
print("1. Review the .mcp.json file to verify the configuration")
|
215
|
+
print("2. Restart Claude Desktop to load the updated services")
|
216
|
+
return 0
|
217
|
+
else:
|
218
|
+
print("\n❌ Failed to update configuration")
|
219
|
+
return 1
|
220
|
+
|
221
|
+
def _show_help(self):
|
222
|
+
"""Show help for external commands."""
|
223
|
+
print("\nMCP External Services Management")
|
224
|
+
print("=" * 40)
|
225
|
+
print("\nAvailable commands:")
|
226
|
+
print(" setup - Setup external MCP services (mcp-vector-search, mcp-browser)")
|
227
|
+
print(" list - List available external services and their status")
|
228
|
+
print(" check - Check configuration and installation status")
|
229
|
+
print(" detect - Auto-detect installations and update .mcp.json (prioritizes local dev)")
|
230
|
+
print(" fix-browser - Fix mcp-browser configuration to use pipx installation")
|
231
|
+
print("\nUsage:")
|
232
|
+
print(" claude-mpm mcp external setup # Interactive setup")
|
233
|
+
print(" claude-mpm mcp external setup --force # Force reconfiguration")
|
234
|
+
print(" claude-mpm mcp external detect # Auto-detect and update config")
|
235
|
+
print(" claude-mpm mcp external detect --force # Force update even if configured")
|
236
|
+
print(" claude-mpm mcp external list # Show service status")
|
237
|
+
print(" claude-mpm mcp external check # Detailed configuration check")
|
238
|
+
print(" claude-mpm mcp external fix-browser # Fix mcp-browser to use pipx")
|
239
|
+
print("\nExternal services provide additional capabilities:")
|
240
|
+
print(" - mcp-vector-search: Semantic code search with embeddings")
|
241
|
+
print(" - mcp-browser: Web browsing and content extraction")
|