Feature: per-toolset (or per-tool) read-only mode instead of global GITHUB_READ_ONLY

未关闭
#3,229 2 条评论 0 个 reaction 已指派 0 人 在 GitHub 查看

还没有人认领这个 Issue。

评估

难度
5/5
预计耗时
一周以上
新手友好度
42/100
Issue 类型
功能
描述清晰度
基本清楚
活跃度
活跃
技术栈
github, go

调研方向

首先跟踪服务器如何处理 GITHUB_READ_ONLY 和现有的 GITHUB_TOOLSETS 配置,然后确定写入工具在哪里进行分发。将按 toolset 和按 tool 提出的 scope 与当前配置行为进行比较。完成的标准是:选定的写入操作会被拒绝,同时读取操作和明确允许的写入操作继续正常工作,并且为所选配置提供覆盖。

由索引模型根据 Issue 内容生成。

描述

enhancement policies & governance
Feature request

GITHUB_READ_ONLY is currently all-or-nothing: when set, the whole server rejects every write operation. There is no way to keep some domains writable while others stay read-only.

Use case

Running the server as a local coding-agent tool with a single GitHub token, I want a common "safe by default" posture:

  • Reads everywhere (repos, issues, pull requests) allowed without human confirmation
  • Writes (merge PR, close/label issues, push comments) gated behind explicit user approval

Today the only way to approximate this is to launch two full server instances — one with GITHUB_READ_ONLY=1 and one without — and rely on agent-side conventions to route writes to the second instance. That is fragile because nothing on the server side prevents an agent from calling write tools on the writable instance, and it doubles the tool surface / process count.

Proposed solution

Any of the following would fix it:

  1. Per-toolset read-only, e.g. GITHUB_READ_ONLY_TOOLSETS=issues,pull_requests (writes rejected only for the listed toolsets), or
  2. Per-tool read-only overrides, e.g. a GITHUB_READ_ONLY_TOOLS=merge_pull_request,create_issue deny list, or
  3. A "write-confirm" layer that rejects write tools unless an opt-in env var for that specific call is present.

Option 1 seems the most consistent with the existing GITHUB_TOOLSETS design.

Alternatives considered
  • Token scoping (fine-grained PAT without write scopes): does not help, because the same token is also expected to perform approved writes.
  • Dual-instance setup: works only as a convention, not enforcement (described above).
主要语言
Go
星标
33.1k
派生
5k
平均合并
2 天 15 小时
30 天内合并 PR
27

贡献指南

打开贡献指南

从这里开始

  1. 先读完整个 Issue,再读项目的贡献指南。
  2. 在 Issue 下留言说明你要接手 —— 这能避免两个人做同样的事。
  3. Fork 仓库,在一个分支上完成修改。
  4. 提交 Pull Request,并在描述里引用这个 Issue 编号。

github/github-mcp-server 的其他 Issue

查看 github/github-mcp-server 的全部 Issue

相似的 Issue

更多 Go Issue

把新 issue 发到你的邮箱

精选适合新手参与的 GitHub issue 摘要。