GrepAI
This server does not currently have a deployable release on Glama. Follow the repository's setup instructions to install and configure it for your MCP client, including any required credentials and local dependencies.
π GrepAI
Local AI-Powered Codebase Search MCP Server
GrepAI is a self-hosted Model Context Protocol (MCP) server that provides powerful codebase search and analysis capabilities. It runs entirely on your local machine, utilizing your NVIDIA GPU (via llama.cpp or vLLM) for AI-powered features.
Works with Claude Code, VS Code, and any MCP-compatible client.
β‘ Quick Start (One-Command Installation)
curl -fsSL https://raw.githubusercontent.com/vp2722/grepai/main/scripts/remote-install.sh | bashOr clone and install manually:
git clone https://github.com/vp2722/grepai.git
cd grepai
./scripts/install.shRelated MCP server: agentmako
π Complete End-to-End Setup Guide
Step 1: System Requirements
Minimum:
Python 3.8+
8GB RAM
10GB disk space
Recommended (GPU):
Python 3.10+
NVIDIA GPU with 8GB+ VRAM
CUDA 11.8+ or 12.x
16GB RAM
Check your system:
# Check Python version
python3 --version
# Check for NVIDIA GPU
nvidia-smi
# Check CUDA version
nvcc --versionStep 2: Clone the Repository
git clone https://github.com/vp2722/grepai.git
cd grepaiStep 3: Install Dependencies
# Install Python dependencies
pip install mcp fastapi uvicorn pydantic pyyaml aiofiles httpx
# Optional: Install LLM backend (choose one)
# For llama.cpp with CUDA support:
CMAKE_ARGS="-DLLAMA_CUBLAS=on" pip install llama-cpp-python
# For vLLM (requires NVIDIA GPU with 16GB+ VRAM):
pip install vllmStep 4: Configure Claude Code MCP Settings
Create or edit ~/.claude/settings.json:
{
"mcpServers": {
"grepai": {
"command": "/path/to/grepai/grepai-mcp",
"args": [],
"env": {
"GREPAI_WORKSPACE": "/path/to/your/project"
}
}
}
}Example for your home directory:
{
"mcpServers": {
"grepai": {
"command": "/home/YOUR_USERNAME/grepai/grepai-mcp",
"args": [],
"env": {
"GREPAI_WORKSPACE": "/home/YOUR_USERNAME/your-project"
}
}
}
}Step 5: Test the MCP Server
# Test the server starts correctly
cd /path/to/grepai
echo '{"jsonrpc": "2.0", "method": "initialize", "params": {"protocolVersion": "2024-11-05", "capabilities": {}, "clientInfo": {"name": "test", "version": "1.0.0"}}, "id": 1}' | python3 grepai-mcpYou should see a JSON response with "result" containing server info.
Step 6: Restart Claude Code
After configuring the MCP settings, restart Claude Code:
# Close and reopen Claude Code
claudeThe GrepAI tools will now be available!
π οΈ Available MCP Tools
Tool | Description | Example Use |
| Search for patterns (text/regex) across all files | Find all TODO comments |
| Read file contents with line numbers | View a specific file |
| List files with glob pattern support | Find all Python files |
| Get file metadata (size, modified date) | Check file details |
| Find function/class/variable definitions | Locate function source |
| Find all usages of a symbol | Track where a function is called |
| Get directory tree structure | Understand project layout |
| Extract file structure (imports, classes, functions) | Analyze file contents |
| Preview search/replace operations | Plan refactoring |
| Get workspace statistics | Project overview |
π§ Configuration
Environment Variables
Variable | Default | Description |
| Current directory | Root directory for searches |
| 10MB | Maximum file size to search |
| 100 | Maximum search results |
Configuration File
Edit config/default.yaml to customize:
workspace:
root: "."
max_file_size: 10485760 # 10MB
max_results: 100
ignore:
directories:
- .git
- node_modules
- __pycache__
- .venv
llm:
backend: auto # auto, llama_cpp, vllm
model:
path: "models/model.gguf"
context_size: 4096
gpu_layers: -1 # -1 for all layers on GPUπ³ Docker Setup
Quick Start with Docker
cd grepai/docker
# Set your workspace path
export WORKSPACE_PATH=/path/to/your/project
# Build and run
docker-compose up -dDocker with GPU Support
Requires NVIDIA Container Toolkit:
# Install nvidia-container-toolkit (Ubuntu/Debian)
curl -fsSL https://nvidia.github.io/libnvidia-container/gpgkey | sudo gpg --dearmor -o /usr/share/keyrings/nvidia-container-toolkit-keyring.gpg
curl -s -L https://nvidia.github.io/libnvidia-container/stable/deb/nvidia-container-toolkit.list | \
sed 's#deb https://#deb [signed-by=/usr/share/keyrings/nvidia-container-toolkit-keyring.gpg] https://#g' | \
sudo tee /etc/apt/sources.list.d/nvidia-container-toolkit.list
sudo apt-get update && sudo apt-get install -y nvidia-container-toolkit
sudo nvidia-ctk runtime configure --runtime=docker
sudo systemctl restart docker
# Run with GPU
docker-compose up -dπ Remote Access (Cloudflare Tunnel)
Securely expose your local GrepAI server to the internet:
# Run the tunnel setup
./scripts/setup-tunnel.sh
# Start the tunnel
./scripts/setup-tunnel.sh startThis creates a secure tunnel with:
End-to-end encryption
DDoS protection
No port forwarding required
π€ Using with Local LLM
Download a Model
# Create models directory
mkdir -p models
# Download Mistral 7B (recommended, ~4.4GB)
wget -O models/model.gguf https://huggingface.co/TheBloke/Mistral-7B-Instruct-v0.2-GGUF/resolve/main/mistral-7b-instruct-v0.2.Q4_K_M.ggufStart the LLM API Server
python3 src/llm_backend.py --model models/model.gguf --host 127.0.0.1 --port 8000Use with OpenAI-Compatible Clients
from openai import OpenAI
client = OpenAI(
base_url="http://localhost:8000/v1",
api_key="not-needed"
)
response = client.chat.completions.create(
model="local-model",
messages=[{"role": "user", "content": "Hello!"}]
)
print(response.choices[0].message.content)π Project Structure
grepai/
βββ src/
β βββ mcp_server.py # Core MCP server (stdio)
β βββ mcp_http_server.py # MCP server (HTTP)
β βββ llm_backend.py # LLM integration
β βββ cli.py # Command-line interface
βββ config/
β βββ default.yaml # Configuration
βββ docker/
β βββ Dockerfile # Docker image
β βββ docker-compose.yml # Docker Compose
βββ scripts/
β βββ install.sh # Installation script
β βββ remote-install.sh # One-line installer
β βββ setup-tunnel.sh # Cloudflare tunnel
β βββ uninstall.sh # Uninstaller
βββ models/ # Model storage
βββ tests/ # Unit tests
βββ grepai-mcp # Main launcher
βββ requirements.txt # Dependencies
βββ README.md # This fileπ§ͺ Running Tests
pip install pytest pytest-asyncio
pytest tests/ -vβ Troubleshooting
MCP Server Not Starting
# Check if dependencies are installed
pip list | grep mcp
# Test manually
cd /path/to/grepai
python3 -c "from src.mcp_server import server; print('OK')"GPU Not Detected
# Check NVIDIA driver
nvidia-smi
# Reinstall llama-cpp-python with CUDA
CMAKE_ARGS="-DLLAMA_CUBLAS=on" pip install llama-cpp-python --force-reinstallClaude Code Not Finding Tools
Verify
~/.claude/settings.jsonexists and is valid JSONCheck the path to
grepai-mcpis correctRestart Claude Code completely
ποΈ Uninstallation
./scripts/uninstall.shOr manually:
rm -rf ~/.grepai
rm ~/.claude/settings.json # Or edit to remove grepai entryπ License
MIT License - See LICENSE for details.
π Acknowledgments
MCP Protocol by Anthropic
llama.cpp by Georgi Gerganov
vLLM by vLLM Team
Made with β€οΈ for the AI developer community
Tool Schema Changelog
Recent tool additions, removals, and schema changes observed during successful MCP inspections.
Loading tool schema changelogβ¦
This server cannot be deployed
Maintenance
Related MCP Connectors
Shared memory MCP server for Claude Code, Codex, Gemini CLI and Cursor. Cited, editable.
Code intelligence for coding agents: semantic, AST, graph, and full-text search. 279+ languages.
Self-hosted AI workspace: semantic RAG document search, long-term memory, and AI chat via MCP.
Code intelligence for LLMs. Analyze, search, and retrieve code from any public git repository.
Related MCP Servers
- AlicenseAqualityBmaintenanceNexus-MCP is a local MCP server for coding agents. Hybrid code search and a call graph for 10 languages give the agent the right code in one call, so it reads less. No API key, no telemetry, MIT. * 95% fewer tokens to reach the right file * About 9Γ faster search than Grep and Read * Live Claude Code runs on 11 repos: cost per task lower on 8 of 115175 PyPIMIT
- AlicenseCqualityCmaintenanceLocal-first codebase intelligence engine providing AI coding agents with a typed MCP toolset for understanding and navigating code repositories.10054Apache 2.0
- AlicenseNot gradedqualityCmaintenanceLocal repository intelligence MCP server that builds a reusable graph of code structure for AI coding agents, providing 34 network-free tools for understanding, searching, and analyzing repositories without data leaving the machine.MIT
- AlicenseNot gradedqualityBmaintenanceLocal-first code intelligence MCP server that enables coding agents to search code, inspect structure, read exact ranges, and explore Git history with explicit token budgets.171Apache 2.0