René's URL Explorer Experiment


Title: fix: resolve annotated tags to their commit in get_file_contents by burrows99 · Pull Request #3936 · github/github-mcp-server · GitHub

Open Graph Title: fix: resolve annotated tags to their commit in get_file_contents by burrows99 · Pull Request #3936 · github/github-mcp-server

X Title: fix: resolve annotated tags to their commit in get_file_contents by burrows99 · Pull Request #3936 · github/github-mcp-server

Description: Summary get_file_contents now resolves an annotated tag to the commit it points at, so the repo://.../sha/{sha}/contents/... URI it returns can be read back. Before, the URI named the tag object and reading it failed with 404. Why An annotated tag ref (refs/tags/v1.0.0 in this repo) points at a tag object, not a commit. resolveGitReference returned reference.Object.SHA as is, so for annotated tags it returned the tag object's SHA: the embedded resource / resource link URI became repo://github/github-mcp-server/sha/c7fc888…/contents/go.mod, and reading it through the server's own repository_content_commit template fails with 404 Not Found (raw content does not accept tag object SHAs). For files of 1 MB or more the tool returns no content, only a resource link (and a download URL), and that link cannot be read either; the "resolved refs" in the path-suggestion message report the tag object SHA as if it were the commit. Branches and lightweight tags were fine because their ref already points at a commit. No upstream issue is associated with this fix. Reproduced on main at 9a72d8d. flowchart TD A[get_file_contents with ref v1.0.0] --> B{Annotated tag ref} B -->|Before| C[URI names the tag object and reads back 404] B -->|After| D[URI names the tagged commit and reads back the file] Loading What changed pkg/github/repositories_helper.go: after the ref is resolved, peel annotated tags with Git.GetTag until the object is not a tag, and return that SHA. One extra API call, only for annotated tags. pkg/github/repositories_test.go: Test_resolveGitReference case "annotated tag resolves to the tagged commit" (ref returns a type: tag object, tag API returns the commit). Narrated recording in the MCP Inspector, before then after (sound on). Server run with --read-only --toolsets=repos,security_advisories: evidence.mp4 Edge cases and unchanged behaviour checked (in the running server through the Inspector, as shown in the video): ref: refs/tags/v1.0.0 (fully qualified annotated tag) -> sha/569a48d… (the tagged commit) lightweight tag cli/cli v2.60.0 -> sha/44ee177…, the same commit as before branch main -> sha/9a72d8d… (branch head), unchanged unit test: branch, lightweight tag, heads/, tags/, PR ref and SHA cases in Test_resolveGitReference unchanged and passing MCP impact No tool or API changes Tool schema or behavior changed get_file_contents input/output schema is unchanged; for annotated tags the returned resource URI and resolved SHA now name the commit. New tool added Prompts tested (tool changes only) "Show me go.mod from github/github-mcp-server at tag v1.0.0" (then read the returned resource URI) Security / limits No security or limits impact Tool renaming I am renaming tools as part of this PR (e.g. a part of a consolidation effort) I have added the new tool aliases in deprecated_tool_aliases.go I am not renaming tools as part of this PR Lint & tests Linted locally with ./script/lint gofmt -s -l pkg/github clean; golangci-lint v2.14.0 (the pinned version) on ./pkg/github/...: 0 issues. Tested locally with ./script/test go test ./pkg/github/ passes. The new case fails on main (expected: "commit-sha", actual: "tag-object-sha") and passes with the fix. I did not run the whole repository suite. Docs Not needed Skills Updated relevant skills or confirmed no bundled skill applies No bundled skill describes ref resolution. AI assistance (Claude Code) was used to find the bug, write the fix and test, and record the video. 🤖 Generated with Claude Code

Open Graph Description: Summary get_file_contents now resolves an annotated tag to the commit it points at, so the repo://.../sha/{sha}/contents/... URI it returns can be read back. Before, the URI named the tag object an...

X Description: Summary get_file_contents now resolves an annotated tag to the commit it points at, so the repo://.../sha/{sha}/contents/... URI it returns can be read back. Before, the URI named the tag object an...

Opengraph URL: https://github.com/github/github-mcp-server/pull/3936

X: @github

direct link

Domain: github.com

IPv4 address: 140.82.113.4

react-profiling0
react-import-mapreact,react-dom,react-dom/client,react-dom/profiling,react-is,react/compiler-runtime,react/jsx-dev-runtime,react/jsx-runtime,scheduler@b8488ee2c322
route-pattern/:user_id/:repository/pull/:id/files(.:format)
route-controllerpull_requests
route-actionfiles
fetch-noncev2:16abcb96-da0d-1bb1-4c27-261236c75ca1
current-catalog-service-hashae870bc5e265a340912cde392f23dad3671a0a881730ffdadd82f2f57d81641b
request-idC6F4:5F360:37EE2E:4953FE:6B061803
html-safe-nonce0e6128787d849d5f51e443566b4534647f837fe7bb8f7ab44a271051182ad01f
visitor-payloadeyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiJDNkY0OjVGMzYwOjM3RUUyRTo0OTUzRkU6NkIwNjE4MDMiLCJ2aXNpdG9yX2lkIjoiMjc2NzAzODIwNTU3MTUwNDEzMSIsInJlZ2lvbl9lZGdlIjoiaWFkIiwicmVnaW9uX3JlbmRlciI6ImlhZCJ9
visitor-hmac403e7034fe5b22b5688a3bd897ee689852a98c014af965a0f26ab023f92c0aad
hovercard-subject-tagpull_request:5466158152
github-keyboard-shortcutsrepository,pull-request-list,pull-request-conversation,pull-request-files-changed,copilot
google-site-verificationApib7-x98H0j5cPqHWwSMm6dNU4GmODRoqxLiDzdx9I
octolytics-urlhttps://collector.github.com/github/collect
analytics-location///pull_requests/show/files
fb:app_id1401488693436528
apple-itunes-appapp-id=1477376905, app-argument=https://github.com/github/github-mcp-server/pull/3936/files
twitter:imagehttps://avatars.githubusercontent.com/u/69508267?s=400&v=4
twitter:cardsummary_large_image
og:imagehttps://avatars.githubusercontent.com/u/69508267?s=400&v=4
og:image:altSummary get_file_contents now resolves an annotated tag to the commit it points at, so the repo://.../sha/{sha}/contents/... URI it returns can be read back. Before, the URI named the tag object an...
og:site_nameGitHub
og:typeobject
hostnamegithub.com
expected-hostnamegithub.com
None97d4714e567728e1f85f88b0cf68c89f0f8a3dc41e8869af7aeb8195ad990374
turbo-cache-controlno-preview
diff-viewunified
go-importgithub.com/github/github-mcp-server git https://github.com/github/github-mcp-server.git
octolytics-dimension-user_id9919
octolytics-dimension-user_logingithub
octolytics-dimension-repository_id942771284
octolytics-dimension-repository_nwogithub/github-mcp-server
octolytics-dimension-repository_publictrue
octolytics-dimension-repository_is_forkfalse
octolytics-dimension-repository_network_root_id942771284
octolytics-dimension-repository_network_root_nwogithub/github-mcp-server
turbo-body-classeslogged-out env-production page-responsive full-width
disable-turbotrue
browser-stats-urlhttps://api.github.com/_private/browser/stats
browser-errors-urlhttps://api.github.com/_private/browser/errors
release866f202ebf7ac5aff8f633417d9fd8a53818a977
ui-targetfull
theme-color#1e2327
color-schemelight dark

Links:

Skip to contenthttps://github.com/github/github-mcp-server/pull/3936/files#start-of-content
https://github.com/
Sign inhttps://github.com/login?return_to=https%3A%2F%2Fgithub.com%2Fgithub%2Fgithub-mcp-server%2Fpull%2F3936%2Ffiles
GitHubRepository hosting, code review, and collaborationhttps://github.com/platform
CopilotAI coding agent for tasks, projects, and automated workhttps://github.com/features/copilot
ActionsCI/CD and automationhttps://github.com/features/actions
Code QualityQuality analysis, fixes, and enforcementhttps://github.com/features/code-quality
CodespacesCloud development environmentshttps://github.com/features/codespaces
Code SecurityVulnerability detection and remediationhttps://github.com/security/advanced-security/code-security
Secret ProtectionSecret scanning and leak preventionhttps://github.com/security/advanced-security/secret-protection
All Featureshttps://github.com/features
Documentationhttps://docs.github.com/en
Traininghttps://learn.github.com/skills
Certificationshttps://learn.github.com/credentials
Build with Copilothttps://github.com/features/ai
Customize Copilothttps://docs.github.com/en/copilot/how-tos/copilot-on-github/customize-copilot/customize-copilot-overview
Integrationshttps://github.com/marketplace
Trending reposhttps://github.com/trending
GitHub Sponsorshttps://github.com/open-source/sponsors
Developer articleshttps://github.com/resources/articles
ChangelogYour source for the latest features, improvements, and fixes across GitHub products, all in one place.https://github.blog/changelog/
Enterpriseshttps://github.com/enterprise
Teamhttps://github.com/team
Startupshttps://github.com/enterprise/startups
Nonprofitshttps://github.com/solutions/industry/nonprofits
Healthcarehttps://github.com/solutions/industry/healthcare
Financial serviceshttps://github.com/solutions/industry/financial-services
Manufacturinghttps://github.com/solutions/industry/manufacturing
Governmenthttps://github.com/solutions/industry/government
See all industrieshttps://github.com/solutions/industry
Why GitHubhttps://github.com/why-github
Customer Storieshttps://github.com/customer-stories
Business insightshttps://github.com/solutions/executive-insights
Trust Centerhttps://github.com/trust-center
GitHub Advanced SecurityEnterprise-grade code securityhttps://github.com/security/advanced-security
Copilot for businessEnterprise-grade AI featureshttps://github.com/features/copilot/copilot-business
Premium SupportEnterprise-grade 24/7 supporthttps://github.com/enterprise/premium-support
Documentationhttps://docs.github.com/en
Resource centerhttps://github.com/resources
Bloghttps://github.blog/
Events & webinarshttps://github.com/resources/events
Community Forumhttps://github.com/orgs/community/discussions
Customer Storieshttps://github.com/customer-stories
Integrationshttps://github.com/marketplace
Customer supporthttps://help.github.com/
Traininghttps://learn.github.com/skills
GitHub Statushttps://www.githubstatus.com/
Abouthttps://github.com/about
Partnershttps://github.com/partners
Changeloghttps://github.blog/changelog/
GitHub UniverseThe event for developers, by developers — talks, workshops, and what’s next for GitHub.https://githubuniverse.com/
Pricinghttps://github.com/pricing
Sign inhttps://github.com/login?return_to=https%3A%2F%2Fgithub.com%2Fgithub%2Fgithub-mcp-server%2Fpull%2F3936%2Ffiles
Sign uphttps://github.com/signup?ref_cta=Sign+up&ref_loc=header+logged+out&ref_page=%2F%3Cuser-name%3E%2F%3Crepo-name%3E%2Fpull_requests%2Fshow%2Ffiles&source=header-repo&source_repo=github%2Fgithub-mcp-server
Reloadhttps://github.com/github/github-mcp-server/pull/3936/files
Reloadhttps://github.com/github/github-mcp-server/pull/3936/files
Reloadhttps://github.com/github/github-mcp-server/pull/3936/files
githubhttps://github.com/github
github-mcp-serverhttps://github.com/github/github-mcp-server
Codehttps://github.com/github/github-mcp-server
Issues238 (238)https://github.com/github/github-mcp-server/issues
Pull requests226 (226)https://github.com/github/github-mcp-server/pulls
Discussionshttps://github.com/github/github-mcp-server/discussions
Actionshttps://github.com/github/github-mcp-server/actions
Security and quality2 (2)https://github.com/github/github-mcp-server/security
Insightshttps://github.com/github/github-mcp-server/insights
Sign up for GitHub https://github.com/signup?return_to=%2Fgithub%2Fgithub-mcp-server%2Fissues%2Fnew%2Fchoose
terms of servicehttps://docs.github.com/terms
privacy statementhttps://docs.github.com/privacy
Sign inhttps://github.com/login?return_to=%2Fgithub%2Fgithub-mcp-server%2Fissues%2Fnew%2Fchoose
burrows99https://github.com/burrows99
github:mainhttps://github.com/github/github-mcp-server/tree/main
burrows99:fix/peel-annotated-tag-refhttps://github.com/burrows99/github-mcp-server/tree/fix/peel-annotated-tag-ref
Conversation 3 https://github.com/github/github-mcp-server/pull/3936
Commits 2 https://github.com/github/github-mcp-server/pull/3936/commits
Checks 1 https://github.com/github/github-mcp-server/pull/3936/checks
Findings https://github.com/github/github-mcp-server/pull/3936/findings
Files changed https://github.com/github/github-mcp-server/pull/3936/files
Please reload this pagehttps://github.com/github/github-mcp-server/pull/3936/files
fix: resolve annotated tags to their commit in get_file_contents https://github.com/github/github-mcp-server/pull/3936/files#top
Show all changes 2 commits https://github.com/github/github-mcp-server/pull/3936/files
180d477 fix: resolve annotated tags to their commit in get_file_contents burrows99 Nov 24, 2026 https://github.com/github/github-mcp-server/pull/3936/commits/180d4775c27d62afd716a4544cbd176c8f14ab29
6928b98 fix: stop following annotated tags after 10 levels burrows99 Nov 24, 2026 https://github.com/github/github-mcp-server/pull/3936/commits/6928b9841032535db66af9a20a601bf482ead10e
Clear filters https://github.com/github/github-mcp-server/pull/3936/files
Please reload this pagehttps://github.com/github/github-mcp-server/pull/3936/files
Please reload this pagehttps://github.com/github/github-mcp-server/pull/3936/files
repositories_helper.go https://github.com/github/github-mcp-server/pull/3936/files#diff-604dc0762cb290ada20412e44074f14cc6969e1ceeeb35d326603fa18af07fb3
repositories_test.go https://github.com/github/github-mcp-server/pull/3936/files#diff-1f37596d401182a6443ebc5cf77fd4451cb48bd6f8a3ca31742a7a29feed4279
https://github.com/github/github-mcp-server/blob/main/.github/CODEOWNERS#L1
pkg/github/repositories_helper.gohttps://github.com/github/github-mcp-server/pull/3936/files#diff-604dc0762cb290ada20412e44074f14cc6969e1ceeeb35d326603fa18af07fb3
View file https://github.com/github/github-mcp-server/blob/6928b9841032535db66af9a20a601bf482ead10e/pkg/github/repositories_helper.go
Open in desktop https://desktop.github.com
https://github.co/hiddenchars
https://github.com/github/github-mcp-server/pull/3936/{{ revealButtonHref }}
https://github.com/github/github-mcp-server/pull/3936/files#diff-604dc0762cb290ada20412e44074f14cc6969e1ceeeb35d326603fa18af07fb3
https://github.com/github/github-mcp-server/pull/3936/files#diff-604dc0762cb290ada20412e44074f14cc6969e1ceeeb35d326603fa18af07fb3
https://github.com/github/github-mcp-server/blob/main/.github/CODEOWNERS#L1
pkg/github/repositories_test.gohttps://github.com/github/github-mcp-server/pull/3936/files#diff-1f37596d401182a6443ebc5cf77fd4451cb48bd6f8a3ca31742a7a29feed4279
View file https://github.com/github/github-mcp-server/blob/6928b9841032535db66af9a20a601bf482ead10e/pkg/github/repositories_test.go
Open in desktop https://desktop.github.com
https://github.co/hiddenchars
https://github.com/github/github-mcp-server/pull/3936/{{ revealButtonHref }}
https://github.com/github/github-mcp-server/pull/3936/files#diff-1f37596d401182a6443ebc5cf77fd4451cb48bd6f8a3ca31742a7a29feed4279
https://github.com/github/github-mcp-server/pull/3936/files#diff-1f37596d401182a6443ebc5cf77fd4451cb48bd6f8a3ca31742a7a29feed4279
https://github.com
Termshttps://docs.github.com/site-policy/github-terms/github-terms-of-service
Privacyhttps://docs.github.com/site-policy/privacy-policies/github-privacy-statement
Securityhttps://github.com/security
Statushttps://www.githubstatus.com/
Communityhttps://github.community/
Docshttps://docs.github.com/
Contacthttps://support.github.com?tags=dotcom-footer

Response headers:
Servergithub.com
Content-Typetext/html; charset=utf-8
Cache-Controlno-cache

Viewport: width=device-width


URLs of crawlers that visited me.