grepai-mcp-claude
Integrate GrepAI with Claude Code via MCP. Use this skill to enable semantic code search in Claude Code.
от yoanbernabeu★ 20 звёзд на GitHub
Установить grepai-mcp-claude в Claude Code и Claude Desktop
Зарегайся, чтобы установить скилл
Создай бесплатный аккаунт, чтобы открыть команду установки и сохранить скилл в библиотеку.
- Открой команду установки в одну строку
- Сохраняй скиллы в синхронизируемую библиотеку
- Уведомления, когда скиллы обновляются
Об этом скилле
GrepAI MCP Integration with Claude Code
This skill covers integrating GrepAI with Claude Code using the Model Context Protocol (MCP).
When to Use This Skill
- Setting up GrepAI in Claude Code
- Enabling semantic search for AI coding assistant
- Configuring MCP server for Claude
- Troubleshooting Claude Code integration
What is MCP?
Model Context Protocol (MCP) allows AI assistants to use external tools. GrepAI provides an MCP server that gives Claude Code:
- Semantic code search
- Call graph analysis
- Index status monitoring
Prerequisites
- GrepAI installed
- Ollama running (or other embedding provider)
- Project indexed (
grepai watch) - Claude Code installed
Quick Setup
One command to add GrepAI to Claude Code:
claude mcp add grepai -- grepai mcp-serve
That's it! Claude Code can now use GrepAI tools.
Manual Configuration
If you prefer manual setup, add to Claude Code's MCP config:
Location
- macOS/Linux:
~/.claude/mcp.json - Windows:
%APPDATA%\Claude\mcp.json
Configuration
{
"mcpServers": {
"grepai": {
"command": "grepai",
"args": ["mcp-serve"]
}
}
}
With Working Directory
If you want GrepAI to always use a specific project:
{
"mcpServers": {
"grepai": {
"command": "grepai",
"args": ["mcp-serve"],
"cwd": "/path/to/your/project"
}
}
}
Verifying Installation
Check MCP Server
# Start MCP server manually to test
grepai mcp-serve
You should see:
GrepAI MCP Server started
Listening for requests...
In Claude Code
Ask Claude:
"Search the codebase for authentication code"
Claude should use the grepai_search tool.
Available Tools
Once connected, Claude Code has access to these tools:
| Tool | Description | Parameters |
|---|---|---|
grepai_search |
Semantic code search | query (required), limit, compact |
grepai_trace_callers |
Find function callers | symbol (required), compact |
grepai_trace_callees |
Find function callees | symbol (required), compact |
grepai_trace_graph |
Build call graph | symbol (required), depth |
grepai_index_status |
Check index health | verbose (optional) |
Tool Usage Examples
Semantic Search
Claude request:
"Find code related to user authentication"
Claude uses:
{
"tool": "grepai_search",
"parameters": {
"query": "user authentication",
"limit": 5,
"compact": true
}
}
Trace Analysis
Claude request:
"What functions call the Login function?"
Claude uses:
{
"tool": "grepai_trace_callers",
"parameters": {
"symbol": "Login",
"compact": true
}
}
Index Status
Claude request:
"Is the code index up to date?"
Claude uses:
{
"tool": "grepai_index_status",
"parameters": {
"verbose": true
}
}
Compact Mode
By default, MCP tools return compact JSON to minimize tokens:
{
"q": "authentication",
"r": [
{"s": 0.92, "f": "src/auth/middleware.go", "l": "15-45"},
{"s": 0.85, "f": "src/auth/jwt.go", "l": "23-55"}
],
"t": 2
}
This reduces token usage by ~80% compared to full content.
Working Directory
The MCP server uses the current working directory. Ensure:
- GrepAI is initialized in your project
- Index exists (run
grepai watchfirst) - Start Claude Code from your project directory
Option 1: Start Claude from Project Directory
cd /path/to/your/project
claude # Claude Code now uses this directory
Option 2: Configure CWD in MCP Config
{
"mcpServers": {
"grepai": {
"command": "grepai",
"args": ["mcp-serve"],
"cwd": "/path/to/your/project"
}
}
}
Multiple Projects
For multiple projects, you can:
Option 1: Multiple MCP Servers
{
"mcpServers": {
"grepai-frontend": {
"command": "grepai",
"args": ["mcp-serve"],
"cwd": "/path/to/frontend"
},
"grepai-backend": {
"command": "grepai",
"args": ["mcp-serve"],
"cwd": "/path/to/backend"
}
}
}
Option 2: Use Workspaces
grepai workspace create my-workspace
grepai workspace add my-workspace /path/to/frontend
grepai workspace add my-workspace /path/to/backend
{
"mcpServers": {
"grepai": {
"command": "grepai",
"args": ["mcp-serve", "--workspace", "my-workspace"]
}
}
}
Troubleshooting
Tool Not Available
❌ Problem: Claude doesn't see GrepAI tools
✅ Solutions:
- Restart Claude Code after config changes
- Check MCP config syntax (valid JSON)
- Verify
grepaiis in PATH - Test:
grepai mcp-servemanually
Search Returns No Results
❌ Problem: Searches return empty
✅ Solutions:
- Ensure
grepai watchhas run - Check working directory has
.grepai/ - Verify index exists:
grepai status
Connection Refused
❌ Problem: MCP serve
Разрешённые инструменты
Инструменты, которые скиллу разрешено вызывать.
Без ограничений — скилл может использовать любой инструмент.
FAQ
Что делает скилл grepai-mcp-claude?
Integrate GrepAI with Claude Code via MCP. Use this skill to enable semantic code search in Claude Code.
Как установить скилл grepai-mcp-claude?
Скопируй папку скилла в ~/.claude/skills (вкладка Claude Code выше делает это одной командой), либо поставь как плагин.
Скилл grepai-mcp-claude запускает скрипты?
Нет, скилл состоит только из инструкций (SKILL.md), без исполняемых скриптов.
Похожие скиллы
mcp-builder
AnthropicGuide for creating high-quality MCP (Model Context Protocol) servers that enable LLMs to interact with external services through well-designed tools. Use when…
claude-api
AnthropicReference for the Claude API / Anthropic SDK — model ids, pricing, params, streaming, tool use, MCP, agents, caching, token counting, model migration. TRIGGER…
algorithmic-art
AnthropicCreating algorithmic art using p5.js with seeded randomness and interactive parameter exploration. Use this when users request creating art using code…
mcp-integration
AnthropicThis skill should be used when the user asks to "add MCP server", "integrate MCP", "configure MCP in plugin", "use .mcp.json", "set up Model Context…