Code RAG MCP Server
MCP (Model Context Protocol) server for semantic code search. Replace grep/ripgrep with understanding-based code search.
🚀 Features
- ✅ Semantic Search: Find code by concept, not just by text
- ✅ : Uses LM Studio (no OpenAI required)
エージェントを強化
公開元からインストールします。PlugMCP のエンドポイントではありません。
リモート URL か、手元のマシンのコマンドか 2 つのインストール方法の違い
PlugMCP で実行
A new server you create. It is not this listing's official endpoint. Use the publisher install when you want their URL and their credentials.
起動公開元より
MCP (Model Context Protocol) server for semantic code search. Replace grep/ripgrep with understanding-based code search.
MCP (Model Context Protocol) server for semantic code search. Replace grep/ripgrep with understanding-based code search.
Go 1.22+
brew install go
Qdrant (Vector Database)
docker run -d --name qdrant \
-p 6333:6333 -p 6334:6334 \
-v $(pwd)/qdrant_data:/qdrant/storage \
qdrant/qdrant
LM Studio with an embedding model
nomic-ai/nomic-embed-text-v1.5-GGUF# 1. Clone the repo
git clone <your-repo>
cd code-rag-mcp
# 2. Install dependencies
go mod download
# 3. Build
go build -o code-rag-mcp
# 4. Configure
cp config.yaml ~/.config/code-rag-mcp/config.yaml
# Edit config.yaml with your code paths
# 5. Install globally (optional)
sudo cp code-rag-mcp /usr/local/bin/
Edit ~/.config/code-rag-mcp/config.yaml:
embedding_type: "local"
embedding_model: "nomic-ai/nomic-embed-text-v1.5-GGUF"
embedding_base_url: "http://localhost:1234/v1"
embedding_dim: 768
code_paths:
- "/Users/you/projects" # Your code directory
File: ~/Library/Application Support/Claude/claude_desktop_config.json (macOS)
File: ~/.config/Claude/claude_desktop_config.json (Linux)
{
"mcpServers": {
"code-rag": {
"command": "/usr/local/bin/code-rag-mcp",
"env": {
"LM_STUDIO_URL": "http://localhost:1234/v1"
}
}
}
}
After modification, fully restart Claude Desktop (Quit + relaunch).
Option A: Via CLI (Recommended) 🚀
# Add the code-rag MCP server
claude mcp add code-rag \
--type stdio \
--command /usr/local/bin/code-rag-mcp \
--scope user
# Verify installation
claude mcp list
claude mcp get code-rag
Option B: Manual configuration
Claude Code uses the same file as Claude Desktop:
~/Library/Application Support/Claude/claude_desktop_config.json~/.config/Claude/claude_desktop_config.json{
"mcpServers": {
"code-rag": {
"command": "/usr/local/bin/code-rag-mcp",
"env": {
"LM_STUDIO_URL": "http://localhost:1234/v1"
}
}
}
}
Complete copy-paste command (after building):
# 1. Install the binary
sudo cp code-rag-mcp /usr/local/bin/
sudo chmod +x /usr/local/bin/code-rag-mcp
# 2. Add to Claude Code
claude mcp add code-rag \
--type stdio \
--command /usr/local/bin/code-rag-mcp \
--scope user \
--env LM_STUDIO_URL=http://localhost:1234/v1
# 3. Verify
claude mcp list
File: ~/.config/zed/settings.json
{
"context_servers": {
"code-rag": {
"source": "custom",
"command": {
"path": "/usr/local/bin/code-rag-mcp",
"args": [],
"env": {
"LM_STUDIO_URL": "http://localhost:1234/v1"
}
}
}
}
}
Complete copy-paste command:
# 1. Install the binary (if not already done)
sudo cp code-rag-mcp /usr/local/bin/
sudo chmod +x /usr/local/bin/code-rag-mcp
# 2. Add configuration to Zed
cat << 'EOF' >> ~/.config/zed/settings.json
{
"context_servers": {
"code-rag": {
"source": "custom",
"command": {
"path": "/usr/local/bin/code-rag-mcp",
"args": [],
"env": {
"LM_STUDIO_URL": "http://localhost:1234/v1"
}
}
}
}
}
EOF
# 3. Restart Zed
Note: For Zed, you can also use the "Add Custom Server" button in the Agent Panel.
# Terminal 1: Qdrant
docker start qdrant
# Terminal 2: LM Studio
# Open LM Studio UI and start the server
# Terminal 3: Test the server
./code-rag-mcp
Claude: Hi! Let me check the index status.
[Calls: get_index_stats]
You: Index my Terraform project
Claude: [Calls: index_codebase /path/to/terraform]
You: Where is the VPC configuration?
Claude: [Calls: semantic_code_search "VPC network configuration"]
Semantic search:
"authentication middleware"
"database connection logic"
"error handling patterns"
"terraform AWS VPC modules"
"API rate limiting"
Similar code:
"Find code similar to: func (s *Server) HandleAuth()"
Explanation with context:
"Explain handlers/auth.go with related dependencies"
semantic_code_searchPrimary semantic search. Use instead of grep.
{
"query": "authentication logic",
"limit": 5,
"min_score": 0.7,
"language": "go"
}
find_similar_codeFind code similar to a given snippet.
{
"code_snippet": "func HandleError(err error) { ... }",
"limit": 5
}
explain_code_with_contextExplain a file with its context.
{
"file_path": "/path/to/file.go",
"focus": "dependencies"
}
index_codebaseIndex a directory. Run this first.
{
"path": "/Users/you/projects/myapp",
"extensions": [".go", ".py"]
}
get_index_statsCheck index status.
# Test embeddings
go run scripts/test_embeddings.go
# Test indexing
go run scripts/test_indexing.go /path/to/code
# Test searches
go run scripts/test_search.go "authentication"
nomic-ai/nomic-embed-text-v1.5-GGUF (Q8)# Check index
get_index_stats
# Re-index
index_codebase /path/to/code
# Lower minimum score
semantic_code_search "query" min_score=0.5
# Check if LM Studio is running
curl http://localhost:1234/v1/models
# Check logs
./code-rag-mcp --config config.yaml
# Restart Qdrant
docker restart qdrant
# Check logs
docker logs qdrant
Contributions are welcome! See CONTRIBUTING.md
MIT License - see LICENSE
MCP (Model Context Protocol) server for semantic code search. Replace grep/ripgrep with understanding-based code search.
ツール
ツール一覧はまだありません。リモートサーバーは、最初のヘルスチェック後に取得されます。
よくある質問
このページで Cursor、Claude Desktop、Claude Code、VS Code 用の stdio 設定をコピーできます。PlugMCP のプロキシではなく、公開元のインストール方法を使います。
このレコードに必須の環境変数は記載されていません。
Code Rag は stdio 経由でローカル実行されます。
最終チェックは 2026-10-28 です。 MCP (Model Context Protocol) server for semantic code search. Replace grep/ripgrep with understanding-based code search.