-
-
Notifications
You must be signed in to change notification settings - Fork 4
fix: lazy engine loading for fast MCP startup #123
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: develop
Are you sure you want to change the base?
Conversation
MCP server was taking 43+ seconds to respond to initialize handshake because it loaded the entire SCIP index synchronously before starting. Changes: - Add NewMCPServerLazy() that accepts an engine loader function - Engine is now loaded on first tool call, not during startup - MCP handshake completes in ~0.6s instead of 43s - Temporarily disable multi-repo mode to use lazy path everywhere Also improves `ckb setup` for Claude Code: - Detect if CKB is already configured correctly (no action needed) - Warn when configured path differs from current binary - Show note when switching between npx and local binary - Automatically update config instead of failing with "already exists" Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
🟡 Change Impact Analysis
Blast Radius: 0 modules, 1 files, 74 unique callers 📝 Changed Symbols (106)
🎯 Affected Downstream (20)
Recommendations
Generated by CKB |
🔐 Security Audit Results
📦 Dependency VulnerabilitiesFound 7 vulnerability(ies) across 2 scanner(s) DetailsTrivy (4 findings)
OSV-Scanner (3 findings)
📜 License IssuesFound 119 non-permissive license(s) Details
Generated by CKB Security Audit | View Details | Security Tab |
Codecov Report❌ Patch coverage is
❌ Your patch check has failed because the patch coverage (0.0%) is below the target coverage (30.0%). You can increase the patch coverage or adjust the target coverage. Additional details and impacted files@@ Coverage Diff @@
## develop #123 +/- ##
=========================================
- Coverage 45.1% 45.0% -0.1%
=========================================
Files 350 350
Lines 59747 59818 +71
=========================================
+ Hits 26957 26961 +4
- Misses 30963 31031 +68
+ Partials 1827 1826 -1
Flags with carried forward coverage won't be shown. Click here to find out more. 📢 Thoughts on this report? Let us know! 🚀 New features to boost your workflow:
|
CKB Analysis
Risk factors: Touches 3 hotspot(s)
🎯 Change Impact Analysis · 🟡 MEDIUM · 106 changed → 20 affected
Symbols changed in this PR:
Downstream symbols affected:
Recommendations:
🔥 Hotspots · 3 volatile files
📊 Complexity · 3 violations
💡 Quick wins · 10 suggestions
📚 Stale docs · 143 broken references
Generated by CKB · Run details |
Summary
ckb setupUX for Claude Code configurationProblem
The MCP server was loading the entire SCIP index synchronously before responding to the initialize handshake. For large codebases (e.g., 48MB index), this took 43+ seconds, causing Claude Code's health check to timeout and report "Failed to connect".
Changes
Lazy Engine Loading (
internal/mcp/server.go)NewMCPServerLazy()that accepts an engine loader functionMCP Command (
cmd/ckb/mcp.go)Setup Command (
cmd/ckb/setup.go)Test plan
ckb setup --tool claude-code --globalworks when not configuredckb setup --tool claude-code --globalshows "already configured" when same pathckb setup --tool claude-code --globalwarns and updates when path differsclaude mcp listshows CKB as connected (was failing before)🤖 Generated with Claude Code