AI-powered code intelligence for your IDE. Index any codebase, then ask questions about it in natural language via Claude, Cursor, VS Code, or any MCP client.
16 tools — search, explain, trace data flow, find duplicates, analyze security, check complexity, AI code review, bug prediction, and more.
8 languages — JavaScript, TypeScript, Python, Rust, Go, Java, C/C++, Ruby.
Prerequisites: Node.js v20+ and Rust 1.88+
git clone https://github.com/msenol/CodeSight.git
cd CodeSight
npm run setupnpm run setup installs dependencies, compiles the Rust native module, and builds TypeScript.
Edit claude_desktop_config.json:
- macOS:
~/Library/Application Support/Claude/claude_desktop_config.json - Windows:
%APPDATA%\Claude\claude_desktop_config.json
{
"mcpServers": {
"codesight": {
"command": "node",
"args": ["/path/to/CodeSight/typescript-mcp/dist/index.js"]
}
}
}Edit ~/.continue/config.json:
{
"mcpServers": {
"codesight": {
"command": "node",
"args": ["/path/to/CodeSight/typescript-mcp/dist/index.js"]
}
}
}Add in Cline MCP settings:
{
"codesight": {
"command": "node",
"args": ["/path/to/CodeSight/typescript-mcp/dist/index.js"]
}
}Edit ~/.cursor/mcp.json:
{
"mcpServers": {
"codesight": {
"command": "node",
"args": ["/path/to/CodeSight/typescript-mcp/dist/index.js"]
}
}
}Edit ~/.codeium/windsurf/mcp_config.json:
{
"mcpServers": {
"codesight": {
"command": "node",
"args": ["/path/to/CodeSight/typescript-mcp/dist/index.js"]
}
}
}Edit ~/.config/zed/settings.json:
{
"context_servers": {
"codesight": {
"command": "node",
"args": ["/path/to/CodeSight/typescript-mcp/dist/index.js"]
}
}
}Restart your IDE after editing the config.
cd typescript-mcp
# Index
node dist/cli/index.js index /path/to/your/project
# Check stats
node dist/cli/index.js statsThen ask your AI assistant anything about your code.
| Ask | What happens |
|---|---|
| "Show me all authentication functions" | Searches your codebase for auth-related functions |
"What does validateToken do?" |
Explains the function with context from your code |
"Where is UserService used?" |
Finds all references across files |
"Trace the data flow of userId" |
Shows how the variable moves through your code |
| "List all API endpoints" | Discovers Express/Fastify/NestJS routes |
| Ask | What happens |
|---|---|
| "What's the complexity of this module?" | Cyclomatic + cognitive complexity analysis |
| "Find duplicate code patterns" | Detects copy-pasted code blocks |
| "Suggest refactoring for this file" | Actionable improvement suggestions |
| "Analyze the entire codebase complexity" | System-wide complexity report |
| Ask | What happens |
|---|---|
| "Check for security vulnerabilities" | Scans for SQL injection, XSS, hardcoded secrets |
| "Are there any SQL injection risks?" | Targeted security analysis |
| Ask | What happens |
|---|---|
| "Review this code for quality issues" | AI code review with scoring |
| "Predict potential bugs in this module" | ML-enhanced bug prediction |
| "Generate a REST endpoint for users" | Context-aware code generation |
| "How can I refactor this service?" | AI-driven refactoring recommendations |
| "What's our technical debt?" | Technical debt assessment with ROI |
| Tool | Description |
|---|---|
search_code |
Natural language search (~4ms via SQLite) |
explain_function |
Function explanation with codebase context |
find_references |
Cross-file symbol reference finding |
trace_data_flow |
Variable data flow tracing |
analyze_security |
Security vulnerability detection |
get_api_endpoints |
API endpoint discovery |
check_complexity |
AST-based complexity analysis |
find_duplicates |
Rabin-Karp duplicate detection |
suggest_refactoring |
Refactoring recommendations |
index_codebase |
Parallel indexing with SQLite persistence |
analyze_codebase_complexity |
System-wide complexity analysis |
| Tool | Description |
|---|---|
ai_code_review |
AI-powered code review with quality scoring |
intelligent_refactoring |
AI-driven refactoring recommendations |
bug_prediction |
Proactive bug prediction and risk assessment |
context_aware_code_generation |
Code generation with project context |
technical_debt_analysis |
Technical debt assessment with prioritization |
cd typescript-mcp
node dist/cli/index.js index <path> # Index a codebase
node dist/cli/index.js search <query> # Search code
node dist/cli/index.js stats # Show statistics
node dist/cli/index.js server # Start MCP server (stdio)AI tools require an API key. Add to typescript-mcp/.env:
OPENROUTER_API_KEY=sk-or-v1-your-key-here
OPENROUTER_MODEL=xiaomi/mimo-v2-flash:freeGet a free key at openrouter.ai/keys.
Supported providers: OpenRouter (100+ models), Anthropic, OpenAI, Ollama (local).
If no key is set, CodeSight falls back to rule-based analysis — everything still works, just without AI.
CodeSight also runs as an HTTP server (port 4000):
# Start
cd typescript-mcp && node dist/index.js
# Search
curl -X POST http://localhost:4000/api/search \
-H "Content-Type: application/json" \
-d '{"query": "authentication"}'
# Index
curl -X POST http://localhost:4000/api/index \
-H "Content-Type: application/json" \
-d '{"path": "/path/to/project"}'
# Health
curl http://localhost:4000/health
# Call any MCP tool
curl -X POST http://localhost:4000/mcp/call \
-H "Content-Type: application/json" \
-d '{"tool": "check_complexity", "args": {"file_path": "src/index.ts"}}'# Production (PostgreSQL + Redis)
docker-compose up -d
# Development (hot reload)
docker-compose -f docker-compose.dev.yml up -d
# Check status
docker-compose ps| Service | Port | Purpose |
|---|---|---|
| code-intelligence | 4000, 8080 | MCP Server + REST API |
| postgres | 5432 | Database |
| redis | 6379 | Caching |
| Language | Parsing | Complexity | Duplicates |
|---|---|---|---|
| JavaScript | ✅ | ✅ | ✅ |
| TypeScript | ✅ | ✅ | ✅ |
| Python | ✅ | ✅ | ✅ |
| Rust | ✅ | ✅ | ✅ |
| Go | ✅ | ✅ | ✅ |
| Java | ✅ | ✅ | ✅ |
| C/C++ | ✅ | ✅ | ✅ |
| Ruby | ✅ | ✅ | ✅ |
| Operation | Speed | Notes |
|---|---|---|
| Indexing | ~123ms (73 files) | Parallel Rust processing |
| Search | ~4ms | SQLite-backed keyword search |
| Complexity | ~2ms | AST-based Rust analysis |
| Duplicates | O(n) | Rabin-Karp rolling hash |
- User Guide — Detailed setup, use cases, troubleshooting
- MCP Tools Reference — All 16 tools documented
- REST API Reference — HTTP endpoints
- Rust FFI Bridge — Native module architecture
- Performance Benchmarks — Detailed metrics
MIT — see LICENSE.
- Tree-sitter — language parsing
- NAPI-RS — Rust/Node.js bridge
- Model Context Protocol — AI integration standard
- fastembed — ONNX embeddings