mirror of
https://github.com/wesammustafa/opencode-primer.git
synced 2026-11-18 18:04:22 +00:00
- Bump every version pin, pricing table, and model ID to the verified 2026-07-05 state (v1.17.13): Claude Fable 5 / Sonnet 5 on Zen, new free tier, deprecation sunset table, v1.17.x changelog section - Cover gaps: OpenCode Go vs Zen billing, Anthropic subscription-login removal (PR #18186), MCP resources, --mini mode, --auto flag, yolo mode - Fix correctness bugs: command-template !`cmd` syntax in docs and .opencode/commands, protect-secrets regex missing 'cat .env', dual plugin exports, quickstart PATH fix, Playwright MCP flags, ctrl+d keybind conflict, agent/command required-field claims - Fix links: cursor.com, windsurf.com, platform.claude.com, code.claude.com, opencode.ai/discord, Vercel Grep announcement - Rebrand: banner (Images/banner.svg), 1280x640 social preview asset, hero redesign with star CTA, ecosystem stats, private vulnerability reporting channel, CI-matching local checks, MD060 lint opt-out
2.7 KiB
2.7 KiB
Grep MCP (by Vercel)
Code search across public GitHub. Useful for "how do real codebases use X?" research without leaving OpenCode.
When to reach for it
- Researching idiomatic usage of an API or pattern
- Finding examples of a library you're new to
- Comparing implementations across major open-source projects
- Pre-deciding between two patterns by seeing which is more common
Setup
No API key needed for the public endpoint.
Add to opencode.json:
{
"$schema": "https://opencode.ai/config.json",
"mcp": {
"gh_grep": {
"type": "remote",
"url": "https://mcp.grep.app"
}
}
}
Restart OpenCode. Verify:
opencode mcp list
Example prompts
use gh_grep to search for "useTransition" usage in React 19 codebases.
Find the 3 most common patterns and summarize when each is used.
search github via gh_grep for examples of "drizzle-orm" with
"transaction" — show me how production codebases structure transactions
use gh_grep to find how big public Tailwind v4 projects organize their
theme tokens. Pull 3 examples I can browse.
What it can do
- Regex / literal search across public GitHub
- Filter by language, repo, file path
- Return code snippets with surrounding context
- Pagination through large result sets
What it won't do
- Search private repos (only public)
- Replace GitHub's own search for finding issues or PRs (use the GitHub MCP for those)
- Grade code quality — you'll see code that's wrong as often as code that's right
Patterns
Compare two patterns
use gh_grep to count occurrences of `useFormState` vs `useActionState`
in production React codebases (Next.js 15+). Report the ratio and the
top 5 examples for each.
Validate an approach
I'm thinking of using event sourcing for our audit log. Use gh_grep to
find production codebases doing this in TypeScript, and tell me what
patterns they share. Skip the "hello world" projects.
Gotchas
- Public only — anything behind a private repo is invisible.
- Quality varies — half of GitHub is half-finished side projects. Filter by repo popularity or maintainer when possible.
- No semantic search — it's literal/regex, not "code that does X". Be precise in your queries.
Resources
- grep.app — same backing service, web UI
- Vercel's announcement — Grep MCP launch post
⚠️ Warning:
mcp.grep.appwas intermittently unreachable when last checked (2026-07-05). Ifopencode mcp listshows the server failing to connect, that may be why — try again later.