GitHub Flow MCP

GitHub Flow MCP

A policy-aware MCP server for GitHub and GitHub Actions that enables safe AI-assisted infrastructure workflows—inspecting repositories, preparing branches and pull requests, and constrained remote mutations behind explicit preview-bound approval tokens.

Category
访问服务器

README

GitHub Flow MCP

Português (Brasil)

A policy-aware Model Context Protocol server for GitHub and GitHub Actions workflows. It is designed for AI-assisted infrastructure work where agents can inspect repositories and prepare changes, while remote mutations remain constrained by explicit preview-bound approval.

GitHub Flow MCP architecture

Why this exists

AI agents are useful at collecting context and preparing repetitive Git operations, but infrastructure workflows still need reviewability and guardrails. This MCP exposes a deliberately small GitHub surface:

  • repository, branch, pull request, review, and Actions inspection
  • local Git inspection without silent branch/commit/push/merge operations
  • branch and pull-request previews
  • short-lived, single-use confirmation tokens bound to the exact preview
  • optional Basecamp linkage
  • optional repository-specific label and reviewer policy
  • no merge tool, no branch deletion, no branch-protection changes, and no API-created commits

Safety model

Remote write tools are not registered unless:

GITHUB_WRITE_ENABLED=true

When enabled, branch creation, pull-request creation, and PR comments still require a confirmation_id returned by their matching preview. The token is short-lived, single-use, and bound to the exact payload. If a branch source SHA, PR body, label set, reviewer set, or comment changes, a new preview is required.

[!NOTE] The MCP enforces preview-before-write and exact payload binding. The MCP host should only forward the confirmation_id after actual human approval.

Installation

uv tool install git+https://github.com/thiagorchaves/github-flow-mcp.git

For development:

git clone https://github.com/thiagorchaves/github-flow-mcp.git
cd github-flow-mcp
uv sync --extra dev

Configuration

cp .env.example .env
chmod 600 .env

Use a fine-grained GitHub token with the minimum repositories and permissions needed. Typical permissions are Metadata read, Contents read/write for branch creation, Pull requests read/write, Issues read/write for labels/comments, Actions read, and Members read only when reviewer availability checks are required.

Organization-specific policy belongs in your local .env, not in the public repository. For example, you can require Basecamp links, configure a production branch marker, or require an AI-review label for selected repositories.

Kiro / MCP host example

{
  "mcpServers": {
    "github-flow": {
      "command": "uvx",
      "args": ["--from", "git+https://github.com/thiagorchaves/github-flow-mcp.git", "github-flow-mcp"],
      "env": {
        "GITHUB_TOKEN": "${GITHUB_TOKEN}",
        "GITHUB_DEFAULT_OWNER": "${GITHUB_DEFAULT_OWNER}",
        "GITHUB_INITIALS": "tc",
        "GITHUB_DEFAULT_BASE_BRANCH": "main",
        "GITHUB_LOCAL_REPOS_ROOT": "${HOME}/Projects",
        "GITHUB_WRITE_ENABLED": "false",
        "GITHUB_CONFIRMATION_TTL_SECONDS": "300"
      },
      "autoApprove": []
    }
  }
}

Tools

Read and diagnostics

  • healthcheck
  • get_authenticated_user
  • get_repository
  • list_branches
  • get_collaborator_permission
  • inspect_local_repository
  • list_pull_requests
  • get_pull_request
  • list_pull_request_files
  • list_pull_request_reviews
  • list_workflows
  • list_workflow_runs

Preview

  • preview_branch_name
  • preview_local_commit
  • preview_remote_branch
  • preview_pull_request
  • preview_pull_request_comment

Remote writes, registered only when enabled

  • create_remote_branch
  • create_pull_request
  • add_pull_request_comment

Basecamp handoff

  • build_basecamp_pr_update

This tool only generates Markdown. A Basecamp MCP can independently preview and publish that update.

Recommended workflow

  1. Retrieve the work-item context.
  2. Inspect the local repository without modifying it.
  3. Preview the branch and show it to the user.
  4. After approval, use the preview token to create the remote branch if needed.
  5. Edit and commit locally using your normal signed Git workflow.
  6. Push the branch.
  7. Preview the pull request.
  8. After approval, use its token to open the PR.
  9. Let humans review the PR and apply the infrastructure change through the normal delivery process.

Development

uv sync --extra dev
uv run ruff format --check .
uv run ruff check .
uv run mypy github_flow_mcp
uv run pytest

Security

Never commit .env, GitHub tokens, internal repository data, company-specific paths, or private work-item URLs. See SECURITY.md.

License

MIT. See LICENSE.

推荐服务器

Baidu Map

Baidu Map

百度地图核心API现已全面兼容MCP协议,是国内首家兼容MCP协议的地图服务商。

官方
精选
JavaScript
Playwright MCP Server

Playwright MCP Server

一个模型上下文协议服务器,它使大型语言模型能够通过结构化的可访问性快照与网页进行交互,而无需视觉模型或屏幕截图。

官方
精选
TypeScript
Magic Component Platform (MCP)

Magic Component Platform (MCP)

一个由人工智能驱动的工具,可以从自然语言描述生成现代化的用户界面组件,并与流行的集成开发环境(IDE)集成,从而简化用户界面开发流程。

官方
精选
本地
TypeScript
Audiense Insights MCP Server

Audiense Insights MCP Server

通过模型上下文协议启用与 Audiense Insights 账户的交互,从而促进营销洞察和受众数据的提取和分析,包括人口统计信息、行为和影响者互动。

官方
精选
本地
TypeScript
VeyraX

VeyraX

一个单一的 MCP 工具,连接你所有喜爱的工具:Gmail、日历以及其他 40 多个工具。

官方
精选
本地
graphlit-mcp-server

graphlit-mcp-server

模型上下文协议 (MCP) 服务器实现了 MCP 客户端与 Graphlit 服务之间的集成。 除了网络爬取之外,还可以将任何内容(从 Slack 到 Gmail 再到播客订阅源)导入到 Graphlit 项目中,然后从 MCP 客户端检索相关内容。

官方
精选
TypeScript
Kagi MCP Server

Kagi MCP Server

一个 MCP 服务器,集成了 Kagi 搜索功能和 Claude AI,使 Claude 能够在回答需要最新信息的问题时执行实时网络搜索。

官方
精选
Python
e2b-mcp-server

e2b-mcp-server

使用 MCP 通过 e2b 运行代码。

官方
精选
Neon MCP Server

Neon MCP Server

用于与 Neon 管理 API 和数据库交互的 MCP 服务器

官方
精选
Exa MCP Server

Exa MCP Server

模型上下文协议(MCP)服务器允许像 Claude 这样的 AI 助手使用 Exa AI 搜索 API 进行网络搜索。这种设置允许 AI 模型以安全和受控的方式获取实时的网络信息。

官方
精选