Skip to main content
Glama

agy-github

Manage GitHub Safely Inside Google Antigravity — Zero-Plaintext OAuth, Official GitHub MCP (48+ Tools) & 4-Tier Turbo Guardrails

Version CI GitHub Stars Node.js >= 20 Runtime Deps Platforms MIT License

English · 简体中文 · What You Can Manage · Quick Start · Architecture · 4-Tier Guardrails · Tool Reference · Policy & CLI · FAQ

agy-github connects Google Antigravity (Desktop 2.0, CLI agy, and IDE) to your full GitHub account through GitHub CLI (gh) OS-keyring OAuth, a zero-dependency local Node.js MCP bridge to GitHub's official remote MCP (https://api.githubcopilot.com/mcp/), a sandbox-safe REST/GraphQL client (github_api), and deterministic 4-tier PreToolUse safety guardrails.

Plaintext Tokens on Disk

Windows Sandbox Proxy TLS

Official Remote MCP + REST/GraphQL

Turbo Mode Safety

0OAuth lives in OS Credential Manager / Keychain

Node fetchNatively trusts NODE_EXTRA_CA_CERTS

46+ Official Tools + github_apiHot-loads via notifications/tools/list_changed

4-Tier PreToolUseForces force_ask on risky ops, deny on token leaks


What You Can Manage in Antigravity

If you use Google Antigravity (Desktop 2.0, CLI agy, or IDE) as your daily AI coding agent, agy-github gives Antigravity full control over your GitHub workflow without sacrificing credential hygiene or safety:

  • No plaintext PATs in mcp_config.json: Avoids static tokens on disk and fixes 404 Dynamic Client Registration (DCR) failures against https://api.githubcopilot.com/mcp/ by reusing your OS-keyring gh OAuth session and hot-loading 46+ official GitHub MCP tools.

  • Works cleanly inside Windows sandbox proxies: Fixes gh.exe x509: certificate signed by unknown authority errors in sandboxed terminals via github_api, powered by Node fetch that natively trusts NODE_EXTRA_CA_CERTS.

  • Safe under Turbo auto-execution: Deterministic 4-tier PreToolUse guardrails keep reads and feature-branch collaboration frictionless, enforce force_ask before irreversible actions, and hard-deny accidental token exfiltration.

Everyday GitHub Management Workflows

Workflow

What Antigravity Can Do for You

Repositories & Account

Audit public & private repos, inspect Stars/topics/API quotas, create repos, and manage visibility, archiving, or transfers (with force_ask confirmation)

Branches, Commits & PRs

Create feature branches, commit/push changes cleanly, open & update Pull Requests, inspect diffs, reply to code reviews, and merge PRs safely

Issues & Code Search

Search code, commits, and Issues across GitHub, triage Issues, add labels/comments, and organize sub-issues

GitHub Actions CI/CD

Inspect workflow runs and job status, troubleshoot failing builds/tests, check workflow permissions, and trigger workflow_dispatch

Releases & Publishing

Tag semver versions, draft bilingual changelogs, and publish official GitHub Releases with native force_ask sign-off

Turbo Guardrails & Secrets

Zero popups for reads & feat/* branches; strict confirmation on main/Secrets/Keys/Webhooks/visibility; hard deny on printing tokens or reading hosts.yml


Related MCP server: GitHub Plus MCP Server

Quick Start

Prerequisites: Node.js >= 20 and GitHub CLI (gh).

1. Install the Plugin

Windows (PowerShell):

irm https://raw.githubusercontent.com/Nodifferentiable/agy-github/main/install.ps1 | iex

macOS / Linux:

curl -fsSL https://raw.githubusercontent.com/Nodifferentiable/agy-github/main/install.sh | sh

Local clone (cross-platform)

git clone https://github.com/Nodifferentiable/agy-github.git
cd agy-github
node scripts/install.mjs install

Per-project install (repository-scoped .agents/plugins/agy-github)

node scripts/install.mjs install --project /path/to/your-repo

Standalone MCP clients (Claude Code, Codex, Cursor, etc.)

node scripts/install.mjs mcp-config

Antigravity CLI

agy plugin install /path/to/agy-github
agy plugin enable agy-github

Let Antigravity install it directly

Clone https://github.com/Nodifferentiable/agy-github.git into ~/.gemini/config/plugins/agy-github, run `node ~/.gemini/config/plugins/agy-github/scripts/install.mjs install`, and verify with github_doctor.

2. One-Time Browser OAuth Login

Run the bundled login helper once in your terminal (this also configures git HTTPS credentials via gh auth setup-git):

Windows (PowerShell):

& "$env:USERPROFILE\.gemini\config\plugins\agy-github\login.ps1"

macOS / Linux:

sh "$HOME/.gemini/config/plugins/agy-github/login.sh"

3. Verify Inside Antigravity

Ask Antigravity to run github_doctor (or invoke /github). Once authenticated, agy-github hot-loads all official remote GitHub MCP tools alongside github_doctor and github_api without restarting Antigravity.


Architecture & Comparison

Dimension

Raw Remote serverUrl

Static PAT in mcp_config.json

Bare gh.exe in Windows Sandbox

agy-github v0.1.0

OAuth Support

Fails when remote MCP lacks DCR (404)

Manual copy-paste

Works outside sandbox only

One-click gh auth login --web + auto hot-load

Secret Storage

Token cache files

Plaintext token on disk

OS credential store

OS Credential Manager / Keychain (0 plaintext on disk)

Windows Sandbox TLS

N/A

N/A

Go gh.exe ignores SSL_CERT_FILE (x509 error)

Node fetch honors NODE_EXTRA_CA_CERTS

Repo Settings / Pagination

Limited

Manual curl

Fails in Windows sandbox

github_api REST (auto Link pagination) + GraphQL

Turbo Mode Safety

None

None

None

4-Tier PreToolUse + subshell unwrapping + SSRF guard


4-Tier PreToolUse Safety Model

Designed specifically for autonomous Turbo workflows (rules/AGENTS.md soft guidance + hooks.json hard enforcement across run_command, mcp_agy-github_github_*, call_mcp_tool, mcp_agy-fast_fast_run_checks, and mcp_agy-fast_fast_apply_edits.verify):

Tier

Covered Operations

Hook Output

Effect

Tier 0 · Read & Diagnostics

Repo/PR/Issue/Actions reads, git status/diff/log/clone/fetch, github_doctor, github_api (GET/HEAD / GraphQL query)

{"decision":"allow"}

Zero prompt friction

Tier 1 · Feature Branch Work

Creating branches, pushing feat/* / fix/*, opening Issues/PRs, creating private repos (private: true) or draft releases

{"decision":"allow"}

Allowed smoothly; AGENTS.md enforces clean commits

Tier 2 · High-Risk / Irreversible

Deleting/archiving/renaming/transferring repos, changing visibility, creating public repos, git push -f / -uf / --all / +ref / :ref, writing to main/master/prod/production/release, merging PRs, editing Secrets/Keys/Webhooks/Environments/Rulesets, publishing non-draft Releases

force_ask

Ignores cached approvals & Turbo mode — always shows native confirmation

Tier 3 · Token Exfiltration

Printing gh auth token, gh auth status --show-token, git credential fill, reading hosts.yml / mcp_oauth_tokens.json, reading GH_TOKEN / GITHUB_TOKEN / AGY_GITHUB_TOKEN

deny

Hard-blocked so tokens never enter chat or cloud context

Defense-in-Depth Runtime Protections

  • Subshell & wrapper unwrapping: Recursively inspects $(...), backtick substitutions, cmd /c, sh -c / bash -c, powershell -Command, and decodes UTF-16LE Base64 -EncodedCommand (or forces force_ask if opaque).

  • SSRF & cross-origin redirect protection: scripts/mcp-server.mjs enforces a strict host allowlist (api.github.com for REST/GraphQL, api.githubcopilot.com for remote MCP) with redirect: "manual", re-validating every redirect hop and paginated Link rel="next" URL before sending Authorization: Bearer.

  • Error redaction & UTF-8 safe bounding: Scrubs any token patterns or Bearer headers from error output (redactSecrets) and bounds large responses safely on UTF-8 boundaries (maxOutputBytes, default 65536 bytes).


Tool & Capability Catalog

Built-in Eager Tools (mcp_config.json)

Tool

Purpose

Key Parameters

github_doctor

Inspects gh CLI path/version, authenticated login & OAuth scopes, API quota, remote MCP connection/tool count, git credential helpers, and effective guardrail policy (token masked).

refresh?: boolean

github_api

Executes any GitHub REST v3 request or GraphQL v4 query/mutation via sandbox-safe Node fetch.

method, endpoint, query, body, graphql, variables, paginate, maxPages

Proxied Official GitHub Remote MCP Tools (46+ Lazy-Loaded Tools)

Once authenticated, https://api.githubcopilot.com/mcp/ tools hot-load automatically covering repositories, branches, commits, files (create_or_update_file, push_files, delete_file), Issues, Pull Requests (create_pull_request, merge_pull_request, reviews), code search, users/teams, releases/tags, and Copilot/security scanning. Optional toolset filtering is supported via AGY_GITHUB_TOOLSETS or toolsets in policy.json.


Policy & CLI Reference

Daily Prompts Inside Antigravity

  • "Run github_doctor to verify my GitHub login, OAuth scopes, and remote MCP tools."

  • "List my recent public and private repositories along with open PRs using github_api."

  • "Create a feat/ci-fix branch, commit the changes without touching .env, push, and open a PR."

Terminal Management CLI (scripts/install.mjs)

# Inspect active guardrail policy
node ~/.gemini/config/plugins/agy-github/scripts/install.mjs policy --show

# Allow direct pushes to main on solo repos while keeping PR merge & delete prompts
node ~/.gemini/config/plugins/agy-github/scripts/install.mjs policy --confirm-main off --confirm-merge on

# Customize protected branches or UTF-8 output limit (4096..524288 bytes)
node ~/.gemini/config/plugins/agy-github/scripts/install.mjs policy --protected-branches main,master,release --max-bytes 65536

# Reset overrides back to strict defaults
node ~/.gemini/config/plugins/agy-github/scripts/install.mjs policy --reset

# Full plugin + LS + gh + git diagnostics
node ~/.gemini/config/plugins/agy-github/scripts/install.mjs doctor

Policy File & Environment Variables

Settings file: ~/.gemini/config/agy-github-policy.json (or ${PLUGIN_DATA}/policy.json):

Key

Default

Description

protectedBranches

["main","master","prod","production","release"]

Branches triggering force_ask on direct push/write

confirmProtectedBranchWrite

true

Require force_ask when pushing/writing to protected branches

confirmPullRequestMerge

true

Require force_ask on merge_pull_request / gh pr merge

confirmRepoVisibilityChange

true

Require force_ask on visibility changes & public repo creation

confirmRepoDeleteOrTransfer

true

Require force_ask on repo delete/archive/rename/transfer

confirmForcePushAndRefDelete

true

Require force_ask on --force / -uf / +ref / :ref

confirmSecretsAndSecurity

true

Require force_ask on Secrets/Keys/Webhooks/Environments/Rulesets

confirmPublicRelease

true

Require force_ask on non-draft Release creation or deletion

blockTokenExfiltration

true

Hard deny commands exposing GitHub tokens or hosts.yml

maxOutputBytes

65536

UTF-8 byte ceiling (4096..524288; override via AGY_GITHUB_MAX_BYTES)

Direct --cli Mode (Swarm & Automation)

Subagents without MCP access can invoke the bridge directly (still audited by PreToolUse when run via run_command or agy-fast):

node ~/.gemini/config/plugins/agy-github/scripts/mcp-server.mjs --cli doctor
node ~/.gemini/config/plugins/agy-github/scripts/mcp-server.mjs --cli api GET "/user/repos?sort=updated&per_page=10"
node ~/.gemini/config/plugins/agy-github/scripts/mcp-server.mjs --cli graphql "query { viewer { login } }"

FAQ & Troubleshooting

This is expected when gh.exe runs inside a sandboxed local proxy whose CA is passed via NODE_EXTRA_CA_CERTS / SSL_CERT_FILE. Use github_api instead of shelling out to gh api — github_api uses Node's fetch which honors NODE_EXTRA_CA_CERTS.

When unauthenticated, agy-github intentionally degrades cleanly to github_doctor and github_api. Run login.ps1 / login.sh, wait a few seconds (or call github_doctor(refresh: true)), and the bridge automatically sends notifications/tools/list_changed to hot-load all 46+ official remote MCP tools.

See rules/AGENTS.md for the always-on routing & hygiene rules and skills/github/SKILL.md for the /github runbook.


  • agy-cua-desktop — Script-first, background-first desktop GUI automation with <150 ms COM introspection, compact 2-tier MCP bridge, and Turbo guardrails.

Contributing, Security & Star Support

If agy-github saves you from token headaches or risky Turbo mishaps, please consider giving the repo a ⭐ on GitHub — it helps more Antigravity developers discover it!

Tool Schema Changelog

Recent tool additions, removals, and schema changes observed during successful MCP inspections.

Loading tool schema changelog…

    Related MCP Connectors

    Related MCP Servers

    • F
      license
      Not graded
      quality
      C
      maintenance
      Enables GitHub repository operations (list/read files, create branches, commit files, open/list PRs) via an authless remote MCP server that keeps your GitHub token encrypted on Cloudflare, with access limited to allowed repositories.
      -
    • A
      license
      A
      quality
      C
      maintenance
      Enables any MCP client to read GitHub repositories, branches, tags, pull requests, files and Actions workflow runs, and optionally create branches and pull requests, comment, assign, approve, trigger workflows, merge and delete. Read-only by default, with separate opt-in switches for write and destructive operations, working against github.com or GitHub Enterprise Server.
      11
      MIT
    • A
      license
      A
      quality
      C
      maintenance
      Enables AI assistants and MCP hosts to inspect GitHub repositories, pull requests, issues, and activity, and to create issues through schema-validated tools, resources, and prompts, with write actions gated by host or CLI confirmation.
      5
      MIT
    • A
      license
      B
      quality
      B
      maintenance
      Enables AI agents to use GitHub through MCP while enforcing flow tracking, default-deny policy, human approvals, tamper-evident audit logging, and short-lived scoped tokens to block private-to-public leaks. Currently pre-alpha with only a placeholder tool.
      1
      53 PyPI
      1
      MIT