Github Dependabot MCP server

Github Dependabot MCP server

site icon
2025.04.30 0
Python依赖管理安全监控开发效率
Github Dependabot MCP server 是一个用于获取指定仓库的 Github Dependabot 警报的服务。它通过 Github API 进行认证和交互,帮助开发者管理和监控依赖项的安全问题。
View on GitHub

Overview

基本能力

产品定位

Github Dependabot MCP server 主要用于帮助开发者获取和管理 Github 仓库中的 Dependabot 警报,确保依赖项的安全性。

核心功能

  • 获取指定仓库的 Dependabot 警报。
  • 支持通过 Github Personal Access Token 进行认证。
  • 提供工具 get_dependabot_alerts 用于获取警报信息。

适用场景

  • 监控和管理 Github 仓库中的依赖项安全问题。
  • 自动化检查依赖项漏洞。

工具列表

  • get_dependabot_alerts(repo_owner: str, repo_name: str):
  • 功能:获取指定仓库的 Dependabot 警报。
  • 参数:repo_owner(仓库所有者),repo_name(仓库名称)。
  • 返回:Github API 返回的警报对象列表。

常见问题解答

  • 如何获取 Github Personal Access Token?
  • 在 Github 设置中生成,需包含 reposecurity_events 权限。
  • 如何存储 Token?
  • 推荐使用 macOS Keychain 或通过环境变量 GITHUB_PERSONAL_ACCESS_TOKEN 存储。

使用教程

使用依赖

  • uv: 快速 Python 包安装器和解析器。
  • 安装命令:
    • macOS / Linux (Homebrew): bash brew install uv
    • 或使用 curl: bash curl -LsSf https://astral.sh/uv/install.sh | sh
    • Windows (PowerShell): powershell irm https://astral.sh/uv/install.ps1 | iex

安装教程

  1. 克隆仓库: bash git clone [email protected]:avarant/github-dependabot-mcp-server.git cd github-dependabot-mcp-server
  2. 设置 Github 认证:
  3. 生成 Personal Access Token,包含 reposecurity_events 权限。
  4. 存储 Token:
    • 使用 macOS Keychain: bash keyring set github_mcp_server personal_access_token
    • 或通过环境变量 GITHUB_PERSONAL_ACCESS_TOKEN
  5. 更新 MCP 配置:
  6. 编辑 ~/.cursor/mcp.json 或创建 .cursor/mcp.json,配置 github-dependabot 服务器。

调试方式

  • 运行工具 get_dependabot_alerts 获取警报信息,确保 Token 和配置正确。
  • 示例命令: bash uv --directory /path/to/github-dependabot-mcp-server run mcp run main.py

许可证

该项目遵循 MIT 开源许可条款,请参阅 MIT 了解完整条款。