-
Notifications
You must be signed in to change notification settings - Fork 117
Description
Problem
grepai agent-setup writes instructions to CLAUDE.md, .cursorrules, .windsurfrules, GEMINI.md, and AGENTS.md that only document CLI usage (grepai search "..." --json). If the user also has the grepai MCP server configured (via .mcp.json), the agent reads these CLI-only instructions and shells out to Bash instead of using the native MCP tools (grepai_search, grepai_trace_callers, etc.).
Related: #167 (quickstart docs note that agent-setup is "not needed if you use MCP")
Suggested Fix
Update the agentInstructions const in cli/agent_setup.go to include a "Choosing Your Integration" section that lists MCP tools as preferred and CLI as fallback. Something like:
### Choosing Your Integration
grepai can be accessed two ways. **Prefer MCP tools when available**.
**MCP tools** (preferred — available if grepai MCP server is configured):
- `grepai_search` — semantic code search
- `grepai_trace_callers` — find all callers of a symbol
- `grepai_trace_callees` — find all callees of a symbol
- `grepai_trace_graph` — build complete call graph
- `grepai_index_status` — check index health
**CLI via shell** (fallback — always works if grepai is installed):
[existing CLI examples]This way agent-setup and MCP coexist gracefully — agents that have MCP access use MCP, and agents that don't have MCP fall back to CLI.
Happy to submit a PR for this.