CodeRAG
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
Your agent searched the codebase. Did it find the right code?
Local-first hybrid code search for AI assistants. One MCP call indexes your repo and returns semantic chunks — functions, classes, and methods — not noisy grep dumps or slow cloud pipelines.
Local-first · MCP-first · Hybrid TF-IDF + Vector · ~200 tests · Reproducible benchmark
⭐ Star this repo if agents should find code with evidence, not guess from keyword hits. · Quick start · See it work · Why not grep alone? · Roadmap
The problem
Agents search codebases thousands of times per session. Most paths give you one of two bad outcomes:
grep/ripgrep — fast, but literal. Misses
authenticateUserwhen you ask for "login flow". Returns whole files, not the function you need.Cloud RAG — semantic, but needs Docker, vector DBs, embedding APIs, and 10–30s cold starts before the first search.
The model still guesses which snippet matters. Wrong chunk → wrong patch → wasted context.
CodeRAG is built for the moment your agent needs the right code block, not a directory of keyword hits.
Related MCP server: mcplens
Why not grep alone?
grep/ripgrep | Cloud RAG | CodeRAG | |
Semantic understanding | ❌ Literal match | ✅ Embeddings | ✅ TF-IDF + optional vectors |
Zero external deps | ✅ | ❌ Vector DB + embed API | ✅ Local by default |
Offline support | ✅ | ❌ | ✅ |
Result shape | Whole files / lines | Often whole files | AST chunks (functions, classes) |
Agent setup | Shell tool | Docker + services |
|
Search latency and indexing throughput: reproduce with
bun run benchmark:public-proof — do not trust hand-waved
ms claims.
Full comparison: how search works.
See it work
Install once. Point at your repo.
claude mcp add coderag -- npx @sylphx/coderag-mcp --root=/absolute/path/to/projectSearch with the codebase_search tool:
{
"query": "user authentication login",
"limit": 5,
"file_extensions": [".ts", ".tsx"],
"exclude_paths": ["node_modules", "dist"]
}Returns ranked chunks — not entire files:
# Search: "user authentication login" (3 results)
## src/auth/login.ts:1-12
```typescript
export async function authenticate(username: string, password: string) {
const user = await findUserByEmail(username)
return validatePassword(user, password)
}
## Why agents use it
| Need | What you get |
| --- | --- |
| Find implementation | AST chunks at semantic boundaries (functions, classes, methods) |
| Keyword + meaning | Hybrid TF-IDF with optional OpenAI embeddings |
| Fast iteration | Local index, incremental updates, file watching |
| Low setup | MCP server via `npx` — no Docker or ChromaDB required |
| Ship with proof | ~200 tests, reproducible public benchmark script |
## Quick Start
### Claude Code (recommended)
```bash
claude mcp add coderag -- npx @sylphx/coderag-mcp --root=/absolute/path/to/projectClaude Desktop
Add to claude_desktop_config.json:
{
"mcpServers": {
"coderag": {
"command": "npx",
"args": ["-y", "@sylphx/coderag-mcp", "--root=/absolute/path/to/project"]
}
}
}Any MCP Client
npx @sylphx/coderag-mcp --root=/absolute/path/to/projectNeed Cursor, VS Code, Windsurf, or library usage? See the installation guide and MCP docs.
As a Library
bun add @sylphx/coderagimport { CodebaseIndexer, PersistentStorage } from '@sylphx/coderag'
const storage = new PersistentStorage({ codebaseRoot: './my-project' })
const indexer = new CodebaseIndexer({ codebaseRoot: './my-project', storage })
await indexer.index({ watch: true })
const results = await indexer.search('authentication logic', { limit: 10 })MCP Tool: codebase_search
Parameter | Type | Default | Description |
| string | — | Search query (required) |
| number | 10 | Max results |
| boolean | true | Include code snippets |
| string[] | — | Filter by extension |
| string | — | Filter by path pattern |
| string[] | — | Exclude paths |
Full tool reference: docs/mcp/tools.md.
Benchmark Proof
Performance claims in this README are backed only by the checked-in public benchmark script — not hand-waved marketing numbers.
bun run benchmark:public-proofThe script indexes fixtures/benchmark-corpus/ (30 TypeScript files), runs
hybrid TF-IDF search 20 times (3 warmup), and prints indexing throughput plus
search p50/min/max latency.
See benchmark proof for methodology and latest reproduced results.
Packages
Package | Description | Install |
Core search library |
| |
MCP server for AI assistants |
|
Documentation
Topic | Link |
Docs site | |
Getting started | |
MCP server | |
How search works | |
Benchmark proof | |
Stop code-search guessing | |
API reference |
Security model
Root confinement —
--rootpins indexing and search to one repository tree.Exclude paths —
exclude_pathsand default ignores skipnode_modules, build output, and VCS metadata.Local-first — TF-IDF indexing runs on your machine; embeddings are optional and caller-configured.
Evidence fields — results include file path, line range, symbol, score route, and index freshness for verification.
Example MCP request: examples/codebase-search-request.json.
Development
git clone https://github.com/SylphxAI/coderag.git
cd coderag
bun install
bun run build
bun testUseful checks:
bun run lint
bun run typecheck
bun run docs:build
bun run benchmark:public-proof
bun test test/readmeDiscovery.test.tsHelp this reach more builders
If wrong code snippets have wasted your agent context, your edits, or your trust in search results, you are exactly who this project is for.
⭐ Star the repo — it is the fastest way to help more agent builders find chunk-level code search. Share it in your MCP client setup, team wiki, or agent stack README.
Discovery (in progress)
Channel | Status |
Not listed yet — no | |
Not listed yet | |
Not listed yet — free web-form submission | |
Not listed yet |
Know another MCP directory? Open an issue with the link.
License
MIT © SylphxAI
This server cannot be installed
Maintenance
Resources
Unclaimed servers have limited discoverability.
Looking for Admin?
If you are the server author, to access and configure the admin panel.
Latest Blog Posts
- Your AI Chatbot Just Exposed Your CEO's Salary to an InternBy Om-Shree-0709 on .Agent IdentityMCP SecurityOAuth Delegation
- Why MCP Servers Need Execution Sandboxing (And Why Your Current Stack Isn't Enough)By Om-Shree-0709 on .Agentic AiPrompt InjectionWebAssembly
MCP directory API
We provide all the information about MCP servers via our MCP API.
curl -X GET 'https://glama.ai/api/mcp/v1/servers/SylphxAI/coderag'
If you have feedback or need assistance with the MCP directory API, please join our Discord server