grepai-mcp-cursor by yoanbernabeu/grepai-skills
npx skills add https://github.com/yoanbernabeu/grepai-skills --skill grepai-mcp-cursor本技能涵盖使用模型上下文协议 (MCP) 将 GrepAI 与 Cursor IDE 集成。
Cursor 是一款支持 MCP 以连接外部工具的 AI 驱动 IDE。GrepAI 集成赋予 Cursor AI 以下能力:
grepai watch)在项目根目录创建 .cursor/mcp.json:
{
"mcpServers": {
"grepai": {
"command": "grepai",
"args": ["mcp-serve"]
}
}
}
关闭并重新打开 Cursor 以使配置生效。
广告位招租
在这里展示您的产品或服务
触达数万 AI 开发者,精准高效
询问 Cursor 的 AI:
"Search the codebase for authentication"
Cursor 应使用 grepai_search 工具。
要在所有 Cursor 项目中使用 GrepAI,请使用全局配置:
~/.cursor/mcp.json~/.cursor/mcp.json%APPDATA%\Cursor\mcp.json{
"mcpServers": {
"grepai": {
"command": "grepai",
"args": ["mcp-serve"]
}
}
}
针对特定项目的设置:
{
"mcpServers": {
"grepai": {
"command": "grepai",
"args": ["mcp-serve"],
"cwd": "/absolute/path/to/project"
}
}
}
配置完成后,Cursor 可以访问以下工具:
| 工具 | 描述 |
|---|---|
grepai_search | 语义代码搜索 |
grepai_trace_callers | 查找函数调用者 |
grepai_trace_callees | 查找函数被调用者 |
grepai_trace_graph | 构建调用图 |
grepai_index_status | 检查索引状态 |
询问 Cursor:
"Find code that handles user login"
Cursor 使用 grepai_search 查找语义相关的代码。
询问 Cursor:
"What functions call validateToken?"
Cursor 使用 grepai_trace_callers 显示所有调用者。
询问 Cursor:
"Show me the call graph for processPayment"
Cursor 使用 grepai_trace_graph 显示依赖关系。
Cmd+, / Ctrl+,)Cmd+Shift+P / Ctrl+Shift+P)Windsurf 使用与 Cursor 相同的 MCP 格式:
创建 .windsurf/mcp.json:
{
"mcpServers": {
"grepai": {
"command": "grepai",
"args": ["mcp-serve"]
}
}
}
每个项目都有自己的 .cursor/mcp.json,并配置适当的 cwd。
# 创建工作区
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"]
}
}
}
如果 GrepAI 使用环境变量(如 API 密钥):
{
"mcpServers": {
"grepai": {
"command": "grepai",
"args": ["mcp-serve"],
"env": {
"OPENAI_API_KEY": "sk-..."
}
}
}
}
更好的做法: 在您的 shell 配置文件中设置环境变量。
❌ 问题: Cursor 看不到 GrepAI 工具
✅ 解决方案:
.cursor/mcp.jsongrepai 是否在 PATH 中❌ 问题: 搜索结果为空
✅ 解决方案:
grepai statusgrepai watch❌ 问题: MCP 连接失败
✅ 解决方案:
grepai mcp-servecurl http://localhost:11434/api/tags❌ 问题: 结果来自错误项目
✅ 解决方案:
cwdgrepai_index_status 进行验证grepai watch --background 运行| 功能 | Cursor | Claude Code |
|---|---|---|
| 配置位置 | .cursor/mcp.json | ~/.claude/mcp.json |
| 设置命令 | 手动 JSON | claude mcp add |
| 项目范围 | 按项目或全局 | 全局 |
| IDE 集成 | 原生 | 终端 |
.cursor/mcp.json 添加到 git(不包含密钥)grepai mcp-serve 是否正常工作删除 .cursor/mcp.json 并重启 Cursor。
或者仅移除 GrepAI:
{
"mcpServers": {
// Remove grepai entry
}
}
成功的 Cursor 设置:
✅ 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"
每周安装次数
217
仓库
GitHub 星标数
15
首次出现
2026 年 1 月 28 日
安全审计
安装于
opencode175
codex172
github-copilot158
gemini-cli157
cursor157
kimi-cli148
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"
Weekly Installs
217
Repository
GitHub Stars
15
First Seen
Jan 28, 2026
Security Audits
Gen Agent Trust HubPassSocketPassSnykFail
Installed on
opencode175
codex172
github-copilot158
gemini-cli157
cursor157
kimi-cli148
agent-browser 浏览器自动化工具 - Vercel Labs 命令行网页操作与测试
144,300 周安装