CKB + JetBrains IDEs: IntelliJ, PyCharm, WebStorm, and More
By CKB Team
JetBrains IDEs—IntelliJ IDEA, PyCharm, WebStorm, GoLand, and others—are known for deep language understanding. Adding CKB extends that intelligence to your AI assistant, giving it semantic knowledge of your codebase.
This guide covers setting up CKB with JetBrains IDEs.
What You'll Get
With CKB connected, your JetBrains AI assistant can:
- Find callers and callees across your project
- Analyze impact before refactoring
- Understand code ownership from git history
- Navigate architecturally, not just syntactically
Prerequisites
- Any JetBrains IDE (2024.1 or later recommended)
- AI Assistant plugin or MCP-compatible plugin
- Node.js 18+
Current Integration Options
Option 1: JetBrains AI Assistant with MCP (Preview)
JetBrains AI Assistant is adding MCP support. Check your IDE's AI Assistant settings for MCP configuration.
Configuration location:
Settings → Tools → AI Assistant → MCP Servers
Add CKB:
{
"ckb": {
"command": "npx",
"args": ["@tastehub/ckb", "mcp"]
}
}
Option 2: Third-Party MCP Plugins
Several community plugins bring MCP to JetBrains:
- Search JetBrains Marketplace for "MCP"
- Install an MCP-compatible plugin
- Configure CKB in the plugin's settings
Option 3: Terminal + External AI
Use CKB with an external AI assistant while coding in JetBrains:
- Open JetBrains integrated terminal
- Run
ckb watchto keep the index fresh - Use Claude Code, Cursor, or another MCP-compatible tool alongside
Setup Steps
Step 1: Install CKB
npm install -g @tastehub/ckb
Step 2: Index Your Project
cd /path/to/your/project
ckb init
Step 3: Configure Your IDE
The exact location depends on your IDE and AI plugin. Common paths:
IntelliJ IDEA:
~/Library/Application Support/JetBrains/IntelliJIdea2024.1/options/ai.xml
PyCharm:
~/Library/Application Support/JetBrains/PyCharm2024.1/options/ai.xml
WebStorm:
~/Library/Application Support/JetBrains/WebStorm2024.1/options/ai.xml
Step 4: Restart IDE
After configuration changes, restart your IDE.
Using CKB in JetBrains
AI Chat Panel
Open the AI Assistant panel and ask questions:
You: "What calls the UserRepository.findById method?"
AI: [uses CKB's getCallGraph]
"findById is called by:
- UserService.getUser at src/services/UserService.java:45
- AuthService.validateUser at src/services/AuthService.java:78
- AdminController.getUserDetails at src/controllers/AdminController.java:123
It queries the users table and returns Optional<User>."
Inline Assistance
Select code and invoke AI:
You: [select a class, invoke AI]
"What's the impact of renaming this class?"
AI: [uses prepareChange]
"Renaming UserDTO affects:
- 14 files that import it
- 3 API endpoints that serialize it
- 8 test files
Risk: Medium
Consider: This is a public API type. Ensure backwards compatibility."
Refactoring Support
Combine JetBrains' refactoring tools with CKB analysis:
You: "I want to extract an interface from PaymentProcessor"
AI: [uses analyzeCoupling]
"PaymentProcessor analysis:
Methods suitable for interface:
- process(Payment) - called by 5 consumers
- validate(Payment) - called by 3 consumers
- refund(Payment) - called by 2 consumers
Methods to keep internal:
- logTransaction() - internal only
- notifyWebhook() - side effect, not core behavior
Suggested interface: PaymentHandler with process, validate, refund"
Complementing JetBrains Intelligence
JetBrains IDEs already have powerful code intelligence. CKB adds:
What JetBrains Has
- Syntax awareness
- Local refactoring
- Type hierarchies
- Go to definition/usages
What CKB Adds
- Git-based ownership - Who knows this code best
- Change impact across boundaries - Effects beyond current module
- Dead code detection - Unused code that IDE might miss
- Hotspot analysis - Frequently changed areas
- Cross-repository queries - Multi-repo awareness
Best of Both
You: "Find all implementations of PaymentGateway and their usage patterns"
AI: [uses JetBrains' type hierarchy + CKB's usage analysis]
"PaymentGateway implementations:
1. StripeGateway (src/gateways/StripeGateway.java)
- 89% of production traffic
- 12 direct usages
- Owner: @payments-team
2. PayPalGateway (src/gateways/PayPalGateway.java)
- 10% of production traffic
- 8 direct usages
- Owner: @payments-team
3. MockGateway (src/test/MockGateway.java)
- Test only
- 34 test usages
Coupling note: Both production gateways have similar error handling
that could be extracted to base class."
Project-Specific Configuration
Create .idea/ckb.json for project settings:
{
"preset": "review",
"exclude": [
"build/**",
"target/**",
"*.generated.java"
]
}
Workflow Examples
Code Review in IntelliJ
You: "Review the changes in this branch for potential issues"
AI: [uses getDiff and prepareChange]
"Branch review - feature/add-caching:
Changes: 8 files, +245 -34 lines
Concerns:
1. CacheService added but no TTL configuration
2. UserRepository.findById now cached but invalidation missing
3. New dependency on Redis not in README
Positive:
- Good test coverage (3 new test files)
- Follows existing patterns
- Low coupling to existing code
Suggested reviewers: @alice (cache expertise), @bob (user service owner)"
Architecture Understanding
You: "Explain the module structure of this project"
AI: [uses getArchitecture]
"This is a Spring Boot application:
src/main/java/com/example/
├── controller/ - REST endpoints (8 controllers)
├── service/ - Business logic (12 services)
├── repository/ - Data access (6 repositories)
├── model/ - Entities and DTOs (15 classes)
├── config/ - Spring configuration (4 classes)
Dependency flow: controller → service → repository
Cross-cutting: config, model used throughout
Module responsibilities are well-separated.
Potential issue: service/ is getting large, consider splitting by domain."
Troubleshooting
AI not using CKB tools
- Verify MCP support is enabled in your AI plugin
- Check configuration file syntax
- Restart the IDE completely
- Look for errors in IDE logs (Help → Show Log in Finder/Explorer)
Index issues
# Rebuild index
ckb index --force
# Check status
ckb status
Performance with large projects
JetBrains projects can be large. Optimize CKB:
// .ckb/config.json
{
"exclude": [
"build/**",
"target/**",
"node_modules/**",
"*.class",
"*.jar"
],
"languages": ["java", "kotlin"] // Limit to relevant languages
}
Next Steps
- What is MCP? - Understanding the protocol
- All Features - Complete CKB feature list
- Prompt Cookbook - Useful prompts
Links: