
MCP Private GitHub Search

2025.05.01
0
TypeScriptGitHub 搜索开发工具搜索工具开发效率
MCP Private GitHub Search 是一个基于 Model Context Protocol (MCP) 的服务,专门用于搜索私有 GitHub 仓库。该服务提供了与 GitHub API 的无缝集成,自动处理速率限制、类型安全和错误处理。
View on GitHub
Overview
基本能力
产品定位
MCP Private GitHub Search 是一个专门用于搜索私有 GitHub 仓库的工具,旨在为开发者提供高效、安全的仓库搜索功能。
核心功能
- GitHub 仓库搜索:搜索私有 GitHub 仓库(需要具有访问权限的 GitHub token)
- 类型安全实现:使用 TypeScript 编写,具有全面的类型定义
- 输入验证:使用 Zod 模式对所有 API 输入进行健壮的验证
- 错误处理:优雅的错误处理,提供信息丰富的错误消息
适用场景
- 开发者需要快速搜索私有 GitHub 仓库中的文件或问题
- 团队需要集成 GitHub 仓库搜索功能到其开发流程中
- 需要类型安全和健壮错误处理的 GitHub API 调用
工具列表
- searchFiles:根据各种条件搜索仓库中的文件
- searchIssues:根据各种条件搜索仓库中的问题
- getFileContents:获取仓库中特定文件的内容
常见问题解答
- 如何获取 GitHub token:从 https://github.com/settings/tokens 获取
- 如何配置环境变量:需要设置
GITHUB_TOKEN
、GITHUB_OWNER
和GITHUB_REPO
使用教程
使用依赖
无特殊依赖,只需 Node.js 环境和 npm/pnpm 包管理器。
安装教程
使用 Smithery 安装
# For Claude
npx -y @smithery/cli install @Hint-Services/mcp-private-github-search --client claude
# For Cursor
npx -y @smithery/cli install @Hint-Services/mcp-private-github-search --client cursor
# For Windsurf
npx -y @smithery/cli install @Hint-Services/mcp-private-github-search --client windsurf
# For Cline
npx -y @smithery/cli install @Hint-Services/mcp-private-github-search --client cline
# For TypeScript
npx -y @smithery/cli install @Hint-Services/mcp-private-github-search --client typescript
手动安装
pnpm add mcp-private-github-search
调试方式
配置 MCP 设置文件:
{
"mcpServers": {
"privateGithubSearch": {
"command": "npx",
"args": ["-y", "@Hint-Services/mcp-private-github-search"],
"env": {
"GITHUB_TOKEN": "your-token",
"GITHUB_OWNER": "your-owner",
"GITHUB_REPO": "your-repo"
}
}
}
}