René's URL Explorer Experiment


Title: Always include SHA in get_file_contents responses by yonaka15 · Pull Request #676 · github/github-mcp-server · GitHub

Open Graph Title: Always include SHA in get_file_contents responses by yonaka15 · Pull Request #676 · github/github-mcp-server

X Title: Always include SHA in get_file_contents responses by yonaka15 · Pull Request #676 · github/github-mcp-server

Description: Summary This PR provides a simpler solution to #595 by always including SHA information in the get_file_contents tool responses without requiring any parameter changes. Unlike #605 which adds an include_sha parameter, this approach transparently enhances all responses with SHA information while preserving the existing MCP server behavior. Approach The implementation adds a preliminary Contents API call to retrieve SHA information before fetching the actual content: Call Contents API to get file metadata (including SHA) Call Raw Content API to get the actual content (as before) Include SHA in both the resource URI and success message This dual-API approach ensures: Text files continue to return raw text content Binary files continue to return base64-encoded content SHA information is always available for create_or_update_file operations Changes Modified pkg/github/repositories.go to add Contents API call before Raw Content API Updated tests in pkg/github/repositories_test.go to include Contents API mocks No changes to tool schema or parameters - fully backward compatible Benefits over #605 No parameter required - SHA is always included automatically Simpler for users (AI) - No need to remember to set include_sha=true Better default behavior - Addresses the core issue directly Minimal performance impact - The additional API call is lightweight Testing Verified with both unit tests and MCP Inspector against real repositories: Text files return raw content with SHA ✅ Binary files return base64 content with SHA ✅ Directories return JSON with SHA for each item ✅ Graceful fallback when Contents API fails ✅ Closes #595

Open Graph Description: Summary This PR provides a simpler solution to #595 by always including SHA information in the get_file_contents tool responses without requiring any parameter changes. Unlike #605 which adds an in...

X Description: Summary This PR provides a simpler solution to #595 by always including SHA information in the get_file_contents tool responses without requiring any parameter changes. Unlike #605 which adds an in...

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

X: @github

direct link

Domain: github.com

IPv4 address: 140.82.113.3

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:c43a8222-6d0d-313d-87cb-e18d013ab288
current-catalog-service-hashae870bc5e265a340912cde392f23dad3671a0a881730ffdadd82f2f57d81641b
request-idA9B6:26B457:1144B71:17EB0AD:6B06B803
html-safe-nonce7ede5a5e58bef5bae0ab1d82483ea8b8426f4998609f96e7dd00e7f9ef33b0af
visitor-payloadeyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiJBOUI2OjI2QjQ1NzoxMTQ0QjcxOjE3RUIwQUQ6NkIwNkI4MDMiLCJ2aXNpdG9yX2lkIjoiNTQ4MTY2MTYwMzQyNDY3OTkzOSIsInJlZ2lvbl9lZGdlIjoiaWFkIiwicmVnaW9uX3JlbmRlciI6ImlhZCJ9
visitor-hmac237ce341b527ad3e022b5df37b24cfb63662fcffb861ea6772b1a3f4b5037bd6
hovercard-subject-tagpull_request:2661448128
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/676/files
twitter:imagehttps://avatars.githubusercontent.com/u/10888995?s=400&v=4
twitter:cardsummary_large_image
og:imagehttps://avatars.githubusercontent.com/u/10888995?s=400&v=4
og:image:altSummary This PR provides a simpler solution to #595 by always including SHA information in the get_file_contents tool responses without requiring any parameter changes. Unlike #605 which adds an in...
og:site_nameGitHub
og:typeobject
hostnamegithub.com
expected-hostnamegithub.com
None32031aaff792fa7ad778f7418e1fbfc0d525a5779804329b769aa75230448a18
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
release37014d914b7d14eede971655595f687a0202af40
ui-targetfull
theme-color#1e2327
color-schemelight dark

Links:

Skip to contenthttps://github.com/github/github-mcp-server/pull/676/files#start-of-content
https://github.com/
Sign inhttps://github.com/login?return_to=https%3A%2F%2Fgithub.com%2Fgithub%2Fgithub-mcp-server%2Fpull%2F676%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%2F676%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/676/files
Reloadhttps://github.com/github/github-mcp-server/pull/676/files
Reloadhttps://github.com/github/github-mcp-server/pull/676/files
githubhttps://github.com/github
github-mcp-serverhttps://github.com/github/github-mcp-server
Codehttps://github.com/github/github-mcp-server
Issues239 (239)https://github.com/github/github-mcp-server/issues
Pull requests228 (228)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
LuluBeatsonhttps://github.com/LuluBeatson
github:mainhttps://github.com/github/github-mcp-server/tree/main
yonaka15:fix/get-file-contents-include-shhttps://github.com/yonaka15/github-mcp-server/tree/fix/get-file-contents-include-sh
Conversation 7 https://github.com/github/github-mcp-server/pull/676
Commits 8 https://github.com/github/github-mcp-server/pull/676/commits
Checks 0 https://github.com/github/github-mcp-server/pull/676/checks
Findings https://github.com/github/github-mcp-server/pull/676/findings
Files changed https://github.com/github/github-mcp-server/pull/676/files
Please reload this pagehttps://github.com/github/github-mcp-server/pull/676/files
Always include SHA in get_file_contents responses https://github.com/github/github-mcp-server/pull/676/files#top
Show all changes 8 commits https://github.com/github/github-mcp-server/pull/676/files
bac36c1 fix: Add SHA to get_file_contents while preserving MCP behavior (#595) yonaka15 Jul 12, 2025 https://github.com/github/github-mcp-server/pull/676/commits/bac36c1a933c133bb8b6d11032d43d5972f48a15
5acb47c fix: Improve error handling for Contents API response yonaka15 Jul 12, 2025 https://github.com/github/github-mcp-server/pull/676/commits/5acb47cd1cb2d2e9878e9cb1208de388e9be87f0
e650bb0 revert changes to resource URI LuluBeatson Jul 15, 2025 https://github.com/github/github-mcp-server/pull/676/commits/e650bb0abe2e477e13804d174d98ca08be03d7cf
f1f225d use GraphQL API to get file SHA LuluBeatson Jul 15, 2025 https://github.com/github/github-mcp-server/pull/676/commits/f1f225d571cd8c5faba244956613693a8440e80f
505f361 refactor: mock GQL client instead of getFileSHA function to follow co… LuluBeatson Jul 15, 2025 https://github.com/github/github-mcp-server/pull/676/commits/505f361fc010b4357d91e5104a4236c1082c06c2
af760f2 lint LuluBeatson Jul 15, 2025 https://github.com/github/github-mcp-server/pull/676/commits/af760f23aef328d1018a221fc6b5dcc82d39d8c1
db04b21 Merge remote-tracking branch 'origin/main' into fix/get-file-contents… LuluBeatson Jul 15, 2025 https://github.com/github/github-mcp-server/pull/676/commits/db04b21d05f1c87857d2f225797b024bf2fdff67
d1b6c32 revert GraphQL LuluBeatson Jul 16, 2025 https://github.com/github/github-mcp-server/pull/676/commits/d1b6c3239d1127240e09b0a714cde4f639280258
Clear filters https://github.com/github/github-mcp-server/pull/676/files
Please reload this pagehttps://github.com/github/github-mcp-server/pull/676/files
Please reload this pagehttps://github.com/github/github-mcp-server/pull/676/files
repositories.go https://github.com/github/github-mcp-server/pull/676/files#diff-396c76ab9d216fd1d9043c561bf2bfe57ade719aa0c0cedb47e85b3277714b92
repositories_test.go https://github.com/github/github-mcp-server/pull/676/files#diff-1f37596d401182a6443ebc5cf77fd4451cb48bd6f8a3ca31742a7a29feed4279
https://github.com/github/github-mcp-server/blob/main/.github/CODEOWNERS#L1
pkg/github/repositories.gohttps://github.com/github/github-mcp-server/pull/676/files#diff-396c76ab9d216fd1d9043c561bf2bfe57ade719aa0c0cedb47e85b3277714b92
View file https://github.com/yonaka15/github-mcp-server/blob/d1b6c3239d1127240e09b0a714cde4f639280258/pkg/github/repositories.go
Open in desktop https://desktop.github.com
https://github.co/hiddenchars
https://github.com/github/github-mcp-server/pull/676/{{ revealButtonHref }}
https://github.com/github/github-mcp-server/pull/676/files#diff-396c76ab9d216fd1d9043c561bf2bfe57ade719aa0c0cedb47e85b3277714b92
https://github.com/github/github-mcp-server/pull/676/files#diff-396c76ab9d216fd1d9043c561bf2bfe57ade719aa0c0cedb47e85b3277714b92
https://github.com/github/github-mcp-server/pull/676/files#diff-396c76ab9d216fd1d9043c561bf2bfe57ade719aa0c0cedb47e85b3277714b92
https://github.com/github/github-mcp-server/pull/676/files#diff-396c76ab9d216fd1d9043c561bf2bfe57ade719aa0c0cedb47e85b3277714b92
https://github.com/github/github-mcp-server/blob/main/.github/CODEOWNERS#L1
pkg/github/repositories_test.gohttps://github.com/github/github-mcp-server/pull/676/files#diff-1f37596d401182a6443ebc5cf77fd4451cb48bd6f8a3ca31742a7a29feed4279
View file https://github.com/yonaka15/github-mcp-server/blob/d1b6c3239d1127240e09b0a714cde4f639280258/pkg/github/repositories_test.go
Open in desktop https://desktop.github.com
https://github.co/hiddenchars
https://github.com/github/github-mcp-server/pull/676/{{ revealButtonHref }}
https://github.com/github/github-mcp-server/pull/676/files#diff-1f37596d401182a6443ebc5cf77fd4451cb48bd6f8a3ca31742a7a29feed4279
https://github.com/github/github-mcp-server/pull/676/files#diff-1f37596d401182a6443ebc5cf77fd4451cb48bd6f8a3ca31742a7a29feed4279
https://github.com/github/github-mcp-server/pull/676/files#diff-1f37596d401182a6443ebc5cf77fd4451cb48bd6f8a3ca31742a7a29feed4279
https://github.com/github/github-mcp-server/pull/676/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.