Title: Audit and fix missing ReadOnlyHint annotations on read-intent tools · Issue #2483 · github/github-mcp-server · GitHub
Open Graph Title: Audit and fix missing ReadOnlyHint annotations on read-intent tools · Issue #2483 · github/github-mcp-server
X Title: Audit and fix missing ReadOnlyHint annotations on read-intent tools · Issue #2483 · github/github-mcp-server
Description: Problem The Coding Agent runtime's MCP permission gate auto-approves tool calls only when the underlying tool is annotated with ReadOnlyHint: true. Anything else (including undefined / missing annotation, or ReadOnlyHint: false) prompts ...
Open Graph Description: Problem The Coding Agent runtime's MCP permission gate auto-approves tool calls only when the underlying tool is annotated with ReadOnlyHint: true. Anything else (including undefined / missing anno...
X Description: Problem The Coding Agent runtime's MCP permission gate auto-approves tool calls only when the underlying tool is annotated with ReadOnlyHint: true. Anything else (including undefined / missing ...
Opengraph URL: https://github.com/github/github-mcp-server/issues/2483
X: @github
Domain: github.com
{"@context":"https://schema.org","@type":"DiscussionForumPosting","headline":"Audit and fix missing ReadOnlyHint annotations on read-intent tools","articleBody":"## Problem\n\nThe Coding Agent runtime's MCP permission gate auto-approves tool calls only when the underlying tool is annotated with `ReadOnlyHint: true`. Anything else (including `undefined` / missing annotation, or `ReadOnlyHint: false`) prompts the user.\n\nIn production we're seeing read-intent github-mcp-server tools prompting users — for example, callers using the legacy alias `get_review` (now consolidated into `pull_request_read`).\n\nSource flow on the runtime side:\n- `runtime/src/mcp-client/known-mcp-servers.ts:585-596` — `extractMCPToolAnnotations` requires `readOnlyHint` to be a strict `boolean`; missing/non-boolean → `undefined`.\n- `runtime/src/tools/mcp-transport.ts:509` — `readOnly: toolConfig.readOnly ? true : false` collapses `undefined` → `false` → user prompted.\n- `runtime/src/apps/permission-gate.ts` — auto-approves only when `request.readOnly === true`.\n\nPer agreement with the runtime team, defaulting `undefined` to \"read-only\" is **not** the right fix (would over-grant). Instead, ensure the github-mcp-server side is the source of truth.\n\n## What's needed\n\n1. **Audit every tool currently registered by github-mcp-server** for missing or incorrect `Annotations.ReadOnlyHint`. Most existing read-only tools already have this set (verified `pull_request_read`, `issue_triage_context`, `semantic_issues_search`, `package_search`, `dependabot`, `find_closing_pull_requests`, `summarize_actions`). Find the gaps.\n2. **Deprecated tool aliases**: when `DeprecatedToolAliases` (`pkg/github/deprecated_tool_aliases.go`) routes a call from an old name (`get_review`, `list_issues`, etc.) to a new canonical tool (`pull_request_read`, `issue_read`, etc.), make sure the alias's tool descriptor inherits the canonical tool's annotations. Today the aliased tool may be exposed without annotations, defeating the runtime's auto-approve path.\n3. **Consider adding a CI check** that fails if any tool registered via `mcp.NewTool` lacks an explicit `ReadOnlyHint` (true or false). Forcing the choice at registration time prevents future regressions.\n\n## How to verify\n\nQuick way to spot missing annotations in this repo:\n\n```\ngrep -rln 'mcp.NewTool\\|toolset.NewTool' --include='*.go' | grep -v _test | xargs -L1 -I{} sh -c 'grep -L ReadOnlyHint \"{}\"'\n```\n\nRepeat for the deprecated-alias dispatch path.\n\n## Related\n\n- Coding Agent runtime: `runtime/src/mcp-client/{known-mcp-servers.ts,out-of-proc-mcp-host.ts,mcp-registry.ts}` — current consumer of these annotations.\n- Coding Agent permission gate behavior: github/sweagentd `runtime/src/apps/permission-gate.ts`.\n\ncc @ritchxu","author":{"url":"https://github.com/ritchxu","@type":"Person","name":"ritchxu"},"datePublished":"2026-05-15T21:07:35.000Z","interactionStatistic":{"@type":"InteractionCounter","interactionType":"https://schema.org/CommentAction","userInteractionCount":4},"url":"https://github.com/2483/github-mcp-server/issues/2483"}
| route-pattern | /_view_fragments/issues/show/:user_id/:repository/:id/issue_layout(.:format) |
| route-controller | voltron_issues_fragments |
| route-action | issue_layout |
| fetch-nonce | v2:ccc73b1f-2683-f0b2-0cb9-7ec161d0579d |
| current-catalog-service-hash | 81bb79d38c15960b92d99bca9288a9108c7a47b18f2423d0f6438c5b7bcd2114 |
| request-id | C614:166A68:8A2950:C6A5C4:6A6214F7 |
| html-safe-nonce | ed61874f3990234a4b96732422ca42dc505764179ffcc7ef3d7ec92bb9e7d3fd |
| visitor-payload | eyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiJDNjE0OjE2NkE2ODo4QTI5NTA6QzZBNUM0OjZBNjIxNEY3IiwidmlzaXRvcl9pZCI6IjMxMjIxNTIxNTMyMDI5NTU1MTEiLCJyZWdpb25fZWRnZSI6ImlhZCIsInJlZ2lvbl9yZW5kZXIiOiJpYWQifQ== |
| visitor-hmac | 2bb044d155bd2e5c459b87f9d9395b1b8963dd51ca8f0bc3f0c6451750548875 |
| hovercard-subject-tag | issue:4456967897 |
| github-keyboard-shortcuts | repository,issues,copilot |
| google-site-verification | Apib7-x98H0j5cPqHWwSMm6dNU4GmODRoqxLiDzdx9I |
| octolytics-url | https://collector.github.com/github/collect |
| analytics-location | / |
| fb:app_id | 1401488693436528 |
| apple-itunes-app | app-id=1477376905, app-argument=https://github.com/_view_fragments/issues/show/github/github-mcp-server/2483/issue_layout |
| twitter:image | https://opengraph.githubassets.com/6dba838fbfe6ef23a1b99769ed68de025bf390853625ccfb6eaefb2e64b77902/github/github-mcp-server/issues/2483 |
| twitter:card | summary_large_image |
| og:image | https://opengraph.githubassets.com/6dba838fbfe6ef23a1b99769ed68de025bf390853625ccfb6eaefb2e64b77902/github/github-mcp-server/issues/2483 |
| og:image:alt | Problem The Coding Agent runtime's MCP permission gate auto-approves tool calls only when the underlying tool is annotated with ReadOnlyHint: true. Anything else (including undefined / missing anno... |
| og:image:width | 1200 |
| og:image:height | 600 |
| og:site_name | GitHub |
| og:type | object |
| og:author:username | ritchxu |
| hostname | github.com |
| expected-hostname | github.com |
| None | ccf61cb7ab435725b916ed640f57c45b2c4721db9469bc32656080efc5214b3e |
| turbo-cache-control | no-preview |
| go-import | github.com/github/github-mcp-server git https://github.com/github/github-mcp-server.git |
| octolytics-dimension-user_id | 9919 |
| octolytics-dimension-user_login | github |
| octolytics-dimension-repository_id | 942771284 |
| octolytics-dimension-repository_nwo | github/github-mcp-server |
| octolytics-dimension-repository_public | true |
| octolytics-dimension-repository_is_fork | false |
| octolytics-dimension-repository_network_root_id | 942771284 |
| octolytics-dimension-repository_network_root_nwo | github/github-mcp-server |
| turbo-body-classes | logged-out env-production page-responsive |
| disable-turbo | false |
| browser-stats-url | https://api.github.com/_private/browser/stats |
| browser-errors-url | https://api.github.com/_private/browser/errors |
| release | a7585b3d2ee639495a70ce464d0a18bad88ea12c |
| ui-target | full |
| theme-color | #1e2327 |
| color-scheme | light dark |
Links:
Viewport: width=device-width