MCP server for CodeRAG - Model Context Protocol integration for RAG
npm install @sylphx/coderag-mcpMCP server for intelligent codebase search - RAG-ready for AI assistants.
Using Claude Desktop, VS Code, Cursor, Claude Code, or other MCP clients.
``json`
{
"mcpServers": {
"coderag": {
"command": "npx",
"args": ["-y", "@sylphx/coderag-mcp", "--root=/path/to/project"]
}
}
}
Installation
Add to your claude_desktop_config.json:
macOS: ~/Library/Application Support/Claude/claude_desktop_config.json%APPDATA%\Claude\claude_desktop_config.json
Windows:
`json`
{
"mcpServers": {
"coderag": {
"command": "npx",
"args": ["-y", "@sylphx/coderag-mcp", "--root=/path/to/project"]
}
}
}
Installation
Add to your VS Code settings (JSON):
`json`
{
"mcp": {
"servers": {
"coderag": {
"command": "npx",
"args": ["-y", "@sylphx/coderag-mcp", "--root=${workspaceFolder}"]
}
}
}
}
Or add to .vscode/mcp.json in your project:
`json`
{
"servers": {
"coderag": {
"command": "npx",
"args": ["-y", "@sylphx/coderag-mcp", "--root=${workspaceFolder}"]
}
}
}
Installation
Add to your Cursor MCP config:
macOS: ~/.cursor/mcp.json%USERPROFILE%\.cursor\mcp.json
Windows:
`json`
{
"mcpServers": {
"coderag": {
"command": "npx",
"args": ["-y", "@sylphx/coderag-mcp", "--root=/path/to/project"]
}
}
}
Installation
Add to your Windsurf MCP config:
macOS: ~/.codeium/windsurf/mcp_config.json%USERPROFILE%\.codeium\windsurf\mcp_config.json
Windows:
`json`
{
"mcpServers": {
"coderag": {
"command": "npx",
"args": ["-y", "@sylphx/coderag-mcp", "--root=/path/to/project"]
}
}
}
Installation
`bash`
claude mcp add coderag -- npx -y @sylphx/coderag-mcp --root=/path/to/project
Installation
Use the standard config format. All MCP-compatible clients should work with:
`json`
{
"mcpServers": {
"coderag": {
"command": "npx",
"args": ["-y", "@sylphx/coderag-mcp", "--root=/path/to/project"]
}
}
}
Using bun:
`json`
{
"mcpServers": {
"coderag": {
"command": "bunx",
"args": ["@sylphx/coderag-mcp", "--root=/path/to/project"]
}
}
}
Global install:
`bash`
npm install -g @sylphx/coderag-mcpor
bun add -g @sylphx/coderag-mcp
Then use coderag-mcp as the command:
`json`
{
"mcpServers": {
"coderag": {
"command": "coderag-mcp",
"args": ["--root=/path/to/project"]
}
}
}
| Option | Default | Description |
|--------|---------|-------------|
| --root= | Current directory | Codebase root path |--max-size=
| | 1048576 (1MB) | Max file size to index |--no-auto-index
| | false | Disable auto-indexing on startup |
Search project source files with TF-IDF ranking.
| Parameter | Type | Required | Default | Description |
|-----------|------|----------|---------|-------------|
| query | string | Yes | - | Search query |limit
| | number | No | 10 | Max results |include_content
| | boolean | No | true | Include code snippets |file_extensions
| | string[] | No | - | Filter by extension |path_filter
| | string | No | - | Filter by path |exclude_paths
| | string[] | No | - | Exclude paths |
`json`
{
"query": "authentication",
"limit": 5,
"file_extensions": [".ts", ".tsx"],
"exclude_paths": ["node_modules", "dist"]
}
LLM-optimized output (minimal tokens, maximum content):
`markdownSearch: "authentication" (3 results)
typescript
15: export async function authenticate(credentials) {
16: const user = await findUser(credentials.email)
`docs/auth.md:42-55 [markdown→typescript]
`typescript
42: // Embedded code from docs
`src/utils/large-file.ts:1-500 [truncated]
`typescript
1: // First 70% of content shown...... [1500 chars truncated] ...
490: // Last 20% of content shown
`
`Usage Tips
Good queries:
-
user authentication login
- database connection
- React form validationLess effective:
- Single common words like
function, const
- Very long sentencesPerformance
| Metric | Value |
|--------|-------|
| Startup | 1-5 seconds |
| Search | <50ms |
| Memory | ~1-2 MB per 1000 files |
Development
`bash
git clone https://github.com/SylphxAI/coderag.git
cd coderagbun install
bun run build
Run locally
cd packages/mcp-server
bun run dev
``MIT
---
Powered by Sylphx
Built with @sylphx/coderag · @sylphx/mcp-server-sdk