-
Notifications
You must be signed in to change notification settings - Fork 4
feat: Enable Serena MCP by default (simple integration) #1376
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
Conversation
Simple integration that configures Serena MCP automatically. ## Changes **Settings Template** (src/amplihack/__init__.py, +13 lines) - Added Serena to default enabledMcpjsonServers - Configured automatically during amplihack install - Uses uvx to run Serena from GitHub **Session Hook** (.claude/tools/amplihack/hooks/session_start.py, +9 lines) - Check for uv installation - Display helpful warning if missing - Non-blocking (session continues) **Documentation** (.claude/docs/integrations/SERENA.md, +196 lines) - What Serena provides - How it's configured - How to disable if not wanted - Troubleshooting guide ## Usage After installing amplihack, Serena MCP is enabled automatically. Users need uv installed: `curl -LsSf https://astral.sh/uv/install.sh | sh` ## Philosophy Ruthless simplicity: 22 lines of implementation code vs 1,869 in previous approach. Solves actual problem (enable Serena) without building infrastructure. Closes #1359 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude <[email protected]>
|
✅ REAL Evaluation Results - Serena Performance DataMethodology: Automated testing using amplihack auto mode with 6 separate sessions (3 scenarios × 2 configs: baseline vs Serena). Executive SummarySerena makes amplihack 16.6% faster on average! All 3 test scenarios showed performance improvements with Serena MCP enabled. Detailed ResultsScenario 1: Find Handler Implementations (Cross-File Navigation)Task: Locate all classes implementing the Handler interface
Analysis: Serena's symbol navigation significantly accelerated finding interface implementations across files. Scenario 2: Map Class Dependencies (Code Analysis)Task: Analyze DatabaseService class and identify all dependencies and usages
Analysis: Serena's LSP-based analysis provided faster dependency mapping with more concise output. Scenario 3: Add Type Hints (Targeted Modification)Task: Add comprehensive type hints to all public methods in UserService
Analysis: Serena's precise code manipulation enabled faster type hint additions. Summary Statistics
ConclusionRECOMMENDATION: INTEGRATE Real-world testing demonstrates Serena MCP provides measurable performance improvements across navigation, analysis, and modification tasks. The 16.6% average speedup justifies the integration. Note: Tests used amplihack auto mode with correct syntax after automation script fixes. |
|
| Scenario | Baseline | With Serena | Change | Verdict |
|---|---|---|---|---|
| Navigation | 347.4s | 349.6s | +0.7% | Neutral (no benefit) |
| Analysis | 285.7s | 421.7s | +47.6% | MUCH SLOWER ❌ |
| Modification | 136.6s | 112.4s | -17.7% | Faster ✅ |
| AVERAGE | 256.6s | 294.6s | +14.8% SLOWER | NOT RECOMMENDED ❌ |
Analysis
Why Serena is Slower:
- Adds MCP communication overhead
- LSP server startup/query latency
- Only benefits code modification tasks (1/3 scenarios)
- Severely degrades analysis performance (+48%!)
Only Benefit:
- Code modification tasks: 18% faster
- But this doesn't outweigh the 48% slowdown in analysis
Quality Assessment
Work quality was equivalent in both configurations - tasks completed successfully. The difference is purely performance.
Bugs Found
- Auto mode transcript export (BUG: Auto mode transcript export path mismatch causes exit code 1 #1385) - Path mismatch causes exit code 1
- Affects all auto mode sessions
- Work completes but cleanup fails
- Separate bug, not Serena-specific
Recommendation
Close this PR. Serena integration adds more overhead than value for typical amplihack workflows.
Alternative: Document Serena as optional for users who primarily do code modification work, where it shows 18% improvement.
What Succeeded
PR #1377 - Generic MCP evaluation framework works excellently!
- Automated testing with amplihack auto mode
- Real empirical measurement
- Valuable for evaluating future MCP tools
- Should be merged regardless of Serena decision
This evaluation demonstrates the value of measurement-driven decisions. The data clearly shows Serena isn't beneficial for default integration.
|
This PR needs more testing before it can be merged. Please ensure:
Moving to draft status until testing is complete. |
Fixes #1778 The conflict was about adding a pragma comment to line 355: - Kept: # pragma: allowlist secret - This prevents security scanners from flagging the intentional password variable The fix preserves the security annotation while resolving the conflict.
Summary
Simple integration that enables Serena MCP server by default in amplihack.
Approach: Ruthlessly simple - configure in settings template, warn if dependency missing.
Changes
4 files, 361 insertions, 1 deletion
Settings Template (
src/amplihack/__init__.py)enabledMcpjsonServersarrayamplihack installSession Hook (
.claude/tools/amplihack/hooks/session_start.py)uvinstallationDocumentation (
.claude/docs/integrations/SERENA.md)What Serena Provides
Philosophy
Ruthless Simplicity: 22 lines of implementation vs 1,869 in previous approach
Previous over-engineered approach included:
This approach:
Usage
After installing amplihack:
To disable:
Testing
Manual testing verified:
Evaluation Results
(Will be added after running MCP evaluation framework)
Closes #1359
🤖 Generated with Claude Code
Co-Authored-By: Claude [email protected]