A high-performance semantic code search MCP (Model Context Protocol) server for AI-assisted development. Index codebases and search using hybrid vector similarity + full-text search directly from Claude Code, Claude Desktop, Zed, VSCode, and other MCP-compatible clients.
# Download the latest release for your platform
# Linux: https://github.com/KaruTest/rust-codebase-search/releases/latest/download/code-search-linux
# Windows: https://github.com/KaruTest/rust-codebase-search/releases/latest/download/code-search.exe
# Make it executable (Linux only)
chmod +x code-search-linux
# Configure it with your MCP client (see below)
Pre-built binaries are available for Linux and Windows from the GitHub Releases page.
Linux:
# Download the latest Linux binary
wget https://github.com/KaruTest/rust-codebase-search/releases/latest/download/code-search-linux
# Make it executable
chmod +x code-search-linux
# Move to your preferred location
sudo mv code-search-linux /usr/local/bin/code-search
Windows:
# Download the latest Windows binary
# https://github.com/KaruTest/rust-codebase-search/releases/latest/download/code-search.exe
# Move to your preferred location (e.g., C:\Tools\code-search.exe)
No build required! The binaries include all dependencies and are ready to use.
If you prefer to build from source or need a custom build:
# Prerequisites: Rust 1.70 or later
git clone <repository-url>
cd rust-codebase-search
cargo build --release
Download and install the binary (see Installation section above)
Create .mcp.json in your project root:
Linux:
{
"codebase-search": {
"command": "/usr/local/bin/code-search",
"args": ["mcp"],
"env": {
"RUST_LOG": "info"
}
}
}
Windows:
{
"codebase-search": {
"command": "C:\\Tools\\code-search.exe",
"args": ["mcp"],
"env": {
"RUST_LOG": "info"
}
}
}
Add to ~/.claude/settings.json:
{
"enableAllProjectMcpServers": true
}
Add to claude_desktop_config.json:
Linux:
{
"mcpServers": {
"code-search": {
"command": "/usr/local/bin/code-search",
"args": ["mcp"]
}
}
}
Windows:
{
"mcpServers": {
"code-search": {
"command": "C:\\Tools\\code-search.exe",
"args": ["mcp"]
}
}
}
Config locations:
~/Library/Application Support/Claude/claude_desktop_config.json%APPDATA%/Claude/claude_desktop_config.jsonAdd to ~/.zed/settings.json (Linux) or %USERPROFILE%\.zed\settings.json (Windows):
Linux:
{
"mcp": {
"code-search": {
"command": ["/usr/local/bin/code-search", "mcp"]
}
}
}
Windows:
{
"mcp": {
"code-search": {
"command": ["C:\\Tools\\code-search.exe", "mcp"]
}
}
}
Add to settings.json:
Linux:
{
"mcpServers": {
"code-search": {
"command": "/usr/local/bin/code-search",
"args": ["mcp"]
}
}
}
Windows:
{
"mcpServers": {
"code-search": {
"command": "C:\\Tools\\code-search.exe",
"args": ["mcp"]
}
}
}
IMPORTANT: To ensure the MCP server is used as the primary source for code searches (instead of random grep/glob), set up MCP priority rules:
# Create the rules directory
mkdir -p .claude/rules
# Copy the priority rules
cp docs/MCP_PRIORITY.md .claude/rules/mcp-priority.md
Restart Claude Code/Claude Desktop to load the priority rules.
Ask your AI assistant: "Find database functions in this codebase"
If configured correctly, it should use codebase_search instead of grep/glob.
Why MCP Priority Matters:
| Tool | Description |
|---|---|
codebase_index | Index a codebase for semantic search |
codebase_search | Search indexed code using semantic similarity |
codebase_status | List all indexed codebases and stats |
codebase_delete | Remove a codebase from the index |
{
"name": "codebase_index",
"arguments": {
"path": "/home/user/projects/my-api",
"tags": "backend,api,rust",
"model": "minilm"
}
}
{
"name": "codebase_search",
"arguments": {
"query": "database connection handling",
"codebase": "my-api",
"limit": 10
}
}
{
"name": "codebase_search",
"arguments": {
"query": "authentication implementation",
"limit": 10
}
}
{
"name": "codebase_status",
"arguments": {}
}
Prompt: "How does the authentication system work in this codebase?"
AI Actions:
codebase_search to find authentication-related codesrc/auth/*.rs, src/middleware/auth.rsPrompt: "Find all database error handling functions"
AI Actions:
codebase_search with semantic query "database error handling"Prompt: "I need to add rate limiting to my API endpoints"
AI Actions:
Prompt: "Show me all API endpoints across my backend and frontend projects"
AI Actions:
codebase_status to see all indexed codebases.gitignore patterns when indexingThe MCP server supports several configuration options:
Location:
~/.local/share/code-search/~/Library/Application Support/code-search/%APPDATA%/code-search/Files:
index.db - SQLite database with chunks, vectors, and metadatamanifests/ - SHA256 manifests for incremental updatesTest your MCP server installation:
Linux:
# Test server initialization
echo '{"jsonrpc":"2.0","id":1,"method":"initialize","params":{"protocolVersion":"2024-11-05","capabilities":{},"clientInfo":{"name":"test","version":"1.0"}}}' | /usr/local/bin/code-search mcp
# List available tools
echo '{"jsonrpc":"2.0","id":2,"method":"tools/list"}' | /usr/local/bin/code-search mcp
# Test codebase search
echo '{"jsonrpc":"2.0","id":3,"method":"tools/call","params":{"name":"codebase_status","arguments":{}}}' | /usr/local/bin/code-search mcp
Windows:
# Test server initialization (PowerShell)
'{"jsonrpc":"2.0","id":1,"method":"initialize","params":{"protocolVersion":"2024-11-05","capabilities":{},"clientInfo":{"name":"test","version":"1.0"}}}' | C:\Tools\code-search.exe mcp
/usr/local/bin/code-search, Windows: C:\Tools\code-search.exe)chmod +x /usr/local/bin/code-searchRUST_LOG=debug in environment variablesLinux:
# Re-index with force flag
echo '{"jsonrpc":"2.0","id":4,"method":"tools/call","params":{"name":"codebase_index","arguments":{"path":"/path/to/codebase","force":true}}}' | /usr/local/bin/code-search mcp
Windows:
# Re-index with force flag
'{"jsonrpc":"2.0","id":4,"method":"tools/call","params":{"name":"codebase_index","arguments":{"path":"C:\\path\\to\\codebase","force":true}}}' | C:\Tools\code-search.exe mcp
# Remove database and start fresh
rm ~/.local/share/code-search/index.db
[Specify your license]
cargo testcargo clippycargo fmt1 commits
Rust
100.0%
A high-performance semantic code search MCP (Model Context Protocol) server for AI-assisted development. Index codebases and search using hybrid vector similarity + full-text search directly from Claude Code, Claude Desktop, Zed, VSCode, and other MCP-compatible clients.
# Download the latest release for your platform
# Linux: https://github.com/KaruTest/rust-codebase-search/releases/latest/download/code-search-linux
# Windows: https://github.com/KaruTest/rust-codebase-search/releases/latest/download/code-search.exe
# Make it executable (Linux only)
chmod +x code-search-linux
# Configure it with your MCP client (see below)
Pre-built binaries are available for Linux and Windows from the GitHub Releases page.
Linux:
# Download the latest Linux binary
wget https://github.com/KaruTest/rust-codebase-search/releases/latest/download/code-search-linux
# Make it executable
chmod +x code-search-linux
# Move to your preferred location
sudo mv code-search-linux /usr/local/bin/code-search
Windows:
# Download the latest Windows binary
# https://github.com/KaruTest/rust-codebase-search/releases/latest/download/code-search.exe
# Move to your preferred location (e.g., C:\Tools\code-search.exe)
No build required! The binaries include all dependencies and are ready to use.
If you prefer to build from source or need a custom build:
# Prerequisites: Rust 1.70 or later
git clone <repository-url>
cd rust-codebase-search
cargo build --release
Download and install the binary (see Installation section above)
Create .mcp.json in your project root:
Linux:
{
"codebase-search": {
"command": "/usr/local/bin/code-search",
"args": ["mcp"],
"env": {
"RUST_LOG": "info"
}
}
}
Windows:
{
"codebase-search": {
"command": "C:\\Tools\\code-search.exe",
"args": ["mcp"],
"env": {
"RUST_LOG": "info"
}
}
}
Add to ~/.claude/settings.json:
{
"enableAllProjectMcpServers": true
}
Add to claude_desktop_config.json:
Linux:
{
"mcpServers": {
"code-search": {
"command": "/usr/local/bin/code-search",
"args": ["mcp"]
}
}
}
Windows:
{
"mcpServers": {
"code-search": {
"command": "C:\\Tools\\code-search.exe",
"args": ["mcp"]
}
}
}
Config locations:
~/Library/Application Support/Claude/claude_desktop_config.json%APPDATA%/Claude/claude_desktop_config.jsonAdd to ~/.zed/settings.json (Linux) or %USERPROFILE%\.zed\settings.json (Windows):
Linux:
{
"mcp": {
"code-search": {
"command": ["/usr/local/bin/code-search", "mcp"]
}
}
}
Windows:
{
"mcp": {
"code-search": {
"command": ["C:\\Tools\\code-search.exe", "mcp"]
}
}
}
Add to settings.json:
Linux:
{
"mcpServers": {
"code-search": {
"command": "/usr/local/bin/code-search",
"args": ["mcp"]
}
}
}
Windows:
{
"mcpServers": {
"code-search": {
"command": "C:\\Tools\\code-search.exe",
"args": ["mcp"]
}
}
}
IMPORTANT: To ensure the MCP server is used as the primary source for code searches (instead of random grep/glob), set up MCP priority rules:
# Create the rules directory
mkdir -p .claude/rules
# Copy the priority rules
cp docs/MCP_PRIORITY.md .claude/rules/mcp-priority.md
Restart Claude Code/Claude Desktop to load the priority rules.
Ask your AI assistant: "Find database functions in this codebase"
If configured correctly, it should use codebase_search instead of grep/glob.
Why MCP Priority Matters:
| Tool | Description |
|---|---|
codebase_index | Index a codebase for semantic search |
codebase_search | Search indexed code using semantic similarity |
codebase_status | List all indexed codebases and stats |
codebase_delete | Remove a codebase from the index |
{
"name": "codebase_index",
"arguments": {
"path": "/home/user/projects/my-api",
"tags": "backend,api,rust",
"model": "minilm"
}
}
{
"name": "codebase_search",
"arguments": {
"query": "database connection handling",
"codebase": "my-api",
"limit": 10
}
}
{
"name": "codebase_search",
"arguments": {
"query": "authentication implementation",
"limit": 10
}
}
{
"name": "codebase_status",
"arguments": {}
}
Prompt: "How does the authentication system work in this codebase?"
AI Actions:
codebase_search to find authentication-related codesrc/auth/*.rs, src/middleware/auth.rsPrompt: "Find all database error handling functions"
AI Actions:
codebase_search with semantic query "database error handling"Prompt: "I need to add rate limiting to my API endpoints"
AI Actions:
Prompt: "Show me all API endpoints across my backend and frontend projects"
AI Actions:
codebase_status to see all indexed codebases.gitignore patterns when indexingThe MCP server supports several configuration options:
Location:
~/.local/share/code-search/~/Library/Application Support/code-search/%APPDATA%/code-search/Files:
index.db - SQLite database with chunks, vectors, and metadatamanifests/ - SHA256 manifests for incremental updatesTest your MCP server installation:
Linux:
# Test server initialization
echo '{"jsonrpc":"2.0","id":1,"method":"initialize","params":{"protocolVersion":"2024-11-05","capabilities":{},"clientInfo":{"name":"test","version":"1.0"}}}' | /usr/local/bin/code-search mcp
# List available tools
echo '{"jsonrpc":"2.0","id":2,"method":"tools/list"}' | /usr/local/bin/code-search mcp
# Test codebase search
echo '{"jsonrpc":"2.0","id":3,"method":"tools/call","params":{"name":"codebase_status","arguments":{}}}' | /usr/local/bin/code-search mcp
Windows:
# Test server initialization (PowerShell)
'{"jsonrpc":"2.0","id":1,"method":"initialize","params":{"protocolVersion":"2024-11-05","capabilities":{},"clientInfo":{"name":"test","version":"1.0"}}}' | C:\Tools\code-search.exe mcp
/usr/local/bin/code-search, Windows: C:\Tools\code-search.exe)chmod +x /usr/local/bin/code-searchRUST_LOG=debug in environment variablesLinux:
# Re-index with force flag
echo '{"jsonrpc":"2.0","id":4,"method":"tools/call","params":{"name":"codebase_index","arguments":{"path":"/path/to/codebase","force":true}}}' | /usr/local/bin/code-search mcp
Windows:
# Re-index with force flag
'{"jsonrpc":"2.0","id":4,"method":"tools/call","params":{"name":"codebase_index","arguments":{"path":"C:\\path\\to\\codebase","force":true}}}' | C:\Tools\code-search.exe mcp
# Remove database and start fresh
rm ~/.local/share/code-search/index.db
[Specify your license]
cargo testcargo clippycargo fmt1 commits
Rust
100.0%