github-security-mcp
Checks Dependabot alerts and dependency vulnerabilities, including unfixed critical alerts and supply chain risks across repositories.
Provides tools for auditing GitHub organizations, repositories, and security configurations including 2FA, SSO, branch protection, secret scanning, and access controls.
Analyzes CI/CD workflows for security risks such as script injection, unpinned actions, pull_request_target misuse, OIDC configuration, and permission issues.
Click on "Deploy Server".
Wait a few minutes for the server to deploy. Once ready, it will show a "Started" state.
In the chat, type
@followed by the MCP server name and your instructions, e.g., "@github-security-mcp Run a full security audit on my GitHub org"
That's it! The server will respond to your query, and you can continue using it as needed.
Here is a step-by-step guide with screenshots.
The Problem
GitHub security is fragmented. You need separate tools for org settings, repo configurations, Actions workflow analysis, secret scanning, supply chain, and access control. No single tool covers it all, and none work with AI agents.
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 orggithub-security-mcp gives your AI agent 39 tools and 45 security checks via the Model Context Protocol. The agent calls GitHub APIs directly, understands what it finds, and tells you exactly what to fix.
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"Related MCP server: github-mcp-proxy
How It's Different
Existing tools focus on one slice of GitHub security. github-security-mcp covers the full stack and works with any AI agent.
Tool | What it does | What it can't do |
Enforce repo settings via GitHub App | No Actions analysis, no secret scanning, no access audit | |
OpenSSF security score for repos | Single-repo focus, no org-level checks, no real-time interaction | |
Org + repo policy enforcement | CLI output, no AI integration, limited Actions analysis | |
Runtime Actions security | Only Actions, no org/repo/access checks | |
Secret detection in commits | SaaS only, no self-hosted, limited to secrets domain | |
Supply chain risk analysis | Package-focused, no org/Actions/access analysis |
All of these are excellent tools. github-security-mcp doesn't replace them — it fills the gap of giving an AI agent unified, interactive access across all GitHub security domains.
Quick Start
Install
git clone https://github.com/badchars/github-security-mcp.git
cd github-security-mcp
bun installSet up authentication
# 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)Connect to your AI agent
claude mcp add github-security -- bun run /path/to/github-security-mcp/src/index.tsAdd to ~/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"
}
}
}
}Same JSON config format. Point the command to your installation path.
Start auditing
You: "Audit my GitHub org for security misconfigurations"That's it. The agent handles the rest.
What The AI Can Do
Full Organization Audit
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..."Actions Workflow Security
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."Access Control Review
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."Secret Exposure Detection
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."Tools Reference (39 tools)
Tool | Description |
| 2FA enforcement, default repo visibility, member creation privileges |
| SSO/SAML configuration via GraphQL |
| Outside collaborators, stale member detection |
| OAuth credential authorizations, GitHub App installation permissions |
| Insecure webhook URLs (HTTP, no secret) |
| Suspicious audit log activity (Enterprise) |
| List all repos in an org with security metadata |
Tool | Description |
| Branch protection rules on default branch |
| Secret scanning and push protection enablement |
| CodeQL / code scanning enabled, open alerts |
| Dependabot enabled, critical alert triage |
| SECURITY.md, private vulnerability reporting, fork restrictions |
| Insecure repo-level webhook URLs |
| Deploy key permissions (read-only vs read-write) |
| CODEOWNERS file presence and enforcement |
Tool | Description |
| Script injection via |
|
|
| GITHUB_TOKEN default permission scope |
| Unpinned third-party actions (tag vs SHA) |
| Self-hosted runner exposure |
| Missing environment protection rules |
| Secret exfiltration patterns in workflows |
| OIDC subject claim customization |
Tool | Description |
| Coverage gaps and unresolved alerts |
| Push protection bypass tracking |
| Custom secret pattern configuration |
| Environment, repo, and org-level secret scoping |
Tool | Description |
| Dependency graph enablement |
| Dependabot security updates configuration |
| SBOM generation capability |
| Known vulnerabilities, critical unfixed > 90 days |
Tool | Description |
| Team permission levels across repos |
| External collaborator access audit |
| GitHub App permission scope review |
| Classic vs fine-grained PAT usage |
Tool | Description |
| Browse all 45 checks, filter by category/severity |
| Aggregate findings by category, severity, status |
| Full markdown or JSON audit report |
| Execute all checks for an org/repo |
Check Registry (45 checks)
ID | Check | Severity |
ORG-001 | 2FA not enforced | CRITICAL |
ORG-002 | Default repo visibility is public | HIGH |
ORG-003 | Members can create public repos | MEDIUM |
ORG-004 | SSO/SAML not configured | HIGH |
ORG-005 | Outside collaborators with access | MEDIUM |
ORG-006 | Stale organization members | LOW |
ORG-007 | Risky OAuth app authorizations | HIGH |
ORG-008 | Over-permissive GitHub App installations | HIGH |
ORG-009 | Insecure webhook URLs | MEDIUM |
ORG-010 | Suspicious audit log activity | INFO |
ID | Check | Severity |
REPO-001 | Missing or weak branch protection | CRITICAL |
REPO-002 | Secret scanning not enabled | HIGH |
REPO-003 | Push protection not enabled | HIGH |
REPO-004 | Code scanning not enabled | MEDIUM |
REPO-005 | Open code scanning alerts | HIGH |
REPO-006 | Dependabot not enabled | MEDIUM |
REPO-007 | Critical Dependabot alerts | CRITICAL |
REPO-008 | No SECURITY.md policy file | LOW |
REPO-009 | Private vulnerability reporting off | LOW |
REPO-010 | Unrestricted fork settings | LOW |
REPO-011 | Insecure repo webhooks | MEDIUM |
REPO-012 | Read-write deploy keys | HIGH |
REPO-013 | Missing CODEOWNERS file | LOW |
ID | Check | Severity |
ACT-001 | Script injection via untrusted inputs | CRITICAL |
ACT-002 | pull_request_target with checkout | CRITICAL |
ACT-003 | Over-permissive GITHUB_TOKEN | HIGH |
ACT-004 | Unpinned third-party actions | MEDIUM |
ACT-005 | Self-hosted runner exposure | HIGH |
ACT-006 | Missing environment protection rules | MEDIUM |
ACT-007 | Secret exfiltration patterns | HIGH |
ACT-008 | OIDC misconfiguration | MEDIUM |
ID | Check | Severity |
SEC-001 | Secret scanning coverage gaps | HIGH |
SEC-002 | Unresolved secret scanning alerts | CRITICAL |
SEC-003 | Push protection bypasses | HIGH |
SEC-004 | No custom secret patterns | LOW |
SEC-005 | Overly broad secret scoping | MEDIUM |
ID | Check | Severity |
SUP-001 | Dependency graph not enabled | MEDIUM |
SUP-002 | Dependabot security updates off | HIGH |
SUP-003 | No SBOM generation | LOW |
SUP-004 | Critical known vulnerabilities | CRITICAL |
SUP-005 | Stale unfixed vulnerabilities (>90 days) | HIGH |
ID | Check | Severity |
ACC-001 | Over-permissive team access | HIGH |
ACC-002 | External collaborators with write+ | MEDIUM |
ACC-003 | Over-scoped GitHub Apps | HIGH |
ACC-004 | Classic PATs with broad scopes | HIGH |
Architecture
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 checksDesign decisions:
Single Octokit instance — GitHub API is global (no regions). Lazy initialization on first API call.
Uniform CheckResult — Every check returns the same structure: checkId, severity, status, details, remediation. Same pattern as cloud-audit-mcp.
Static workflow analysis — Actions checks fetch YAML via Contents API and use regex analysis. GitHub has no parsed workflow API.
Enterprise graceful degradation — Enterprise-only features (audit log, credential authorizations, SSO) return
NOT_APPLICABLEinstead of errors.In-memory findings — Session-scoped findings array. No database, no persistence. Run
github_audit_summaryorgithub_audit_reportto aggregate.4 dependencies —
@modelcontextprotocol/sdk,@octokit/rest,@octokit/graphql,zod. Nothing else.
Authentication
Token Type | Required Scopes |
Classic PAT |
|
Fine-grained PAT (recommended) | Org: Members + Administration (read). Repo: Administration, Code scanning, Dependabot, Secret scanning, Actions, Environments, Webhooks (read) |
GitHub App | Same repository/org permissions as fine-grained PAT |
The token is read from the GITHUB_TOKEN environment variable.
Part of the MCP Security Suite
Project | Domain | Tools |
Browser-based security testing | 39 tools, Firefox, injection testing | |
Cloud security (AWS/Azure/GCP) | 38 tools, 60+ checks | |
github-security-mcp | GitHub security posture | 39 tools, 45 checks |
Limitations
Requires a GitHub PAT or GitHub App token with appropriate scopes
Some checks require GitHub Enterprise Cloud (audit log, credential authorizations, SSO) — these gracefully return NOT_APPLICABLE on free/Team plans
Actions workflow analysis is regex-based (no AST parsing) — may miss complex injection patterns
Rate limiting: GitHub API allows 5,000 requests/hour for authenticated users. A full org audit with many repos may approach this limit
macOS / Linux (Windows not tested)
Available Tools
39 toolsgithub_audit_reportC
Generate a comprehensive markdown security report from all findings in the current session.
Inputs: title, format, severityFilter.
github_audit_summaryA
Aggregate all findings from the current session by category, severity, and status. Shows critical findings and top remediation actions.
Inputs: no named parameters.
github_check_app_permissionsB
Audit GitHub App installations for overly broad permission scopes. Detects ACC-003.
Inputs: owner (required), repo (required).
github_check_collaboratorsB
Check for outside collaborators with write, maintain, or admin permissions. Detects ACC-002.
Inputs: owner (required), repo (required).
github_check_dependabot_updatesA
Check if Dependabot security updates and version updates are configured. Detects SUP-002.
Inputs: owner (required), repo (required).
github_check_dependency_graphA
Check if the dependency graph is enabled for vulnerability detection. Detects SUP-001.
Inputs: owner (required), repo (required).
github_check_org_appsA
Audit OAuth app authorizations and GitHub App installations for the organization. Detects ORG-007, ORG-008.
Inputs: org (required).
github_check_org_audit_logB
Review organization audit log for suspicious or high-risk events. Detects ORG-010.
Inputs: org (required).
github_check_org_membersB
Audit organization members: outside collaborators and member activity. Detects ORG-005, ORG-006.
Inputs: org (required).
github_check_org_securityA
Check organization security settings: 2FA enforcement, default repository visibility, member privileges. Detects ORG-001, ORG-002, ORG-003.
Inputs: org (required).
github_check_org_ssoB
Check if SSO/SAML single sign-on is configured for the organization. Detects ORG-004.
Inputs: org (required).
github_check_org_webhooksB
Check organization webhooks for insecure HTTP URLs and SSL verification. Detects ORG-009.
Inputs: org (required).
github_check_pat_usageA
Check for classic personal access tokens with overly broad scopes. Detects ACC-004.
Inputs: org (required).
github_check_push_protectionC
Check for secret scanning alerts where push protection was bypassed. Detects SEC-003.
Inputs: owner (required), repo (required).
github_check_repo_branch_protectionB
Check branch protection rules on the default branch: required reviews, status checks, admin enforcement, signed commits. Detects REPO-001.
Inputs: owner (required), repo (required).
github_check_repo_codeownersA
Check if CODEOWNERS file exists for code review enforcement. Detects REPO-013.
Inputs: owner (required), repo (required).
github_check_repo_code_scanningB
Check if code scanning (CodeQL) is configured and review open alerts. Detects REPO-004, REPO-005.
Inputs: owner (required), repo (required).
github_check_repo_dependabotB
Check Dependabot configuration and open security alerts. Detects REPO-006, REPO-007.
Inputs: owner (required), repo (required).
github_check_repo_deploy_keysA
Audit deploy keys for unnecessary write access. Detects REPO-012.
Inputs: owner (required), repo (required).
github_check_repo_secretsB
Check if secret scanning and push protection are enabled for the repository. Detects REPO-002, REPO-003.
Inputs: owner (required), repo (required).
github_check_repo_settingsA
Check repository security settings: SECURITY.md, private vulnerability reporting, fork restrictions. Detects REPO-008, REPO-009, REPO-010.
Inputs: owner (required), repo (required).
github_check_repo_webhooksB
Check repository webhooks for insecure HTTP URLs and SSL verification. Detects REPO-011.
Inputs: owner (required), repo (required).
github_check_sbomB
Check if software bill of materials (SBOM) can be generated from the dependency graph. Detects SUP-003.
Inputs: owner (required), repo (required).
github_check_secret_patternsA
Check if organization has defined custom secret scanning patterns. Detects SEC-004.
Inputs: org (required).
github_check_secret_scanningB
Check secret scanning coverage and review open alerts. Detects SEC-001, SEC-002.
Inputs: owner (required), repo (required).
github_check_secret_scopingB
Review secret scoping across environments, repositories, and organization levels. Detects SEC-005.
Inputs: owner (required), repo (required).
github_check_team_permissionsB
Audit team permissions for admin-level access to repositories. Detects ACC-001.
Inputs: org (required), repo.
github_check_vulnerabilitiesB
Check for critical known vulnerabilities and stale unfixed alerts (>90 days). Detects SUP-004, SUP-005.
Inputs: owner (required), repo (required).
github_check_workflow_environmentsB
Check deployment environments for missing protection rules (reviewers, wait timers, branch policies). Detects ACT-006.
Inputs: owner (required), repo (required).
github_check_workflow_injectionA
Scan workflow files for script injection vulnerabilities via untrusted event inputs (${{ github.event.issue.title }}, etc. in run: blocks). Detects ACT-001.
Inputs: owner (required), repo (required).
github_check_workflow_oidcB
Check OIDC subject claim customization for secure cloud deployment trust. Detects ACT-008.
Inputs: owner (required), repo (required).
github_check_workflow_permissionsB
Check GITHUB_TOKEN default permissions (should be read, not write). Detects ACT-003.
Inputs: owner (required), repo (required).
github_check_workflow_pinningB
Detect unpinned third-party actions (tag reference vs SHA pinning). Detects ACT-004.
Inputs: owner (required), repo (required).
github_check_workflow_pr_targetA
Detect dangerous pull_request_target + checkout pattern that enables arbitrary code execution from fork PRs. Detects ACT-002.
Inputs: owner (required), repo (required).
github_check_workflow_runnersB
Detect self-hosted runners and assess persistence/exposure risk. Detects ACT-005.
Inputs: org, owner, repo.
github_check_workflow_secretsC
Detect patterns where secrets are passed to network commands (curl/wget) or logged in workflow files. Detects ACT-007.
Inputs: owner (required), repo (required).
github_list_checksA
List all available security checks with their IDs, categories, severities, and descriptions. Filterable by category and severity.
Inputs: category, severity.
github_list_org_reposA
List organization repositories with security metadata (visibility, fork count, archived status). Useful for selecting repos to audit.
Inputs: org (required), type.
github_run_allA
Run all security checks for an organization and/or repository. Executes org, repo, actions, secrets, supply chain, and access control checks sequentially.
Inputs: org, owner, repo.
Tool Schema Changelog
Recent tool additions, removals, and schema changes observed during successful MCP inspections.
Loading tool schema changelog…
TDQS
Scored across 39 tools
Each tool targets a distinct security check with unique detection codes and descriptions. Despite many tools, they are clearly differentiated by domain (e.g., collaborators, branch protection, workflow injection). No two tools appear to serve the same purpose.
All main check tools follow the pattern 'github_check_<domain>' with underscores. Non-check tools use 'github_list_', 'github_run_all', 'github_audit_', which are also systematic. The naming is highly predictable and consistent.
39 tools is on the higher end, but the server's scope of comprehensive GitHub security auditing justifies this count. The inclusion of 'github_run_all' and 'github_list_checks' mitigates potential overload, making the set usable.
The tool set covers all major aspects of GitHub security: org settings, repo settings, branch protection, secret scanning, supply chain, actions, and access control. It includes reporting and summary tools, leaving no obvious detection gaps for its stated purpose.
Related MCP Connectors
Security scanner for MCP servers. Detect vulnerabilities, prompt injection, and tool poisoning.
Audit your MCP servers for poisoned tools and leaked secrets, and check AI-generated code for flaws.
MCP server connecting AI agents to 100+ apps (Gmail, Slack, Notion, GitHub) via one-click OAuth.
MCP server for secureFlows: token-free URL builders and integration-linting tools for AI agents.
Related MCP Servers
- AlicenseNot gradedqualityDmaintenanceA production-ready MCP server that provides AI assistants with comprehensive GitHub developer tooling including PR analysis, code review, changelog generation, dependency auditing, commit summarization, and refactoring suggestions.MIT
- FlicenseNot gradedqualityDmaintenanceA self-hosted GitHub MCP server with per-repository guardrails for AI agents, enabling fine-grained access control and audit trails.-
- AlicenseNot gradedqualityAmaintenanceAn MCP server that exposes a 60+ tool security and threat-intel stack to AI agents, enabling secret scanning, Sigma rule generation, ransomware lookup, OSINT, and deep research.1MIT
- AlicenseBqualityCmaintenanceMCP server that exposes GitHub operations as tools for AI agents, enabling code search, issue management, and PR review.12MIT