Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Adds
--read-only-toolsetsandGITHUB_READ_ONLY_TOOLSETSto restrict writes in selected toolsets while keeping other enabled toolsets writable. Supports stdio, self-hosted HTTP, andlist-scopes.Why
Global read-only mode blocks every write tool, preventing mixed configurations such as writable repositories with read-only issues and pull requests.
Fixes #3229
What changed
MCP impact
Configured toolsets omit write tools from registration, so those tools cannot be listed or called. Tool schemas and default behavior remain unchanged.
Prompts tested (tool changes only)
Tested in Codex with the locally built server connected as
github_3229_local, using--toolsets=repos,issues,pull_requests --read-only-toolsets=issues,pull_requests:github_3229_local, read github/github-mcp-server issue Feature: per-toolset (or per-tool) read-only mode instead of global GITHUB_READ_ONLY #3229 and summarize it.” — Issue read succeeded.github_3229_local, check whether you can post an issue comment or merge a PR. Don’t use shell commands or other connectors.” — Comment and merge tools were unavailable.push_filesis available throughgithub_3229_local, without executing it.” — Repository write tool remained available; no write was performed.Direct MCP
tools/listand blockedtools/callrequests were also tested using both CLI and environment configuration.Security / limits
Global read-only remains authoritative. This setting does not alter GitHub token permissions.
Explicit tool selection and HTTP request configuration cannot restore restricted writes. Unknown policy names fail validation; tools without read-only annotations are blocked in restricted toolsets.
Tool renaming
deprecated_tool_aliases.goExisting tool names remain unchanged.
Lint & tests
./script/lint./script/testRan the checks directly with Go 1.25.12:
golangci-lint runreported zero issues;go test ./...passed. Fresh focused tests and race tests for inventory, HTTP, and CLI packages also passed, as didgit diff --check.Docs
Updated
README.mdanddocs/server-configuration.mdwith configuration examples, precedence rules, validation, and HTTP behavior.