Title: MCP App UI resources for write tools are registered in --read-only mode · Issue #2519 · github/github-mcp-server · GitHub
Open Graph Title: MCP App UI resources for write tools are registered in --read-only mode · Issue #2519 · github/github-mcp-server
X Title: MCP App UI resources for write tools are registered in --read-only mode · Issue #2519 · github/github-mcp-server
Description: Summary When the server is started with --read-only and MCP Apps are enabled, write-tool UI form resources (issue_write_ui, pr_write_ui) are still registered and served, even though the underlying write tools (create_issue, update_issue,...
Open Graph Description: Summary When the server is started with --read-only and MCP Apps are enabled, write-tool UI form resources (issue_write_ui, pr_write_ui) are still registered and served, even though the underlying ...
X Description: Summary When the server is started with --read-only and MCP Apps are enabled, write-tool UI form resources (issue_write_ui, pr_write_ui) are still registered and served, even though the underlying ...
Opengraph URL: https://github.com/github/github-mcp-server/issues/2519
X: @github
Domain: github.com
{"@context":"https://schema.org","@type":"DiscussionForumPosting","headline":"MCP App UI resources for write tools are registered in --read-only mode","articleBody":"## Summary\n\nWhen the server is started with `--read-only` and MCP Apps are enabled, write-tool UI form resources (`issue_write_ui`, `pr_write_ui`) are still registered and served, even though the underlying write tools (`create_issue`, `update_issue`, `create_pull_request`, etc.) are filtered out of the inventory.\n\n## Where\n\n`pkg/github/ui_resources.go` — `RegisterUIResources` unconditionally calls `s.AddResource` for all three UI forms.\n\n`internal/ghmcp/server.go:182` — the only gating is on `MCPAppsFeatureFlag` + `UIAssetsAvailable()`; no read-only check.\n\n```go\nmcpAppsEnabled, _ := featureChecker(context.Background(), github.MCPAppsFeatureFlag)\nif mcpAppsEnabled \u0026\u0026 github.UIAssetsAvailable() {\n github.RegisterUIResources(ghServer)\n}\n```\n\n## Why it matters\n\n- Read-only mode should not expose UI affordances for mutating actions. A client that lists resources will see `issue_write_ui` and `pr_write_ui` and may surface them, even though calling the backing tool is impossible.\n- The mismatch is confusing — read-only is supposed to be the complete answer to \"hide all write surface\".\n- Same concern applies regardless of feature-flag wiring: any read-only filter that excludes a write tool should also exclude its companion UI resource.\n\n## Suggested fix\n\nTwo options:\n\n1. **Annotate each UI resource with the tool it backs** and skip registration when that tool would be filtered out (parallel to the read-only / feature-flag pipeline on the tool side). Cleanest, future-proof.\n2. **Pass `readOnly` into `RegisterUIResources`** and short-circuit the two write forms. Quick; doesn't generalise.\n\nLikely also worth: treating these UI resources as part of the inventory (`ServerResource` with a `ToolName` or `ReadOnlyHint` field) so they flow through the same filter pipeline as tools, rather than living in a sibling registration path.\n\n## Related\n\n- Follow-up from #2516 / #2450 review.\n- MCP Apps gating itself works correctly (MCPAppsFeatureFlag in `internal/ghmcp/server.go`); the gap is specifically the read-only interaction.","author":{"url":"https://github.com/SamMorrowDrums","@type":"Person","name":"SamMorrowDrums"},"datePublished":"2026-05-21T13:20:48.000Z","interactionStatistic":{"@type":"InteractionCounter","interactionType":"https://schema.org/CommentAction","userInteractionCount":0},"url":"https://github.com/2519/github-mcp-server/issues/2519"}
| 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:c655b69b-2950-bf93-d303-e4c508494bce |
| current-catalog-service-hash | 81bb79d38c15960b92d99bca9288a9108c7a47b18f2423d0f6438c5b7bcd2114 |
| request-id | DD4E:1B4C66:1528E8:1E3243:6A61FAFD |
| html-safe-nonce | d95511e59d58cf26763b045551b16d56f301510dffe05cfe48735ce010f4d816 |
| visitor-payload | eyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiJERDRFOjFCNEM2NjoxNTI4RTg6MUUzMjQzOjZBNjFGQUZEIiwidmlzaXRvcl9pZCI6IjM4ODYxNjQ5Mjc1MDI3NDQzMTciLCJyZWdpb25fZWRnZSI6ImlhZCIsInJlZ2lvbl9yZW5kZXIiOiJpYWQifQ== |
| visitor-hmac | b674e019c99e0a2c07ffb6f9c78299172bf4ea2a3b4b510fd318551db40fb0df |
| hovercard-subject-tag | issue:4494872620 |
| 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/2519/issue_layout |
| twitter:image | https://opengraph.githubassets.com/b50da5a54fd982e5fd13acf3ff946c780304f4e04c00b524b0f807c0bbee0573/github/github-mcp-server/issues/2519 |
| twitter:card | summary_large_image |
| og:image | https://opengraph.githubassets.com/b50da5a54fd982e5fd13acf3ff946c780304f4e04c00b524b0f807c0bbee0573/github/github-mcp-server/issues/2519 |
| og:image:alt | Summary When the server is started with --read-only and MCP Apps are enabled, write-tool UI form resources (issue_write_ui, pr_write_ui) are still registered and served, even though the underlying ... |
| og:image:width | 1200 |
| og:image:height | 600 |
| og:site_name | GitHub |
| og:type | object |
| og:author:username | SamMorrowDrums |
| hostname | github.com |
| expected-hostname | github.com |
| None | 9e41a6fd863e96b9c7e9185dc317bf107dbbf8cb10efd6dea957211963f33775 |
| 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 | 2ed5e9c44acb35dcc1d752e449d2a6f7a6164b7b |
| ui-target | full |
| theme-color | #1e2327 |
| color-scheme | light dark |
Links:
Viewport: width=device-width