Title: PR tools re-fetch data without conditional requests (ETag / If-None-Match) · Issue #3025 · github/github-mcp-server · GitHub
Open Graph Title: PR tools re-fetch data without conditional requests (ETag / If-None-Match) · Issue #3025 · github/github-mcp-server
X Title: PR tools re-fetch data without conditional requests (ETag / If-None-Match) · Issue #3025 · github/github-mcp-server
Description: Summary The REST client is built with a transport chain (http.DefaultTransport → user-agent → bearer-auth) that has no response-cache or conditional-request layer, so pull-request tools (pull_request_read with get / get_files / get_commi...
Open Graph Description: Summary The REST client is built with a transport chain (http.DefaultTransport → user-agent → bearer-auth) that has no response-cache or conditional-request layer, so pull-request tools (pull_reque...
X Description: Summary The REST client is built with a transport chain (http.DefaultTransport → user-agent → bearer-auth) that has no response-cache or conditional-request layer, so pull-request tools (pull_reque...
Opengraph URL: https://github.com/github/github-mcp-server/issues/3025
X: @github
Domain: github.com
IPv4 address: 140.82.112.4
{"@context":"https://schema.org","@type":"DiscussionForumPosting","headline":"PR tools re-fetch data without conditional requests (ETag / If-None-Match)","articleBody":"### Summary\r\n\r\nThe REST client is built with a transport chain (`http.DefaultTransport` → user-agent → bearer-auth) that has no response-cache or conditional-request layer, so pull-request tools (`pull_request_read` with `get` / `get_files` / `get_commits` / `get_reviews` / `get_status`, and `list_pull_requests`) issue unconditional `GET` requests. Repeated identical reads within or across sessions re-download full responses even when nothing has changed; the `ETag` GitHub returns is never captured or replayed as `If-None-Match`.\r\n\r\n### Where\r\n\r\n- Client/transport construction (single site): [`internal/ghmcp/server.go`](https://github.com/github/github-mcp-server/blob/main/internal/ghmcp/server.go) — `createGitHubClients()` wires `UserAgentTransport{ Transport: http.DefaultTransport }` (and `BearerAuthTransport`) with no caching transport.\r\n- Transport package has only user-agent / bearer / graphql-features round-trippers: [`pkg/http/transport/`](https://github.com/github/github-mcp-server/tree/main/pkg/http/transport).\r\n- PR tool handlers call `client.PullRequests.Get/ListFiles/ListCommits/ListReviews/List` unconditionally: [`pkg/github/pullrequests.go`](https://github.com/github/github-mcp-server/blob/main/pkg/github/pullrequests.go).\r\n\r\n### Impact on users\r\n\r\nGitHub's REST API supports conditional requests: replaying the previous `ETag` as `If-None-Match` returns `304 Not Modified` when nothing changed, and **`304` responses don't count against the token's primary rate limit**. Agentic sessions frequently re-read the same pull request (e.g. `get` → `get_files` → `get_reviews`, retries, multi-step reasoning). Without conditional requests, each re-read is a full response that spends rate-limit budget and bandwidth, making the token's limit easier to hit and slowing tool calls.\r\n\r\n### Example prompts that trigger repeated reads\r\n\r\n- \"Summarize PR #123, then list its changed files, then show review comments.\" (multiple reads of the same PR)\r\n- \"Watch PR #123 and tell me when checks pass.\" (repeated `get_status` / `get`)\r\n- \"Compare the files and commits in PR #123 and PR #124.\" (list + per-PR reads)\r\n\r\n### Suggested change\r\n\r\nInsert an ETag-revalidating `http.RoundTripper` at the single client-construction site in `createGitHubClients()`, below the user-agent transport: cache `{etag, body}` keyed by (auth scope, method, URL), send `If-None-Match` on GETs, and return the cached body on `304`. An always-revalidate ETag transport keeps tool results fresh (no stale window) while turning unchanged reads into cheap `304`s. The GraphQL client is unaffected (POST). This keeps results identical while reducing rate-limit pressure and bandwidth.\r\n","author":{"url":"https://github.com/joshfree","@type":"Person","name":"joshfree"},"datePublished":"2026-08-05T23:10:15Z","url":"https://github.com/github/github-mcp-server/issues/3025"}
| react-profiling | 0 |
| react-import-map | react,react-dom,react-dom/client,react-dom/profiling,react-is,react/compiler-runtime,react/jsx-dev-runtime,react/jsx-runtime,scheduler@b8488ee2c322 |
| 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:8588bd6b-e5ec-8531-1c39-3f8916f1be8c |
| current-catalog-service-hash | 81bb79d38c15960b92d99bca9288a9108c7a47b18f2423d0f6438c5b7bcd2114 |
| request-id | 8810:2EAB91:28178C3:35B0337:6B06BEAD |
| html-safe-nonce | b671f7ded7c565a5db03d55f7e15e0c21173edf5fdc18be0c5ed852228fd392d |
| visitor-payload | eyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiI4ODEwOjJFQUI5MToyODE3OEMzOjM1QjAzMzc6NkIwNkJFQUQiLCJ2aXNpdG9yX2lkIjoiNzkwMTIwODc4NjU1ODY5NzEzMyIsInJlZ2lvbl9lZGdlIjoiaWFkIiwicmVnaW9uX3JlbmRlciI6ImlhZCJ9 |
| visitor-hmac | 27549255a0a68274ca992b218ae08988a56980d5f689efb733e2c0d59324574c |
| hovercard-subject-tag | issue:5075998081 |
| 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/3025/issue_layout |
| twitter:image | https://opengraph.githubassets.com/eb2145e1e57f00e396cb9d9c270007cdabeee847dacd793082bf1cd7f6a5317e/github/github-mcp-server/issues/3025 |
| twitter:card | summary_large_image |
| og:image | https://opengraph.githubassets.com/eb2145e1e57f00e396cb9d9c270007cdabeee847dacd793082bf1cd7f6a5317e/github/github-mcp-server/issues/3025 |
| og:image:alt | Summary The REST client is built with a transport chain (http.DefaultTransport → user-agent → bearer-auth) that has no response-cache or conditional-request layer, so pull-request tools (pull_reque... |
| og:image:width | 1200 |
| og:image:height | 600 |
| og:site_name | GitHub |
| og:type | object |
| og:author:username | joshfree |
| hostname | github.com |
| expected-hostname | github.com |
| None | 32031aaff792fa7ad778f7418e1fbfc0d525a5779804329b769aa75230448a18 |
| 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 | 37014d914b7d14eede971655595f687a0202af40 |
| ui-target | full |
| theme-color | #1e2327 |
| color-scheme | light dark |
| react-app-name | issues |
Links:
| Server | github.com |
| Content-Type | text/html; charset=utf-8 |
| Cache-Control | max-age=0, private, must-revalidate |
Viewport: width=device-width