Integrates with OpenAI's embedding models to enable semantic code search, allowing for hybrid ranking that combines traditional TF-IDF keyword matching with vector-based semantic understanding.
Click on "Install Server".
Wait a few minutes for the server to deploy. Once ready, it will show a "Started" state.
In the chat, type
@followed by the MCP server name and your instructions, e.g., "@CodeRAGfind the implementation of the JWT token validation"
That's it! The server will respond to your query, and you can continue using it as needed.
Here is a step-by-step guide with screenshots.
CodeRAG
Lightning-fast hybrid code search for AI assistants
Zero dependencies • <50ms search • Hybrid TF-IDF + Vector • MCP ready
Quick Start • Features • MCP Setup • API
Why CodeRAG?
Traditional code search tools are either slow (full-text grep), inaccurate (keyword matching), or complex (require external services).
CodeRAG is different:
Feature | grep/ripgrep | Cloud RAG | CodeRAG |
Semantic understanding | ❌ | ✅ | ✅ |
Zero external deps | ✅ | ❌ | ✅ |
Offline support | ✅ | ❌ | ✅ |
Startup time | Instant | 10-30s | <1s |
Search latency | ~100ms | ~500ms | <50ms |
✨ Features
Search
🔍 Hybrid Search - TF-IDF + optional vector embeddings
🧠 StarCoder2 Tokenizer - Code-aware tokenization (4.7MB, trained on code)
📊 Smoothed IDF - No term gets ignored, stable ranking
⚡ <50ms Latency - Instant results even on large codebases
Indexing
🚀 1000-2000 files/sec - Fast initial indexing
💾 SQLite Persistence - Instant startup (<100ms) with cached index
⚡ Incremental Updates - Smart diff detection, no full rebuilds
👁️ File Watching - Real-time index updates on file changes
Integration
📦 MCP Server - Works with Claude Desktop, Cursor, VS Code, Windsurf
🧠 Vector Search - Optional OpenAI embeddings for semantic search
🌳 AST Chunking - Smart code splitting using Synth parsers (15+ languages)
💻 Low Memory Mode - SQL-based search for resource-constrained environments
🚀 Quick Start
Option 1: MCP Server (Recommended for AI Assistants)
Or add to your MCP config:
See MCP Server Setup for Claude Desktop, Cursor, VS Code, etc.
Option 2: As a Library
📦 Packages
Package | Description | Install |
Core search library |
| |
MCP server for AI assistants |
|
🔌 MCP Server Setup
Claude Desktop
Add to claude_desktop_config.json:
macOS: ~/Library/Application Support/Claude/claude_desktop_config.json
Windows: %APPDATA%\Claude\claude_desktop_config.json
Cursor
Add to ~/.cursor/mcp.json (macOS) or %USERPROFILE%\.cursor\mcp.json (Windows):
VS Code
Add to VS Code settings (JSON) or .vscode/mcp.json:
Windsurf
Add to ~/.codeium/windsurf/mcp_config.json:
Claude Code
🛠️ MCP Tool: codebase_search
Search project source files with hybrid TF-IDF + vector ranking.
Parameters
Parameter | Type | Required | Default | Description |
| string | Yes | - | Search query |
| number | No | 10 | Max results |
| boolean | No | true | Include code snippets |
| string[] | No | - | Filter by extension (e.g., |
| string | No | - | Filter by path pattern |
| string[] | No | - | Exclude paths (e.g., |
Example
Response Format
LLM-optimized output (minimal tokens, maximum content):
src/middleware/auth.ts:42-55 [md→typescript]
src/utils/large.ts:1-200 [truncated]
PersistentStorage
SQLite-backed storage for instant startup.
Low-Level TF-IDF Functions
Vector Search (Optional)
For semantic search with embeddings:
⚙️ Configuration
MCP Server Options
Option | Default | Description |
| Current directory | Codebase root path |
| 1048576 (1MB) | Max file size to index |
| false | Disable auto-indexing on startup |
Environment Variables
Variable | Description |
| Enable vector search with OpenAI embeddings |
| Custom OpenAI-compatible endpoint |
| Embedding model (default: |
| Custom embedding dimensions |
📊 Performance
Metric | Value |
Initial indexing | ~1000-2000 files/sec |
Startup with cache | <100ms |
Search latency | <50ms |
Memory per 1000 files | ~1-2 MB |
Tokenizer size | 4.7MB (StarCoder2) |
Benchmarks
Tested on MacBook Pro M1, 16GB RAM:
Codebase | Files | Index Time | Search Time |
Small (100 files) | 100 | 0.5s | <10ms |
Medium (1000 files) | 1,000 | 2s | <30ms |
Large (10000 files) | 10,000 | 15s | <50ms |
🏗️ Architecture
How It Works
Indexing: Scans codebase, tokenizes with StarCoder2, builds TF-IDF index
AST Chunking: Splits code at semantic boundaries (functions, classes, etc.)
Storage: Persists to SQLite (
.coderag/folder) for instant startupWatching: Detects file changes, performs incremental updates
Search: Hybrid TF-IDF + optional vector search with score fusion
Supported Languages
AST-based chunking with semantic boundary detection:
Category | Languages |
JavaScript | JavaScript, TypeScript, JSX, TSX |
Systems | Python, Go, Java, C |
Markup | Markdown, HTML, XML |
Data/Config | JSON, YAML, TOML, INI |
Other | Protobuf |
Embedded Code Support: Automatically parses code blocks in Markdown and <script>/<style> tags in HTML.
🔧 Development
🤝 Contributing
Contributions are welcome! Please:
Open an issue to discuss changes
Fork and create a feature branch
Run
bun run lintandbun run testSubmit a pull request
📄 License
MIT © Sylphx
Powered by
Built with @sylphx/synth • @sylphx/mcp-server-sdk • @sylphx/doctor • @sylphx/bump