mcp-grep-code
Search real-world code examples from over a million public GitHub repositories. Use when finding code patterns, implementation examples, or how libraries are used in practice. Triggers on "find code examples", "how is [library] used", "search GitHub code", "grep.app search", "code pattern".
安装与使用
请根据来源仓库和你的 AI 工具说明安装此技能。先阅读技能文件和依赖要求,再添加到工作流。
查看来源 ↗使用指南技能说明
Grep.app Code Search
MCP service at https://mcp.grep.app (http) with 1 tool.
Requirements
-
mhCLI must be installed. If not available, install with:curl -fsSL https://raw.githubusercontent.com/vaayne/mcphub/main/scripts/install.sh | sh
Usage
List tools: mh -u https://mcp.grep.app -t http list
Get tool details: mh -u https://mcp.grep.app -t http inspect searchGitHub
Invoke tool: mh -u https://mcp.grep.app -t http invoke searchGitHub '{"query": "pattern"}'
Notes
- Run
inspectbefore invoking unfamiliar tools to get full parameter schema - Timeout: 30s default, use
--timeout <seconds>to adjust - Important: This searches for literal code patterns (like grep), NOT keywords
- Use actual code that would appear in files, not descriptions
Tools
| Tool | Description |
|---|---|
searchGitHub |
Find real-world code examples from public GitHub repositories. Searches for literal code patterns across millions of repos. |
Search Tips
Good queries (literal code patterns):
-
useState( -
import React from -
async function -
(?s)try {.*await
Bad queries (keywords - won't work well):
-
react state management -
how to use hooks
Examples
# Find useState usage patterns
mh -u https://mcp.grep.app -t http invoke searchGitHub '{"query": "useState("}'
# Find async/await patterns
mh -u https://mcp.grep.app -t http invoke searchGitHub '{"query": "async function fetch"}'
# Find import patterns
mh -u https://mcp.grep.app -t http invoke searchGitHub '{"query": "from \"openai\""}'
使用示例
查看来源仓库中的使用示例与配置说明。
查看来源 ↗来源历史
- 收录时间
- 2026-03-11
- 索引更新时间
- 2026-03-11
- Branch
- main
收录与同步日期属于本站记录。源码修改历史请查看来源仓库。
GitHub ↗chat Comments (0)
Sign in to join the discussion and leave a comment.
No comments yet. Be the first to share your thoughts!