一键导入
grepai-mcp-cursor
Integrate GrepAI with Cursor IDE via MCP. Use this skill to enable semantic code search in Cursor.
用 Codex 或 Claude 帮你安装 复制这段 Prompt,粘贴到 Codex、Claude 或其他助手里,让它检查 Skill 页面并帮你完成安装。
菜单
Integrate GrepAI with Cursor IDE via MCP. Use this skill to enable semantic code search in Cursor.
用 Codex 或 Claude 帮你安装 复制这段 Prompt,粘贴到 Codex、Claude 或其他助手里,让它检查 Skill 页面并帮你完成安装。
基于 SOC 职业分类
Reference for all GrepAI MCP tools. Use this skill to understand available MCP tools and their parameters.
Advanced search options in GrepAI. Use this skill for JSON output, compact mode, and AI agent integration.
Find function callees with GrepAI trace. Use this skill to discover what functions a specific function calls.
Find function callers with GrepAI trace. Use this skill to discover what code calls a specific function.
Build complete call graphs with GrepAI trace. Use this skill for recursive dependency analysis.
Supported programming languages in GrepAI. Use this skill to understand which languages can be indexed and traced.
| name | grepai-mcp-cursor |
| description | Integrate GrepAI with Cursor IDE via MCP. Use this skill to enable semantic code search in Cursor. |
This skill covers integrating GrepAI with Cursor IDE using the Model Context Protocol (MCP).
Cursor is an AI-powered IDE that supports MCP for external tools. GrepAI integration gives Cursor's AI:
grepai watch)Create .cursor/mcp.json in your project root:
{
"mcpServers": {
"grepai": {
"command": "grepai",
"args": ["mcp-serve"]
}
}
}
Close and reopen Cursor for the config to take effect.
Ask Cursor's AI:
"Search the codebase for authentication"
Cursor should use the grepai_search tool.
For GrepAI in all Cursor projects, use global config:
~/.cursor/mcp.json~/.cursor/mcp.json%APPDATA%\Cursor\mcp.json{
"mcpServers": {
"grepai": {
"command": "grepai",
"args": ["mcp-serve"]
}
}
}
For project-specific settings:
{
"mcpServers": {
"grepai": {
"command": "grepai",
"args": ["mcp-serve"],
"cwd": "/absolute/path/to/project"
}
}
}
Once configured, Cursor has access to:
| Tool | Description |
|---|---|
grepai_search | Semantic code search |
grepai_trace_callers | Find function callers |
grepai_trace_callees | Find function callees |
grepai_trace_graph | Build call graphs |
grepai_index_status | Check index health |
Ask Cursor:
"Find code that handles user login"
Cursor uses grepai_search to find semantically related code.
Ask Cursor:
"What functions call validateToken?"
Cursor uses grepai_trace_callers to show all callers.
Ask Cursor:
"Show me the call graph for processPayment"
Cursor uses grepai_trace_graph to display dependencies.
Cmd+, / Ctrl+,)Cmd+Shift+P / Ctrl+Shift+P)Windsurf uses the same MCP format as Cursor:
Create .windsurf/mcp.json:
{
"mcpServers": {
"grepai": {
"command": "grepai",
"args": ["mcp-serve"]
}
}
}
Each project has its own .cursor/mcp.json with appropriate cwd.
# Create workspace
grepai workspace create dev
grepai workspace add dev /path/to/project1
grepai workspace add dev /path/to/project2
{
"mcpServers": {
"grepai": {
"command": "grepai",
"args": ["mcp-serve", "--workspace", "dev"]
}
}
}
If GrepAI uses environment variables (like API keys):
{
"mcpServers": {
"grepai": {
"command": "grepai",
"args": ["mcp-serve"],
"env": {
"OPENAI_API_KEY": "sk-..."
}
}
}
}
Better: Set environment variables in your shell profile instead.
❌ Problem: Cursor doesn't see GrepAI tools
✅ Solutions:
.cursor/mcp.json in project rootgrepai is in PATH❌ Problem: Empty search results
✅ Solutions:
grepai statusgrepai watch first❌ Problem: MCP connection failed
✅ Solutions:
grepai mcp-servecurl http://localhost:11434/api/tags❌ Problem: Results from wrong project
✅ Solutions:
cwd in configgrepai_index_status to verifygrepai watch --background running| Feature | Cursor | Claude Code |
|---|---|---|
| Config location | .cursor/mcp.json | ~/.claude/mcp.json |
| Setup command | Manual JSON | claude mcp add |
| Project scope | Per-project or global | Global |
| IDE integration | Native | Terminal |
.cursor/mcp.json to git (without secrets)grepai mcp-serve works firstDelete .cursor/mcp.json and restart Cursor.
Or remove just GrepAI:
{
"mcpServers": {
// Remove grepai entry
}
}
Successful Cursor setup:
✅ GrepAI MCP Integration for Cursor
Config: .cursor/mcp.json
Server: grepai mcp-serve
Status: Ready
Available tools:
- grepai_search
- grepai_trace_callers
- grepai_trace_callees
- grepai_trace_graph
- grepai_index_status
Cursor AI can now search your code semantically!
Test: Ask Cursor "search for authentication code"