MCP server for Cantena code intelligence
npm install cantena-mcpBring code intelligence to your AI-powered IDE. Cantena analyzes your codebase structure, understands relationships between functions and classes, and helps you understand the impact of code changes.
Works with: Cursor, Windsurf, VS Code, Continue.dev, Cline, Zed, and Claude Desktop
- 🔍 Codebase Analysis: Understand your entire codebase structure instantly
- 💥 Blast Radius: See what code is affected by changes to any function or class
- 🔎 Smart Search: Find functions, classes, and variables by name
- 🤖 AI-Native: Works seamlessly with your IDE's AI assistant - just ask questions naturally
Sign up at cantena.dev to get your API key.
Choose your IDE and follow the setup instructions:
Cursor
Add to .cursor/mcp.json (or global config at ~/Library/Application Support/Cursor/mcp.json on Mac):
``json`
{
"mcpServers": {
"cantena": {
"command": "npx",
"args": ["-y", "cantena-mcp", "--api-key", "YOUR_API_KEY"]
}
}
}
Restart Cursor and you're ready!
Windsurf
Add to ~/.codeium/windsurf/mcp_config.json:`json`
{
"mcpServers": {
"cantena": {
"command": "npx",
"args": ["-y", "cantena-mcp", "--api-key", "YOUR_API_KEY"]
}
}
}
Restart Windsurf and you're ready!
VS Code (with Continue.dev)
Add to Continue.dev config (~/.continue/config.json):`json`
{
"mcpServers": {
"cantena": {
"command": "npx",
"args": ["-y", "cantena-mcp", "--api-key", "YOUR_API_KEY"]
}
}
}
Claude Desktop
Add to config file:
- Mac: ~/Library/Application Support/Claude/claude_desktop_config.json%APPDATA%/Claude/claude_desktop_config.json
- Windows: `json`
{
"mcpServers": {
"cantena": {
"command": "npx",
"args": ["-y", "cantena-mcp", "--api-key", "YOUR_API_KEY"]
}
}
}
Restart Claude Desktop.
Cline
Add to Cline MCP config:
`json`
{
"mcpServers": {
"cantena": {
"command": "npx",
"args": ["-y", "cantena-mcp", "--api-key", "YOUR_API_KEY"]
}
}
}
Zed
Add to Zed settings:
`json`
{
"language_models": {
"mcp_servers": {
"cantena": {
"command": "npx",
"args": ["-y", "cantena-mcp", "--api-key", "YOUR_API_KEY"]
}
}
}
}
Open your IDE in any codebase and just ask questions:
- "What's the structure of this codebase?"
- "Show me all the functions and classes"
- "If I change the UserService class, what else would be affected?"
- "Find all functions related to authentication"
- "What depends on this function?"
The AI will automatically use Cantena to answer - no special commands needed!
You: What's in this codebase?
AI: [Uses Cantena automatically]
This codebase contains 127 functions, 23 classes, and 45 variables...
`$3
`
You: If I modify the authenticateUser function, what would break?
AI: [Uses Cantena blast radius tool]
Modifying authenticateUser would affect 12 other functions including...
`$3
`
You: Where is the login function defined?
AI: [Uses Cantena search]
The login function is defined in src/auth/login.ts at line 42...
`Configuration Options
$3
Instead of passing
--api-key every time, set environment variables:
`bash
export CANTENA_API_KEY=sk_live_abc123...
export CANTENA_API_URL=https://api.cantena.dev # Optional: custom API URL
`Then your IDE config becomes simpler:
`json
{
"mcpServers": {
"cantena": {
"command": "npx",
"args": ["-y", "cantena-mcp"]
}
}
}
`$3
If you're self-hosting or using a custom Cantena instance:
`json
{
"mcpServers": {
"cantena": {
"command": "npx",
"args": [
"-y",
"cantena-mcp",
"--api-key", "YOUR_API_KEY",
"--api-url", "https://your-custom-api.com"
]
}
}
}
`How It Works
1. File Discovery: Cantena automatically discovers all TypeScript and JavaScript files in your repository
2. Cloud Analysis: Files are sent to Cantena's API for graph generation (your code is processed securely and not stored)
3. Graph Generation: Cantena builds a comprehensive graph of your code structure
4. AI Integration: Your IDE's AI can query this graph to answer questions about your code
Supported File Types
- TypeScript (
.ts, .tsx)
- JavaScript (.js, .jsx)Automatically excludes:
-
node_modules/
- Build directories (build/, dist/, .next/)
- Test files (.test.ts, .spec.js)Privacy & Security
- Your code is sent to Cantena's API for analysis
- Code is processed in real-time and not permanently stored
- All communication is encrypted via HTTPS
- API keys are required for authentication
Troubleshooting
$3
Make sure you've:
1. Signed up at cantena.dev and got your API key
2. Added the API key to your IDE config
3. Restarted your IDE after configuration changes
$3
This is normal - Cantena analyzes your codebase the first time you ask a question. Subsequent questions in the same session use the cached analysis.
$3
1. Verify your config file syntax is correct (valid JSON)
2. Make sure you restarted your IDE after adding the config
3. Check IDE logs for MCP connection errors
4. Try running
npx cantena-mcp --api-key YOUR_KEY manually to test$3
Cantena analyzes your entire codebase. For very large projects (10,000+ files), the initial analysis may take 30-60 seconds. Subsequent queries are instant using the cached graph.
CLI Usage
You can also run Cantena directly from the command line:
`bash
With API key as argument
npx cantena-mcp --api-key sk_live_abc123...With environment variable
export CANTENA_API_KEY=sk_live_abc123...
npx cantena-mcpShow help
npx cantena-mcp --helpShow version
npx cantena-mcp --version
``MIT
- Documentation: cantena.dev/docs
- Issues: github.com/cantena/cantena-mcp
- Email: support@cantena.dev