Token导航 LogoToken导航TokenDH.com
GitHub Security MCP logo
开发工具未说明官方级别未说明来源级核验

GitHub Security MCP

MCP Server

一个为AI代理提供的GitHub安全态势分析工具,涵盖组织、仓库、Actions、密钥、供应链和访问控制等全方位的安全检查。

工具数

39

提示词数

0

GitHub Stars

5

资源数

0
TypeScriptClaude开发工具Claude DesktopClaudeCursorWindsurf

安装说明

本站只整理中文说明和来源信息,不托管安装包,也不代用户安装。

作者 / 组织

badchars

提供方

badchars

最后核验

2026/5/17 20:19

快速接入

先看主来源和安装命令,再打开仓库或文档;下面只保留这个条目的关键接入事实。

详细介绍

GitHub security posture analysis for AI agents.

GitHub Enterprise security features cost $21/user/month.

This gives your AI agent the same visibility for free — org, repos, Actions, secrets, supply chain.

The Problem • How It's Different • Quick Start • What The AI Can Do • Tools • Checks • Architecture

______________________________________________________________________

问题

GitHub的安全性是分散的。您需要单独的工具来进行组织设置、仓库配置、操作工作流分析、秘密扫描、供应链和访问控制。没有一个工具能涵盖这一切,也没有一个能与人工智能代理配合使用。

Traditional workflow:
  manually check org settings                →  click through 15 pages
  run github-advisory-db for each repo       →  one at a time
  grep workflows for script injection        →  miss half the patterns
  review collaborator access                 →  spreadsheet hell
  check secret scanning alerts               →  another dashboard
  ──────────────────────────────────────────
  Total: hours of manual work per org

github安全mcp 为您的AI代理提供39个工具和45个安全检查 模型上下文协议.代理直接调用GitHub API,了解它发现了什么,并告诉您要修复什么。

With github-security-mcp:
  You: "Audit my GitHub org for security issues and prioritize the fixes"

  Agent: → checks org settings (2FA, SSO, member privileges)
         → scans repos (branch protection, secret scanning, Dependabot)
         → analyzes workflows (script injection, unpinned actions, OIDC)
         → reviews access (teams, collaborators, PATs, GitHub Apps)
         → "12 critical, 8 high — here are the top 5 to fix now"

______________________________________________________________________

这有什么不同

现有的工具专注于GitHub安全的一个方面。github security-mcp覆盖了整个堆栈,可以与任何AI代理配合使用。

Existing Tools github-security-mcp

Interface CLI / GitHub UI / dashboards MCP — AI agent calls tools in real-time

Scope Single domain (Actions, or secrets, or repos) Full stack: org + repos + Actions + secrets + supply chain + access

Correlation None — isolated findings Agent chains: "This unpinned action + write permissions + no environment protection = supply chain risk"

Remediation Generic docs links Agent generates specific fix instructions for your exact configuration

Actions analysis Most tools skip workflows 8 checks: script injection, PR target, OIDC, pinning, secrets, runners, environments, permissions

Enterprise features Require GitHub Enterprise ($21/user/mo) Free — uses public API with graceful degradation for Enterprise-only features

Specific comparisons with popular tools

工具它能做什么它不能做什么
全明星通过GitHub App强制执行仓库设置无操作分析、无秘密扫描、无访问审核
记分卡OpenSSF仓库安全评分单一仓库焦点,无组织级检查,无实时交互
合法化组织+回购策略执行CLI输出,无AI集成,操作分析有限
踏步安全/加固转轮运行时操作安全仅操作,无组织/仓库/访问检查
GitGuardian 的提交中的秘密检测仅SaaS,无自托管,仅限于秘密域
套接字供应链风险分析以包为重点,无组织/行动/访问分析

所有这些都是优秀的工具。github安全mcp并没有取代它们——它填补了提供人工智能代理的空白 统一、交互式访问 跨所有GitHub安全域。

______________________________________________________________________

快速开始

安装

git clone https://github.com/badchars/github-security-mcp.git
cd github-security-mcp
bun install

设置身份验证

# Classic PAT (requires: repo, admin:org, admin:org_hook, admin:repo_hook)
export GITHUB_TOKEN=ghp_xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx

# Fine-grained PAT (preferred — least privilege)
# Organization: Members (read), Administration (read)
# Repository: Administration, Code scanning, Dependabot, Secret scanning,
#             Actions, Environments, Webhooks (all read-only)

连接到您的AI代理

Claude Code

claude mcp add github-security -- bun run /path/to/github-security-mcp/src/index.ts

Claude Desktop

增添 ~/Library/Application Support/Claude/claude_desktop_config.json:

{
  "mcpServers": {
    "github-security": {
      "command": "bun",
      "args": ["run", "/path/to/github-security-mcp/src/index.ts"],
      "env": {
        "GITHUB_TOKEN": "ghp_your_token_here"
      }
    }
  }
}

Cursor / Windsurf / other MCP clients

相同的JSON配置格式。将命令指向您的安装路径。

开始审核

You: "Audit my GitHub org for security misconfigurations"

就这样,剩下的就交给特工了。

______________________________________________________________________

AI能做什么

全面组织审计

You: "Run a complete security audit on our GitHub org"

Agent: → github_run_all {org: "myorg", repo: "main-app"}
       → 45 checks across 6 categories
       → github_audit_report
       → "34 findings: 4 critical, 7 high, 12 medium.
          Critical #1: No branch protection on main (REPO-001)
          Critical #2: Script injection in deploy.yml (ACT-001)
          Critical #3: 3 critical Dependabot alerts unfixed 90+ days (REPO-007)
          Critical #4: Unresolved secret scanning alerts (SEC-002)
          Here are the exact fixes for each..."

操作工作流安全

You: "Check our CI/CD workflows for supply chain risks"

Agent: → github_check_workflow_injection
         Found ${{ github.event.issue.title }} in run: block (deploy.yml:47)
       → github_check_workflow_pinning
         12 actions use tags instead of SHA pins
       → github_check_workflow_pr_target
         build.yml uses pull_request_target with checkout — critical risk
       → github_check_workflow_permissions
         Default GITHUB_TOKEN has write-all permissions
       → "4 supply chain risks found. The PR target + checkout pattern
          allows any fork to execute arbitrary code with write access
          to your repo. Fix this first."

访问控制审查

You: "Who has too much access to our repositories?"

Agent: → github_check_team_permissions
         "platform" team has admin on 47 repos, only 3 members
       → github_check_collaborators
         8 outside collaborators with write access
       → github_check_app_permissions
         "old-ci-bot" GitHub App has admin + all repos
       → github_check_pat_usage
         14 classic PATs with repo scope (should be fine-grained)
       → "Reduce blast radius: restrict platform team to maintain,
          remove 3 stale outside collaborators, limit old-ci-bot
          to specific repos, migrate classic PATs to fine-grained."

秘密曝光检测

You: "Are we properly protecting secrets across our repos?"

Agent: → github_check_secret_scanning
         Secret scanning disabled on 5 private repos
       → github_check_push_protection
         3 push protection bypasses in the last month
       → github_check_secret_patterns
         No custom secret patterns defined
       → github_check_secret_scoping
         2 org secrets available to all repos (should be scoped)
       → "Enable secret scanning on all repos, review the 3 bypasses,
          add custom patterns for internal API keys, and scope
          org secrets to only the repos that need them."

______________________________________________________________________

工具参考(39个工具)

Organization (7)

工具说明
github_check_org_security2FA执行、默认仓库可见性、成员创建权限
github_check_org_sso通过GraphQL配置SSO/SAML
github_check_org_members外部合作者、过时成员检测
github_check_org_appsOAuth凭据授权、GitHub应用程序安装权限
github_check_org_webhooks不安全的webhook URL(HTTP,无秘密)
github_check_org_audit_log可疑的审计日志活动(企业)
github_list_org_repos列出组织中具有安全元数据的所有存储库

Repository (8)

工具说明
github_check_repo_branch_protection违约分行的分行保护规则
github_check_repo_secrets启用秘密扫描和推送保护
github_check_repo_code_scanningCodeQL/代码扫描已启用,打开警报
github_check_repo_dependabot启用Dependabot的关键警报分诊
github_check_repo_settingsSECURITY.md、私有漏洞报告、分叉限制
github_check_repo_webhooks不安全的仓库级webhook URL
github_check_repo_deploy_keys部署密钥权限(只读与读写)
github_check_repo_codeownersCODEOWNERS文件的存在和执行

Actions (8)

工具说明
github_check_workflow_injection通过脚本注入 ${{ github.event.* }}run: 砌块
github_check_workflow_pr_targetpull_request_target +结账模式(关键)
github_check_workflow_permissionsGITHUB_TOKEN默认权限范围
github_check_workflow_pinning未绑定的第三方操作(标签vs SHA)
github_check_workflow_runners自我主持跑步者曝光
github_check_workflow_environments缺少环境保护规则
github_check_workflow_secrets工作流中的秘密渗透模式
github_check_workflow_oidcOIDC主题索赔定制

Secrets (4)

工具说明
github_check_secret_scanning覆盖范围差距和未解决的警报
github_check_push_protection推送保护旁路跟踪
github_check_secret_patterns自定义秘密图案配置
github_check_secret_scoping环境、仓库和组织级秘密范围

Supply Chain (4)

工具说明
github_check_dependency_graph依赖图启用
github_check_dependabot_updatesDependabot安全更新配置
github_check_sbomSBOM生成能力
github_check_vulnerabilities已知漏洞,严重未修复>90天

Access Control (4)

工具说明
github_check_team_permissions跨存储库的团队权限级别
github_check_collaborators外部合作者访问审核
github_check_app_permissionsGitHub应用程序权限范围审查
github_check_pat_usage经典与细粒度PAT使用

Meta (4)

工具说明
github_list_checks浏览所有45项检查,按类别/严重程度筛选
github_audit_summary按类别、严重程度、状态汇总调查结果
github_audit_report完整的markdown或JSON审计报告
github_run_all执行对组织/仓库的所有检查

______________________________________________________________________

检查注册表(45次检查)

Organization (ORG-001 to ORG-010)

ID检查严重性
ORG-0012FA未执行关键
ORG-002默认回购可见性为公开
ORG-003成员可以创建公共仓库中等
ORG-004未配置SSO/SAML
ORG-005有访问权限的外部合作者中等
ORG-006组织成员陈旧
ORG-007OAuth应用授权风险高
ORG-008过度允许GitHub应用程序安装
ORG-009不安全的webhook URL中等
ORG-010可疑审计日志活动信息

Repository (REPO-001 to REPO-013)

ID检查严重性
REPO-001缺少或弱分支保护关键
REPO-002未启用秘密扫描
REPO-003推送保护未启用
REPO-004未启用代码扫描中等
REPO-005打开代码扫描警报
REPO-006未启用Dependabot中等
REPO-007关键依赖机器人警报关键
REPO-008无SECURITY.md策略文件
REPO-009关闭私有漏洞报告
REPO-010无限制拨叉设置
REPO-011不安全的回购webhooks中等
REPO-012读写部署密钥
REPO-013缺少代码所有者文件

Actions (ACT-001 to ACT-008)

ID检查严重性
ACT-001通过不受信任的输入进行脚本注入关键
ACT-002带校验的pull_request_target关键
ACT-003过度允许赠品_糖果
ACT-004未加密的第三方行为中等
ACT-005自托管跑步者曝光
ACT-006缺少环境保护规则中等
ACT-007秘密渗透模式
ACT-008OIDC配置错误中等

Secrets (SEC-001 to SEC-005)

ID检查严重性
SEC-001秘密扫描覆盖范围差距
SEC-002未解决的秘密扫描警报严重
SEC-003推送保护旁路
SEC-004无自定义秘密图案
SEC-005秘密范围过于宽泛中等

Supply Chain (SUP-001 to SUP-005)

ID检查严重性
SUP-001依赖关系图未启用中等
SUP-002Dependabot安全更新关闭
SUP-003无SBOM生成
SUP-004关键已知漏洞关键
SUP-005长期未修复的漏洞(>90天)

Access Control (ACC-001 to ACC-004)

ID检查严重性
ACC-001团队访问权限过大
ACC-002外部合作者写+中等
ACC-003GitHub应用程序范围过大
ACC-004具有宽范围的经典PAT

______________________________________________________________________

建筑

src/
├── index.ts                    Entry point + MCP stdio
├── types/
│   └── index.ts                CheckResult, ToolDef, ToolContext, ToolResult
├── github/
│   └── client.ts               GitHubClientFactory (lazy Octokit + GraphQL)
├── protocol/
│   ├── tools.ts                39 tool definitions (Zod schemas)
│   └── mcp-server.ts           MCP server + stdio transport
├── org/                        Organization checks (ORG-001..010)
│   ├── security.ts             2FA, visibility, member privileges
│   ├── sso.ts                  SSO/SAML via GraphQL
│   ├── members.ts              Outside collaborators, stale members
│   ├── apps.ts                 OAuth apps, GitHub App installations
│   ├── webhooks.ts             Insecure webhook URLs
│   └── audit-log.ts            Suspicious audit log patterns
├── repo/                       Repository checks (REPO-001..013)
│   ├── branch-protection.ts    Branch protection rules
│   ├── secret-scanning.ts      Secret scanning + push protection
│   ├── code-scanning.ts        CodeQL enabled, open alerts
│   ├── dependabot.ts           Dependabot enabled, critical alerts
│   ├── settings.ts             SECURITY.md, vuln reporting, forks
│   ├── webhooks.ts             Insecure repo webhooks
│   ├── deploy-keys.ts          Deploy key permissions
│   └── codeowners.ts           CODEOWNERS file
├── actions/                    GitHub Actions checks (ACT-001..008)
│   ├── injection.ts            Script injection via untrusted inputs
│   ├── pr-target.ts            pull_request_target + checkout
│   ├── permissions.ts          GITHUB_TOKEN default permissions
│   ├── pinning.ts              Unpinned third-party actions
│   ├── runners.ts              Self-hosted runner exposure
│   ├── environments.ts         Environment protection rules
│   ├── secrets.ts              Secret exfiltration patterns
│   └── oidc.ts                 OIDC configuration
├── secrets/                    Secret management checks (SEC-001..005)
│   ├── scanning.ts             Coverage + alert triage
│   ├── push-protection.ts      Push protection bypasses
│   ├── patterns.ts             Custom secret patterns
│   └── scoping.ts              Env/repo/org secret scoping
├── supply-chain/               Supply chain checks (SUP-001..005)
│   ├── dependency-graph.ts     Dependency graph enabled
│   ├── dependabot-updates.ts   Security updates config
│   ├── sbom.ts                 SBOM generation
│   └── vulnerabilities.ts      Known vulns, stale unfixed
├── access/                     Access control checks (ACC-001..004)
│   ├── teams.ts                Team permission audit
│   ├── collaborators.ts        External collaborators
│   ├── github-apps.ts          GitHub App permissions
│   └── tokens.ts               Classic vs fine-grained PATs
└── meta/                       Aggregation + reporting
    ├── list-checks.ts          CHECK_REGISTRY (45 checks)
    ├── summary.ts              Findings aggregation
    ├── report.ts               Markdown/JSON report
    └── run-all.ts              Execute all checks

设计决策:

  • 单个Octokit实例 -GitHub API是全球性的(无地区)。在第一个API调用上的延迟初始化。
  • 统一检查结果 --每次检查都返回相同的结构:checkId、严重性、状态、详细信息、补救措施。图案与 云审计mcp.
  • 静态工作流分析 -操作检查通过Contents API获取YAML并使用regex分析。GitHub没有解析的工作流API。
  • 企业优雅降级 --仅限企业的功能(审核日志、凭据授权、SSO)返回 NOT_APPLICABLE 而不是错误。
  • 记忆中的发现 --会话范围的发现数组。没有数据库,就没有持久性。跑 github_audit_summarygithub_audit_report 聚合。
  • 4依赖关系@modelcontextprotocol/sdk, @octokit/rest, @octokit/graphql, zod没有别的了。

______________________________________________________________________

认证

令牌类型必填范围
经典PATrepo, admin:org, admin:org_hook, admin:repo_hook
细粒PAT (推荐)组织:成员+管理(阅读)。回购:管理、代码扫描、Dependabot、秘密扫描、操作、环境、Webhooks(阅读)
GitHub应用程序与细粒度PAT具有相同的存储库/组织权限

从读取令牌 GITHUB_TOKEN 环境变量。

______________________________________________________________________

MCP安全套件的一部分

项目工具
Hackbrowserv mcp基于浏览器的安全测试39个工具,Firefox,注入测试
云审计mcp云安全(AWS/Azure/GCP)38个工具,60多项检查
github安全mcpGitHub安全态势39个工具,45个检查

______________________________________________________________________

局限性

  • 需要具有适当范围的GitHub PAT或GitHub App令牌
  • 一些检查需要GitHub Enterprise Cloud(审计日志、凭据授权、SSO)——这些检查在免费/团队计划中会优雅地返回NOT_APPLICABLE
  • 动作工作流分析是基于正则表达式的(没有AST解析)——可能会错过复杂的注入模式
  • 速率限制:GitHub API允许通过身份验证的用户每小时请求5000次。一个包含多个仓库的完整组织审计可能会接近这个极限
  • macOS/Linux(未测试Windows)

______________________________________________________________________

For authorized security testing and assessment only.

Always ensure you have proper authorization before auditing any organization.

MIT License • Built with Bun + TypeScript

目录标签

目录标签

TypeScriptClaude开发工具GitHub安全本地部署AI代理安全检查自动化审计开源安全

支持客户端

Claude DesktopClaudeCursorWindsurf

接入字段

传输方式(transport,传输协议)

未说明

鉴权方式(authType,认证方式)

oauth

工具数量(toolCount,工具数)

39

资源数量(resourceCount,资源数)

0

提示词数量(promptCount,提示词数)

0

权限和风险

未说明oauth部署方式未说明

接入前请确认传输方式、认证方式和部署位置,并根据实际工具能力限制访问范围。

安装前确认

不要直接授予不必要的文件、网络或账号权限;先核对安装命令和配置内容。

仍需确认:installCommand

来源信息

继续浏览同类 MCP