You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Feature: per-toolset (or per-tool) read-only mode instead of global GITHUB_READ_ONLY #3229
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
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:
Per-toolset read-only, e.g. GITHUB_READ_ONLY_TOOLSETS=issues,pull_requests (writes rejected only for the listed toolsets), or
Per-tool read-only overrides, e.g. a GITHUB_READ_ONLY_TOOLS=merge_pull_request,create_issue deny list, or
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).
Hello, I’d like to take this up. I’m thinking to implement option 1 through the existing centralized inventory filtering. Would that work? Also, is anyone already working on it, or would it be okay for me to proceed?
I’ve opened #3282 implementing per-toolset read-only configuration through the existing inventory filtering. It supports configurations such as writable repositories with read-only issues and pull requests, with tests and configuration examples included.
Until per-toolset read-only lands (#3282), the "writes need approval" half can live in the client, where it applies per call: Claude Code, for example, takes per-tool ask entries such as mcp__github__merge_pull_request in its permissions, so reads run and each listed write asks. Keep the token's scopes as the backstop for writes you never want. A client prompt is only as firm as the client's permission mode, so for unattended runs the check is safer in a hook that blocks the write unless a person approved that exact call. I maintain Tracekit (https://github.com/Cygnux-Labs/Tracekit), whose Claude Code hook does that: one rule on those tool names holds each write until a person approves it from another terminal, the approval covers only those arguments and is used once, and every call and decision is signed into a log.
Option 1 (per-toolset, keyed off GITHUB_TOOLSETS) is the right shape, but I'd add one requirement: enforcement must stay server-side. Client-side permission prompts are not a boundary — permission modes can be bypassed, and the dual-instance workaround in the issue description already shows that a convention alone doesn't stop an agent from calling a write tool.
Concretely: (a) default deny for a read-only toolset, (b) emit annotations.readOnlyHint on tools/list so clients can auto-approve reads, and (c) reject any non-read tool for that toolset at dispatch time, not just filter it from the inventory. A separate "write-confirm" layer belongs in the client/hook as UX, with the server refusal as the backstop.
I maintain a small local MCP server with exactly this split (one tool, readOnlyHint: true, no write tools at all), and keeping the write decision outside the server removes a whole class of TOCTOU issues. Happy to share the tool-annotation shape if it's useful for #3282.
Activity
adbcodes commentedon Sep 9, 2026
Hello, I’d like to take this up. I’m thinking to implement option 1 through the existing centralized inventory filtering. Would that work? Also, is anyone already working on it, or would it be okay for me to proceed?
adbcodes commentedon Sep 17, 2026
I’ve opened #3282 implementing per-toolset read-only configuration through the existing inventory filtering. It supports configurations such as writable repositories with read-only issues and pull requests, with tests and configuration examples included.
LoopGlitch26 commentedon Nov 2, 2026
Until per-toolset read-only lands (#3282), the "writes need approval" half can live in the client, where it applies per call: Claude Code, for example, takes per-tool
askentries such asmcp__github__merge_pull_requestin its permissions, so reads run and each listed write asks. Keep the token's scopes as the backstop for writes you never want. A client prompt is only as firm as the client's permission mode, so for unattended runs the check is safer in a hook that blocks the write unless a person approved that exact call. I maintain Tracekit (https://github.com/Cygnux-Labs/Tracekit), whose Claude Code hook does that: one rule on those tool names holds each write until a person approves it from another terminal, the approval covers only those arguments and is used once, and every call and decision is signed into a log.2648782102 commentedon Nov 14, 2026
Option 1 (per-toolset, keyed off
GITHUB_TOOLSETS) is the right shape, but I'd add one requirement: enforcement must stay server-side. Client-side permission prompts are not a boundary — permission modes can be bypassed, and the dual-instance workaround in the issue description already shows that a convention alone doesn't stop an agent from calling a write tool.Concretely: (a) default deny for a read-only toolset, (b) emit
annotations.readOnlyHintontools/listso clients can auto-approve reads, and (c) reject any non-read tool for that toolset at dispatch time, not just filter it from the inventory. A separate "write-confirm" layer belongs in the client/hook as UX, with the server refusal as the backstop.I maintain a small local MCP server with exactly this split (one tool,
readOnlyHint: true, no write tools at all), and keeping the write decision outside the server removes a whole class of TOCTOU issues. Happy to share the tool-annotation shape if it's useful for #3282.