Skip to content

Latest commit

 

History

History

Folders and files

NameName
Last commit message
Last commit date

parent directory

..
 
 
 
 

README.md

Protected GitHub — GATE MCP Flagship Example

This example shows how GATE MCP protects a GitHub MCP server with role-based access control, approval workflows for high-risk operations, and complete audit logging.

Why This Example Matters

An AI agent with access to a GitHub MCP server can:

  • Delete repositories without review
  • Merge pull requests to production branches
  • Push commits directly
  • Archive repos, delete branches

GATE MCP ensures every GitHub action is evaluated against your organization's policies before it reaches the API.

Run the Demo

pnpm gate-mcp demo github

This uploads the GitHub safety policy and simulates 5 scenarios:

Scenario Role Decision Rule
List repos developer ALLOW allow-reads
Create PR on protected repo developer REQUIRE APPROVAL require-approval-pr-protected
Merge pull request developer REQUIRE APPROVAL require-approval-merge
Delete repository developer DENY deny-repo-delete
Create issue contributor DENY contributor-read-only

Tool Classifications

13 GitHub tools classified by operation class and risk level:

Tool Operation Risk
github.list_repos read low
github.get_repository read low
github.search_code read low
github.get_pull_request read low
github.list_issues read low
github.create_issue write low
github.create_pull_request write medium
github.merge_pull_request write high
github.delete_branch write medium
github.push_commit write medium
github.delete_repository admin high
github.archive_repository admin high
github.update_repo_settings admin medium

Policy Rules (7)

Rule Action What It Matches
deny-repo-delete deny Repo deletion/archival by non-admins
require-approval-pr-protected require_approval PRs on repos with -protected in name
require-approval-merge require_approval All PR merges
require-approval-branch-delete require_approval All branch deletions
contributor-read-only deny Any non-read operation by contributors
warn-on-writes warn All write operations (monitoring)
allow-reads allow All read operations

Policy Tests

12 test cases verify every decision path:

pnpm test --filter @gate-mcp/policy-testing

Files