{
  "markdown": "<div align=\"center\">\n\n# 🔌 ghcli-mcp-connector\n\n**Talk to the GitHub CLI (`gh`) from an MCP-speaking agent.**\n\n[![CI](https://github.com/FerhatDundar/ghcli-mcp-connector/actions/workflows/ci.yml/badge.svg)](https://github.com/FerhatDundar/ghcli-mcp-connector/actions/workflows/ci.yml)\n[![CodeQL](https://github.com/FerhatDundar/ghcli-mcp-connector/actions/workflows/codeql.yml/badge.svg)](https://github.com/FerhatDundar/ghcli-mcp-connector/actions/workflows/codeql.yml)\n[![Latest release](https://img.shields.io/github/v/release/FerhatDundar/ghcli-mcp-connector?color=blueviolet&label=release)](https://github.com/FerhatDundar/ghcli-mcp-connector/releases/latest)\n[![MCP Registry](https://img.shields.io/badge/dynamic/json?url=https%3A%2F%2Fregistry.modelcontextprotocol.io%2Fv0%2Fservers%3Fsearch%3Dghcli-mcp-connector&query=%24.servers%5B-1%3A%5D.server.version&label=MCP%20Registry&prefix=v&color=6A2FEE&logo=modelcontextprotocol)](https://registry.modelcontextprotocol.io/?q=ghcli-mcp-connector)\n[![Go Reference](https://img.shields.io/badge/go-1.25%2B-00ADD8?logo=go&logoColor=white)](https://go.dev/)\n[![License: MIT](https://img.shields.io/badge/license-MIT-yellow.svg)](LICENSE)\n[![MCP](https://img.shields.io/badge/protocol-MCP-orange)](https://modelcontextprotocol.io/)\n[![Conventional Commits](https://img.shields.io/badge/commits-conventional-ff69b4)](https://www.conventionalcommits.org/)\n[![PRs Welcome](https://img.shields.io/badge/PRs-welcome-brightgreen.svg)](CONTRIBUTING.md)\n\n</div>\n\n---\n\nA single static Go binary that speaks the [Model Context Protocol](https://modelcontextprotocol.io/)\nand lets an agent run GitHub CLI commands: any `gh <command> <subcommand>`\ninvocation — `repo`, `issue`, `pr`, `release`, `gist`, `workflow`, `run`,\n`secret`, `variable`, `project`, `ruleset`, `codespace`, `extension`, `api`,\nand more — with a read-only-by-default safety gate on anything that\nchanges state on GitHub.\n\nNo Python, no `uv`, no runtime dependency to install — just a binary and\nan `.mcp.json`. It shells out to the `gh` binary already installed and\nauthenticated on the host (`gh auth login`, stored in the OS keychain, or\n`GH_TOKEN`/`GITHUB_TOKEN`) instead of reimplementing a GitHub API client,\nso it gets the full breadth of the CLI for free rather than a hand-curated\nsubset of endpoints.\n\n> **Note:** this is a sibling of [github-mcp-connector](https://github.com/FerhatDundar/github-mcp-connector),\n> not a replacement. That one talks to the GitHub REST API directly via\n> `google/go-github` with a curated set of 18 tools. This one shells out to\n> the `gh` CLI itself — same trade-off as `aws-mcp-connector` vs. a\n> hand-written AWS SDK client: broader coverage (gh extensions, gh's own\n> filters/formatting, workflow/run/codespace/project/ruleset management)\n> through a single `ghcli_exec` escape hatch, instead of a curated surface.\n\n## ✨ Why this exists\n\n> An agent that only has a narrow, hand-picked set of GitHub tools hits a\n> wall the moment you need something outside that set. This connector\n> instead wraps the `gh` CLI itself, so an agent can run `gh pr list`,\n> `gh issue create`, `gh workflow run`, `gh api repos/owner/repo/issues` —\n> anything the CLI can do — without waiting on a new tool to be written\n> for it. State-changing commands are blocked by default and require both\n> a server-level opt-in and a per-call `confirm=true`, so exploring/\n> reading is safe out of the box.\n\n## 🧰 Tools\n\n| Tool | What it does | Write? |\n|---|---|:---:|\n| `ghcli_exec` | Run any `gh <command> <subcommand> ...` command. Read-only by default — commands that change GitHub state need `GHCLI_MCP_ALLOW_WRITE=true` on the server *and* `confirm=true` on the call. | ✅ (gated) |\n| `ghcli_help` | Show `gh <command> [subcommand] --help` text — always safe, use it to check exact syntax before calling `ghcli_exec`. | |\n| `ghcli_whoami` | Show the GitHub identity (login, name, profile URL) the configured auth resolves to. | |\n\nEvery tool accepts an optional `response_format`: `markdown` (default,\nreadable for a chat UI) or `json` (for programmatic use).\n\nThis server has no working-directory git repo, so repo-scoped commands\nneed an explicit `-R`/`--repo owner/repo` rather than relying on gh's\ncwd-based repo detection.\n\n## 🚀 Quickstart\n\n**Fastest path:** grab a prebuilt bundle from the [latest release](https://github.com/FerhatDundar/ghcli-mcp-connector/releases/latest) —\ndownload `ghcli-mcp-connector-plugin-<version>-<os>-<arch>.zip`, unzip it,\nand point Cowork/Claude at the `plugin/` folder inside (see step 4 of\n[SETUP.md](SETUP.md)). No Go toolchain required.\n\n**From source:**\n\n```bash\n# 1. Build\ncd go-server\ngo mod tidy\ngo build -o ghcli-connector-server .\ncp ghcli-connector-server ../plugin/servers/go/\n\n# 2. Set up auth — needs the gh CLI itself installed and logged in\n#    (gh auth login) — see SETUP.md\ngh auth status   # should succeed before running the server\n\n# 3. Run\n./go-server/ghcli-connector-server   # serves MCP over stdio\n```\n\nOr `make build` — see the [Makefile](Makefile) for every shortcut\n(`test`, `vet`, `fmt`, `lint`, `tidy`).\n\nFull walkthrough — including wiring this up as a Claude/Cowork plugin — is\nin **[SETUP.md](SETUP.md)**.\n\n## 🔐 Configuration\n\nEverything is environment variables, passed through by the plugin's\n`.mcp.json`:\n\n| Variable | Purpose | Default |\n|---|---|---|\n| `GH_TOKEN` / `GITHUB_TOKEN` | gh CLI's own token env vars. Leave unset to use whatever `gh auth login` already configured. | unset (keychain auth) |\n| `GH_HOST` | Target a GitHub Enterprise hostname instead of github.com. | unset (github.com) |\n| `GHCLI_MCP_ALLOW_WRITE` | `\"true\"` to permit state-changing commands at all (still needs `confirm=true` per call). | `false` (read-only) |\n| `GHCLI_MCP_ALLOWED_REPOS` | Comma-separated allowlist of `owner/repo` values, e.g. `\"me/proj,me/other\"`. Only enforced when a call passes an explicit `-R`/`--repo` flag. | unset (unrestricted) |\n| `GHCLI_MCP_CLI_PATH` | Path to the `gh` binary. | `gh` resolved via `PATH` |\n\n## 🧪 Quality bar\n\nThis isn't a toy script — it's got the same checks you'd expect from a\nproduction Go service:\n\n- ✅ **Unit tests** for every input-validation path (`go test ./...`)\n- ✅ **`go vet`** + **`gofmt`** clean\n- ✅ **[golangci-lint](https://golangci-lint.run/)** (govet, staticcheck, errcheck, gosec, and more)\n- ✅ **[govulncheck](https://go.dev/blog/vuln)** — no known vulnerabilities in the dependency graph\n- ✅ **[CodeQL](https://codeql.github.com/)** static security analysis on every push\n- ✅ **End-to-end verified** against real GitHub during development — not mocks\n- ✅ **[Dependabot](.github/dependabot.yml)** keeps Go modules and Actions current\n\nAll of it runs in [CI](.github/workflows/ci.yml) on every push and PR.\n\n## 🏷️ Releases & versioning\n\nVersions follow [semver](https://semver.org/) and are cut automatically by\n[release-please](https://github.com/googleapis/release-please) from\n[Conventional Commits](https://www.conventionalcommits.org/) on `main`:\n\n- `fix: ...` → patch (`v0.1.0` → `v0.1.1`)\n- `feat: ...` → minor (`v0.1.1` → `v0.2.0`)\n- `feat!: ...` / `BREAKING CHANGE:` footer → major (`v0.2.0` → `v1.0.0`)\n\nEvery merged PR updates a standing **\"chore(main): release vX.Y.Z\"** PR\nwith an auto-generated [CHANGELOG.md](CHANGELOG.md). Merging that PR:\n\n1. tags the release and publishes it on GitHub\n2. builds and attaches zipped, ready-to-install plugin bundles for\n   linux/darwin/windows × amd64/arm64\n3. regenerates `server.json` from those exact assets (fresh version +\n   SHA-256 hashes) and publishes it to the\n   [official MCP Registry](https://registry.modelcontextprotocol.io/) via\n   `mcp-publisher`, authenticated with GitHub OIDC — no stored secrets\n\nSee [.github/workflows/release-please.yml](.github/workflows/release-please.yml)\nand [.github/workflows/publish-mcp-registry.yml](.github/workflows/publish-mcp-registry.yml)\n(also runnable by hand for an existing tag via `workflow_dispatch`).\n\n## 📁 Layout\n\n```\nghcli-mcp-connector/\n├── README.md                  ← you are here\n├── SETUP.md                   ← step-by-step setup guide\n├── CONTRIBUTING.md             ← how to contribute\n├── CODE_OF_CONDUCT.md\n├── SECURITY.md                 ← vulnerability reporting\n├── CODEOWNERS\n├── LICENSE                     ← MIT\n├── Makefile                    ← build / test / lint shortcuts\n├── .golangci.yml                ← lint rules\n├── release-please-config.json  ← semver/changelog automation config\n├── .release-please-manifest.json\n├── server.json                  ← MCP Registry manifest (regenerated fresh per release by CI)\n├── scripts/\n│   └── render-server-json.sh    ← rebuilds server.json from a release's zip assets\n├── .github/\n│   ├── workflows/\n│   │   ├── ci.yml                     ← build, vet, test, lint, govulncheck\n│   │   ├── codeql.yml                 ← security scanning\n│   │   ├── pr-title.yml               ← Conventional Commits PR title check\n│   │   ├── release-please.yml         ← version PRs, tagging, GitHub releases\n│   │   ├── publish-mcp-registry.yml   ← publishes server.json to the MCP Registry\n│   │   └── rebuild-release-assets.yml ← manual re-attach fallback\n│   ├── ISSUE_TEMPLATE/\n│   ├── PULL_REQUEST_TEMPLATE.md\n│   └── dependabot.yml\n├── go-server/                  ← the MCP server source\n│   ├── main.go\n│   ├── main_test.go\n│   ├── go.mod / go.sum\n│   └── README.md\n└── plugin/                     ← installable Cowork/Claude plugin\n    ├── .claude-plugin/plugin.json\n    ├── .mcp.json                ← holds credentials locally — never commit real ones\n    ├── skills/ghcli-mcp/SKILL.md ← teaches Claude when/how to use the tools\n    └── servers/go/              ← compiled binary goes here\n```\n\n## 🤝 Contributing\n\nPRs and issues are very welcome — see **[CONTRIBUTING.md](CONTRIBUTING.md)**\nfor the full guide (setup, coding conventions, how to add a new tool) and\nthe **[Code of Conduct](CODE_OF_CONDUCT.md)**.\n\n`main` is protected: every change, including the maintainer's, lands via\npull request with CI green. PR titles must follow\n[Conventional Commits](https://www.conventionalcommits.org/) — that's what\ndrives the automatic versioning above.\n\nFound a security issue? Please follow **[SECURITY.md](SECURITY.md)**\ninstead of opening a public issue.\n\n## 📄 License\n\n[MIT](LICENSE) © FerhatDundar\n",
  "bytes": 10326,
  "sha": "806356295546873e6fcf2c722c62cef41efa3b796417324bbfe260a249632a96",
  "repo_slug": "ferhatdundar/ghcli-mcp-connector",
  "fonte": "repo",
  "truncated": false,
  "api": "https://agentalog.com/api/listings/mcp_io_github_ferhatdundar_ghcli_mcp_connect_4d1f2ad9/readme"
}