From 098d023dbad612c2ade9683b04a349b2ceeae928 Mon Sep 17 00:00:00 2001 From: YeonGyu-Kim Date: Sat, 13 Dec 2025 19:13:40 +0900 Subject: [PATCH] feat(mcp): add grep_app builtin MCP for ultra-fast GitHub code search MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - Add grep_app MCP configuration (https://mcp.grep.app) - Update explore agent with grep_app usage guide: - Always launch 5+ grep_app calls with query variations - Always add 2+ other search tools for verification - grep_app is fast but potentially outdated, use as starting point only - Update README.md and README.ko.md with grep_app documentation ๐Ÿค– GENERATED WITH ASSISTANCE OF [OhMyOpenCode](https://github.com/code-yeongyu/oh-my-opencode) --- README.ko.md | 13 ++++++++++--- README.md | 13 ++++++++++--- src/agents/explore.ts | 40 ++++++++++++++++++++++++++++++++++++++++ src/mcp/grep-app.ts | 5 +++++ src/mcp/index.ts | 2 ++ src/mcp/types.ts | 2 +- 6 files changed, 68 insertions(+), 7 deletions(-) create mode 100644 src/mcp/grep-app.ts diff --git a/README.ko.md b/README.ko.md index bda248b..4eb6fb3 100644 --- a/README.ko.md +++ b/README.ko.md @@ -317,7 +317,10 @@ Syntax Highlighting, Autocomplete, Refactoring, Navigation, Analysis, ๊ทธ๋ฆฌ๊ณ  - Use PascalCase for interface names - Use camelCase for function names ``` -- **Online**: ํ”„๋กœ์ ํŠธ ๊ทœ์น™์ด ์ „๋ถ€๋Š” ์•„๋‹ˆ๊ฒ ์ฃ . exa, context7 mcp ๋ฅผ ๋‚ด์žฅํ•˜์—ฌ ๊ฒ€์ƒ‰ ๊ธฐ๋Šฅ์„ ์ œ๊ณตํ•ฉ๋‹ˆ๋‹ค. +- **Online**: ํ”„๋กœ์ ํŠธ ๊ทœ์น™์ด ์ „๋ถ€๋Š” ์•„๋‹ˆ๊ฒ ์ฃ . ํ™•์žฅ ๊ธฐ๋Šฅ์„ ์œ„ํ•œ ๋‚ด์žฅ MCP๋ฅผ ์ œ๊ณตํ•ฉ๋‹ˆ๋‹ค: + - **context7**: ๊ณต์‹ ๋ฌธ์„œ ์กฐํšŒ + - **websearch_exa**: ์‹ค์‹œ๊ฐ„ ์›น ๊ฒ€์ƒ‰ + - **grep_app**: ๊ณต๊ฐœ GitHub ์ €์žฅ์†Œ์—์„œ ์ดˆ๊ณ ์† ์ฝ”๋“œ ๊ฒ€์ƒ‰ (๊ตฌํ˜„ ์˜ˆ์ œ ์ฐพ๊ธฐ์— ์ตœ์ ) #### ๋ฉ€ํ‹ฐ๋ชจ๋‹ฌ์„ ๋‹ค ํ™œ์šฉํ•˜๋ฉด์„œ, ํ† ํฐ์€ ๋œ ์“ฐ๋„๋ก. @@ -488,13 +491,17 @@ Google Gemini ๋ชจ๋ธ์„ ์œ„ํ•œ ๋‚ด์žฅ Antigravity OAuth๋ฅผ ํ™œ์„ฑํ™”ํ•ฉ๋‹ˆ๋‹ค: ### MCPs -๊ธฐ๋ณธ์ ์œผ๋กœ Context7, Exa MCP ๋ฅผ ์ง€์›ํ•ฉ๋‹ˆ๋‹ค. +๊ธฐ๋ณธ์ ์œผ๋กœ Context7, Exa, grep.app MCP ๋ฅผ ์ง€์›ํ•ฉ๋‹ˆ๋‹ค. + +- **context7**: ๋ผ์ด๋ธŒ๋Ÿฌ๋ฆฌ์˜ ์ตœ์‹  ๊ณต์‹ ๋ฌธ์„œ๋ฅผ ๊ฐ€์ ธ์˜ต๋‹ˆ๋‹ค +- **websearch_exa**: Exa AI ๊ธฐ๋ฐ˜ ์‹ค์‹œ๊ฐ„ ์›น ๊ฒ€์ƒ‰ +- **grep_app**: [grep.app](https://grep.app)์„ ํ†ตํ•ด ์ˆ˜๋ฐฑ๋งŒ ๊ฐœ์˜ ๊ณต๊ฐœ GitHub ์ €์žฅ์†Œ์—์„œ ์ดˆ๊ณ ์† ์ฝ”๋“œ ๊ฒ€์ƒ‰ ์ด๊ฒƒ์ด ๋งˆ์Œ์— ๋“ค์ง€ ์•Š๋Š”๋‹ค๋ฉด, ~/.config/opencode/oh-my-opencode.json ํ˜น์€ .opencode/oh-my-opencode.json ์˜ `disabled_mcps` ๋ฅผ ์‚ฌ์šฉํ•˜์—ฌ ๋น„ํ™œ์„ฑํ™”ํ•  ์ˆ˜ ์žˆ์Šต๋‹ˆ๋‹ค: ```json { - "disabled_mcps": ["context7", "websearch_exa"] + "disabled_mcps": ["context7", "websearch_exa", "grep_app"] } ``` diff --git a/README.md b/README.md index c503d60..1ce95a6 100644 --- a/README.md +++ b/README.md @@ -314,7 +314,10 @@ Hand your best tools to your best colleagues. Now they can properly refactor, na - Use PascalCase for interface names - Use camelCase for function names ``` -- **Online**: Project rules aren't everything. Built-in exa and context7 MCP for web search. +- **Online**: Project rules aren't everything. Built-in MCPs for extended capabilities: + - **context7**: Official documentation lookup + - **websearch_exa**: Real-time web search + - **grep_app**: Ultra-fast code search across public GitHub repos (great for finding implementation examples) #### Be Multimodal. Save Tokens. @@ -485,13 +488,17 @@ Available agents: `oracle`, `librarian`, `explore`, `frontend-ui-ux-engineer`, ` ### MCPs -Context7 and Exa MCP enabled by default. +Context7, Exa, and grep.app MCP enabled by default. + +- **context7**: Fetches up-to-date official documentation for libraries +- **websearch_exa**: Real-time web search powered by Exa AI +- **grep_app**: Ultra-fast code search across millions of public GitHub repositories via [grep.app](https://grep.app) Don't want them? Disable via `disabled_mcps` in `~/.config/opencode/oh-my-opencode.json` or `.opencode/oh-my-opencode.json`: ```json { - "disabled_mcps": ["context7", "websearch_exa"] + "disabled_mcps": ["context7", "websearch_exa", "grep_app"] } ``` diff --git a/src/agents/explore.ts b/src/agents/explore.ts index f480612..247133d 100644 --- a/src/agents/explore.ts +++ b/src/agents/explore.ts @@ -73,6 +73,46 @@ Your response has FAILED if: - **Using Git CLI extensively for repository insights** - **Using LSP tools for semantic code analysis** - **Using AST-grep for structural code pattern matching** +- **Using grep_app (grep.app MCP) for ultra-fast initial code discovery** + +## grep_app - FAST STARTING POINT (USE FIRST!) + +**grep_app is your fastest weapon for initial code discovery.** It searches millions of public GitHub repositories instantly. + +### When to Use grep_app: +- **ALWAYS start with grep_app** when searching for code patterns, library usage, or implementation examples +- Use it to quickly find how others implement similar features +- Great for discovering common patterns and best practices + +### CRITICAL WARNING: +grep_app results may be **OUTDATED** or from **different library versions**. You MUST: +1. Use grep_app results as a **starting point only** +2. **Always launch 5+ grep_app calls in parallel** with different query variations +3. **Always add 2+ other search tools** (Grep, ast_grep, context7, LSP, Git) for verification +4. Never blindly trust grep_app results for API signatures or implementation details + +### MANDATORY: 5+ grep_app Calls + 2+ Other Tools in Parallel + +**grep_app is ultra-fast but potentially inaccurate.** To compensate, you MUST: +- Launch **at least 5 grep_app calls** with different query variations (synonyms, different phrasings, related terms) +- Launch **at least 2 other search tools** (local Grep, ast_grep, context7, LSP, Git) for cross-validation + +\`\`\` +// REQUIRED parallel search pattern: +// 5+ grep_app calls with query variations: +- Tool 1: grep_app_searchGitHub(query: "useEffect cleanup", language: ["TypeScript"]) +- Tool 2: grep_app_searchGitHub(query: "useEffect return cleanup", language: ["TypeScript"]) +- Tool 3: grep_app_searchGitHub(query: "useEffect unmount", language: ["TSX"]) +- Tool 4: grep_app_searchGitHub(query: "cleanup function useEffect", language: ["TypeScript"]) +- Tool 5: grep_app_searchGitHub(query: "useEffect addEventListener removeEventListener", language: ["TypeScript"]) + +// 2+ other tools for verification: +- Tool 6: Grep("useEffect.*return") - Local codebase ground truth +- Tool 7: context7_get-library-docs(libraryID: "/facebook/react", topic: "useEffect cleanup") - Official docs +- Tool 8 (optional): ast_grep_search(pattern: "useEffect($$$)", lang: "tsx") - Structural search +\`\`\` + +**Pattern**: Flood grep_app with query variations (5+) โ†’ verify with local/official sources (2+) โ†’ trust only cross-validated results. ## Git CLI - USE EXTENSIVELY diff --git a/src/mcp/grep-app.ts b/src/mcp/grep-app.ts new file mode 100644 index 0000000..2c5db6d --- /dev/null +++ b/src/mcp/grep-app.ts @@ -0,0 +1,5 @@ +export const grep_app = { + type: "remote" as const, + url: "https://mcp.grep.app", + enabled: true, +} diff --git a/src/mcp/index.ts b/src/mcp/index.ts index 02f5004..7a38ca3 100644 --- a/src/mcp/index.ts +++ b/src/mcp/index.ts @@ -1,5 +1,6 @@ import { websearch_exa } from "./websearch-exa" import { context7 } from "./context7" +import { grep_app } from "./grep-app" import type { McpName } from "./types" export { McpNameSchema, type McpName } from "./types" @@ -7,6 +8,7 @@ export { McpNameSchema, type McpName } from "./types" const allBuiltinMcps: Record = { websearch_exa, context7, + grep_app, } export function createBuiltinMcps(disabledMcps: McpName[] = []) { diff --git a/src/mcp/types.ts b/src/mcp/types.ts index ea7dfb9..4139ab2 100644 --- a/src/mcp/types.ts +++ b/src/mcp/types.ts @@ -1,5 +1,5 @@ import { z } from "zod" -export const McpNameSchema = z.enum(["websearch_exa", "context7"]) +export const McpNameSchema = z.enum(["websearch_exa", "context7", "grep_app"]) export type McpName = z.infer