CodeGrok MCP
Semantic Code Search for AI Assistants
Give your AI assistant the power to truly understand your codebase
Agenten stärken
Installation vom Herausgeber. Kein PlugMCP-Endpunkt.
Host a copy with our keys and logs.
Noch kein paketiertes Release in der Registry. Folgen Sie der README des Repositorys.
Remote-URL oder ein Befehl auf Ihrem Rechner? Worin sich die beiden Installationen unterscheiden
Auf PlugMCP ausführen
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.
StartenVom Herausgeber
CodeGrok MCP is a Model Context Protocol (MCP) server that enables AI assistants to intelligently search and understand codebases using semantic embeddings and Tree-sitter parsing.
Unlike simple text search, CodeGrok understands code structure - it knows what functions, classes, and methods are, and can find relevant code even when you describe it in natural language.
You: "Where is authentication handled?"
CodeGrok: Returns auth middleware, login handlers, JWT validation code...
The Problem: AI assistants have limited context windows. Sending your entire codebase is expensive and often impossible.
The Solution: CodeGrok indexes your code once, then AI can query semantically and receive only the 5-10 most relevant code snippets—10-100x token reduction vs naive "read all files" approaches.
.jsx, .tsx, .mjs, .hpp, etc..codegrok/ folderImportant: Understanding limitations helps you use the tool effectively.
# Clone the repository
git clone https://github.com/rdondeti/CodeGrok_mcp.git
cd CodeGrok_mcp
# Option 1: Use setup script (recommended)
./setup.sh # Linux/macOS
# or
.\setup.ps1 # Windows PowerShell
# Option 2: Manual install
python -m venv .venv
source .venv/bin/activate # Linux/macOS
pip install -e .
# Verify installation
codegrok-mcp --help
Setup script options:
Once integrated with your AI tool (see below), ask your assistant:
"Learn my codebase at /path/to/my/project"
Then search:
"Find how API endpoints are defined"
"Where is error handling implemented?"
"Show me the database models"
How CodeGrok Saves Tokens:
Without CodeGrok:
AI tries to read entire codebase → exceeds context window → fails or costs $$
With CodeGrok:
AI: "I need to add a new route"
↓ calls get_sources("Express route definition")
CodeGrok: Returns routes/api.js:15, routes/auth.js:8
↓ AI reads only those 2 files
Result: 10-100x fewer tokens, faster responses
Step 1: "Learn my codebase at ~/projects/big-app"
Step 2: "Where is the main entry point?"
Step 3: "How is authentication implemented?"
Step 4: "Find the database connection logic"
Step 5: "Show me how API errors are handled"
"Find all functions that handle user input"
"Where is validation performed?"
"Show me error handling patterns"
The easiest way to add CodeGrok to Claude Code:
# Add the MCP server
claude mcp add codegrok-mcp -- codegrok-mcp
Or manually add to your settings (~/.claude/settings.json):
{
"mcpServers": {
"codegrok": {
"command": "codegrok-mcp"
}
}
}
Usage in Claude Code:
> learn my codebase at ./my-project
> find authentication logic
> where is the main entry point?
Add to your Claude Desktop configuration:
{
"mcpServers": {
"codegrok": {
"command": "codegrok-mcp",
"args": []
}
}
}
Restart Claude Desktop after saving.
Cursor supports MCP servers through its extension system:
{
"codegrok": {
"command": "codegrok-mcp",
"transport": "stdio"
}
}
Or add to .cursor/mcp.json in your project:
{
"servers": {
"codegrok": {
"command": "codegrok-mcp"
}
}
}
Windsurf supports MCP through Cascade:
{
"codegrok": {
"command": "codegrok-mcp",
"transport": "stdio"
}
}
Add to Cline's MCP settings in VS Code:
Ctrl+Shift+P / Cmd+Shift+P){
"mcpServers": {
"codegrok": {
"command": "codegrok-mcp"
}
}
}
Zed supports MCP through its assistant panel. Add to settings:
{
"assistant": {
"mcp_servers": {
"codegrok": {
"command": "codegrok-mcp"
}
}
}
}
Add to your Continue configuration (~/.continue/config.json):
{
"mcpServers": [
{
"name": "codegrok",
"command": "codegrok-mcp"
}
]
}
For any MCP-compatible client, use stdio transport:
# Command to run
codegrok-mcp
# Transport
stdio (stdin/stdout)
# Protocol
Model Context Protocol (MCP)
CodeGrok provides 4 tools for AI assistants:
Learn modes:
auto (default): Smart detection - incremental reindex if exists, full index if newfull: Force complete re-index (destroys existing index)load_only: Just load existing index without any indexing{
"tool": "learn",
"arguments": {
"path": "/home/user/my-project",
"mode": "auto"
}
}
Response:
{
"success": true,
"message": "Indexed 150 files with 1,247 symbols",
"stats": {
"total_files": 150,
"total_symbols": 1247,
"total_chunks": 2834,
"indexing_time": 12.5
}
}
{
"tool": "get_sources",
"arguments": {
"question": "How is user authentication implemented?",
"n_results": 5
}
}
Response:
{
"sources": [
{
"file": "src/auth/middleware.py",
"symbol": "authenticate_request",
"type": "function",
"line": 45,
"content": "def authenticate_request(request):\n ...",
"score": 0.89
}
]
}
{
"tool": "learn",
"arguments": {
"path": "/home/user/my-project",
"mode": "auto"
}
}
Response (when index exists):
{
"success": true,
"mode_used": "incremental",
"files_added": 2,
"files_modified": 5,
"files_deleted": 1
}
Total: 9 languages, 28 file extensions
┌─────────────────────────────────────────────────────────────┐
│ MCP Client │
│ (Claude, Cursor, Cline, etc.) │
└─────────────────────────┬───────────────────────────────────┘
│ MCP Protocol (stdio)
▼
┌─────────────────────────────────────────────────────────────┐
│ CodeGrok MCP Server │
├─────────────────────────────────────────────────────────────┤
│ ┌─────────────┐ ┌─────────────┐ ┌─────────────────────┐ │
│ │ Parsers │ │ Embeddings │ │ Vector Storage │ │
│ │ (Tree-sitter)│ │ (Sentence │ │ (ChromaDB) │ │
│ │ │ │ Transformers)│ │ │ │
│ └─────────────┘ └─────────────┘ └─────────────────────┘ │
└─────────────────────────────────────────────────────────────┘
Source Files → Tree-sitter Parser → Symbol Extraction →
Code Chunks → Embeddings → ChromaDB Storage
.codegrok/Query → Embedding → Vector Similarity → Ranked Results
All data is stored locally in your project:
your-project/
└── .codegrok/
├── chroma/ # Vector database
└── metadata.json # Index metadata (stats, file mtimes)
The default model (nomic-ai/CodeRankEmbed) is optimized for code retrieval with:
trust_remote_codeThe default embedding model (nomic-ai/CodeRankEmbed) requires trust_remote_code=True when loading via SentenceTransformers. This flag allows execution of custom Python code bundled with the model.
Why it's required:
modeling_hf_nomic_bert.py (model architecture), configuration_hf_nomic_bert.py (config)Security audit: The custom code has been reviewed and contains:
exec(), eval(), or dynamic code executionFor maximum security:
microsoft/codebert-base) as an alternative that doesn't require trust_remote_code (with potential quality trade-offs)# Clone
git clone https://github.com/rdondeti/CodeGrok_mcp.git
cd CodeGrok_mcp
# Run setup script
./setup.sh # Linux/macOS (includes dev dependencies)
.\setup.ps1 # Windows PowerShell
# For clean reinstall:
./setup.sh --clean
# Run all tests
pytest
# Run with coverage
pytest --cov=src/codegrok_mcp --cov-report=term-missing
# Run specific test categories
pytest tests/unit/ -v # Fast unit tests
pytest tests/integration/ -v # Integration tests (uses real embeddings)
pytest tests/mcp/ -v # MCP protocol simulation tests
# Format code
black src/
# Type checking
mypy src/
# Linting
flake8 src/
# Check installation
pip show codegrok-mcp
# Check Python version (need 3.10+)
python --version
# Reinstall
pip install -e .
learn again after first index for incremental updates (auto mode)coderankembed model uses ~500MB-2GB RAMUse learn tool first:
"Learn my codebase at /path/to/project"
Contributions are welcome! Please:
git checkout -b feature/amazing)pytest)black src/)MIT License - see LICENSE for details.
Made with ❤️ for developers who want AI that truly understands their code
CodeGrok MCP is a Model Context Protocol (MCP) server that enables AI assistants to intelligently search and understand codebases using semantic embeddings and Tree-sitter parsing.
Tools
Noch keine Tool-Liste. Remote-Server erhalten eine nach dem ersten Health-Check.
FAQ
Kopieren Sie auf dieser Seite die stdio-Konfiguration für Cursor, Claude Desktop, Claude Code oder VS Code. Sie nutzt die Installation des Herausgebers, keinen PlugMCP-Proxy.
In diesem Eintrag ist keine erforderliche Umgebungsvariable aufgeführt.
CodeGrok läuft lokal über stdio.
Zuletzt geprüft: 2026-10-28. CodeGrok MCP is a Model Context Protocol (MCP) server that enables AI assistants to intelligently search and understand codebases using semantic embeddings and Tree-sitter parsing.