用途
GitHub Search 是一个用于搜索 GitHub 上代码、仓库、Issue 和 PR 的技能,通过 MCP(Model Context Protocol)实现。它适合以下场景:
- 跨多个仓库搜索代码
- 查找 Issue 或 PR
- 查询仓库信息
主要能力
该技能支持四种搜索类型,通过 --type 参数指定:
code:搜索代码repos:搜索仓库issues:搜索 Issueprs:搜索 PR
查询语句通过 --query 参数传入,支持 GitHub 搜索语法(例如 language:python、label:critical 等限定符)。此外还提供两个可选过滤参数:
--owner:按仓库所有者过滤--repo:按仓库名称过滤
使用方式
通过命令行运行脚本,基本调用格式如下:
uv run python -m runtime.harness scripts/mcp/github_search.py \
--type "code" \
--query "your search query"
参数说明:
--type:搜索类型,可选值为 code、repos、issues、prs--query:搜索查询,支持 GitHub 搜索语法--owner:(可选)按仓库所有者过滤--repo:(可选)按仓库名称过滤
示例一,搜索代码:
uv run python -m runtime.harness scripts/mcp/github_search.py \
--type "code" \
--query "authentication language:python"
示例二,搜索 Issue:
uv run python -m runtime.harness scripts/mcp/github_search.py \
--type "issues" \
--query "bug label:critical" \
--owner "anthropics"
依赖与限制
该技能需要 MCP 服务器支持:必须在 mcp_config.json 中配置 github 服务器,并提供 GITHUB_PERSONAL_ACCESS_TOKEN。资料中未提供其他限制、收费、价格或平台信息。