René's URL Explorer Experiment


Title: fix(repos)!: stop mirroring file bodies in get_file_contents structured output by jbayardo · Pull Request #3500 · github/github-mcp-server · GitHub

Open Graph Title: fix(repos)!: stop mirroring file bodies in get_file_contents structured output by jbayardo · Pull Request #3500 · github/github-mcp-server

X Title: fix(repos)!: stop mirroring file bodies in get_file_contents structured output by jbayardo · Pull Request #3500 · github/github-mcp-server

Description: Summary On protocol 2026-07-28, get_file_contents returned every file twice: once as the embedded resource in content and again as text/blob in structuredContent. Structured output now carries only the resource uri and mimeType; the body stays in content. Modern JSON text is also encoded without HTML escaping, so it equals JSON.stringify(structuredContent). Why Clients that forward both content and structuredContent to the model pay for each file twice. In Copilot CLI the mirror is ~41.5% of get_file_contents tokens: ~1.07 GB/day of structured content across 81K of 241K daily calls. Without it, ~9.4K/day of the 19.7K results that spill past 20 KiB would stay inline. Separately, json.Marshal escapes <, > and & as \u003c, \u003e and \u0026. Copilot CLI only drops the structured JSON when the text is byte-equal to JSON.stringify(structuredContent), so all-text results containing those characters (e.g. pull_request_read, search_code, web_search, search_repositories) were also sent twice. MCP spec context: modelcontextprotocol/modelcontextprotocol#1624, modelcontextprotocol/modelcontextprotocol#2200. Fixes # What changed RepositoryResourceOutput keeps only uri and mimeType. repositoryContentOutput no longer copies the file body, and the text/blob oneOf is removed from the output schema. applyModernStructuredText encodes with SetEscapeHTML(false) and then unescapes \u003c/\u003e/\u0026 inside JSON strings. The second step is needed because the SDK hands over an already-escaped json.RawMessage. Escaped backslashes are handled, so a literal \u003c in the data stays as-is. Tests: The get_file_contents wire test now expects structured output equal to the legacy blocks minus the resource bodies, with no text or blob. Schema cases updated. New tests cover unescaped modern text and the unescaping scanner's edge cases. get_file_contents.snap regenerated; docs/typed-tool-schemas.md documents both rules. Options considered Option Outcome Metadata-only structured output (chosen) Keeps the typed outputSchema for discovery. The file body is no longer duplicated, and every client still receives it in content. Drop outputSchema for get_file_contents Removes typed output for the tool entirely, which is a bigger contract change. PreserveHandlerContent Only skips the text rewrite; structuredContent is still emitted, so it does not fix the duplication. Omit structuredContent only for file reads Not viable: with an outputSchema, the spec requires structuredContent, and the TS SDK client throws when it is missing. Measurements (real API, stdio binary, github/github-mcp-server@main, protocol 2026-07-28) Bytes of content + structuredContent: Request Before After docs/typed-tool-schemas.md 4,251 + 4,263 4,251 + 313 README.md 123,084 + 123,096 123,084 + 296 pkg/octicons/icons/repo-light.png 852 + 864 852 + 306 pkg/github (directory) 73,351 + 69,198 unchanged pull_request_read #3437: text equals JSON.stringify(structuredContent) ❌ (1 HTML escape) ✅ Legacy protocol (2025-11-25) results are byte-identical before and after. MCP impact No tool or API changes Tool schema or behavior changed — the get_file_contents output schema and structuredContent no longer include text/blob. This is a contract change for consumers that read file bodies from structuredContent (typed outputs shipped in v2.0.0); they should read the embedded resource in content. Go library consumers lose RepositoryResourceOutput.Text and .Blob. Modern JSON text no longer HTML-escapes <, > and &; it parses to the same value. New tool added Prompts tested (tool changes only) Exercised over stdio with a JSON-RPC harness (protocol 2026-07-28 and 2025-11-25), not through an LLM client: "Show me docs/typed-tool-schemas.md in github/github-mcp-server" (text file) "Get README.md from github/github-mcp-server" (large text file) "Fetch pkg/octicons/icons/repo-light.png" (binary file) "List pkg/github in github/github-mcp-server" (directory) "Get PR #3437 in github/github-mcp-server" (pull_request_read; HTML escaping) In every modern-protocol case, structuredContent validated against the advertised outputSchema with Ajv (the TS SDK's validator). I also confirmed in the Copilot CLI source that it still sends the embedded resource body to the model. Security / limits No security or limits impact Auth / permissions considered Data exposure, filtering, or token/size limits considered — this roughly halves get_file_contents result size on the modern protocol and lets clients dedupe all-text results. No data is newly exposed or filtered. 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 Note: if you're renaming tools, you must add the tool aliases. For more information on how to do so, please refer to the official docs. Lint & tests Linted locally with ./script/lint: gofmt -s -l clean; golangci-lint run (v2.14.0, matching CI) on ./pkg/inventory/... ./pkg/github/... reported 0 issues. Tested locally with ./script/test: go test ./... -count=1 passed. I ran it without -race because cgo isn't available on this Windows machine; CI runs -race. go run ./cmd/github-mcp-server generate-docs produced no changes. Docs Not needed Updated (README / docs / examples) — docs/typed-tool-schemas.md now covers non-HTML-escaped modern text and metadata-only structured output for resource results. README needed no changes.

Open Graph Description: Summary On protocol 2026-07-28, get_file_contents returned every file twice: once as the embedded resource in content and again as text/blob in structuredContent. Structured output now carries only...

X Description: Summary On protocol 2026-07-28, get_file_contents returned every file twice: once as the embedded resource in content and again as text/blob in structuredContent. Structured output now carries only...

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

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:9615da06-ac9f-ad9d-d883-450660e98d96
current-catalog-service-hashae870bc5e265a340912cde392f23dad3671a0a881730ffdadd82f2f57d81641b
request-id96A6:202708:70E4A0:9DD315:6B05C404
html-safe-nonce0dbb5329bec445d8d074234ff99f9469d639515af823fc7fedd0b2fc82157a25
visitor-payloadeyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiI5NkE2OjIwMjcwODo3MEU0QTA6OUREMzE1OjZCMDVDNDA0IiwidmlzaXRvcl9pZCI6IjYyMDkxMDM2NzE3OTY4MTA3NTYiLCJyZWdpb25fZWRnZSI6ImlhZCIsInJlZ2lvbl9yZW5kZXIiOiJpYWQifQ==
visitor-hmac78e8e62ec7c71a7d1b1f9b4fa149a55a4e2f8d4a18dadc09258392dc726c1716
hovercard-subject-tagpull_request:4860902390
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/3500/files
twitter:imagehttps://avatars.githubusercontent.com/u/1063569?s=400&v=4
twitter:cardsummary_large_image
og:imagehttps://avatars.githubusercontent.com/u/1063569?s=400&v=4
og:image:altSummary On protocol 2026-07-28, get_file_contents returned every file twice: once as the embedded resource in content and again as text/blob in structuredContent. Structured output now carries only...
og:site_nameGitHub
og:typeobject
hostnamegithub.com
expected-hostnamegithub.com
None13b1c5df76a26b2d8420784ae7f9fb9c438fc6cb0c95a689d26fb49879d8e556
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
releasebcf1e3e7f14567fd89b0218ee06dd0aad8f1d288
ui-targetfull
theme-color#1e2327
color-schemelight dark

Links:

Skip to contenthttps://github.com/github/github-mcp-server/pull/3500/files#start-of-content
https://github.com/
Sign inhttps://github.com/login?return_to=https%3A%2F%2Fgithub.com%2Fgithub%2Fgithub-mcp-server%2Fpull%2F3500%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%2F3500%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/3500/files
Reloadhttps://github.com/github/github-mcp-server/pull/3500/files
Reloadhttps://github.com/github/github-mcp-server/pull/3500/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
jbayardohttps://github.com/jbayardo
mainhttps://github.com/github/github-mcp-server/tree/main
jbayardo-fix-get-file-contents-duplicationhttps://github.com/github/github-mcp-server/tree/jbayardo-fix-get-file-contents-duplication
Conversation 4 https://github.com/github/github-mcp-server/pull/3500
Commits 1 https://github.com/github/github-mcp-server/pull/3500/commits
Checks 20 https://github.com/github/github-mcp-server/pull/3500/checks
Findings https://github.com/github/github-mcp-server/pull/3500/findings
Files changed https://github.com/github/github-mcp-server/pull/3500/files
Please reload this pagehttps://github.com/github/github-mcp-server/pull/3500/files
fix(repos)!: stop mirroring file bodies in get_file_contents structured output https://github.com/github/github-mcp-server/pull/3500/files#top
Show all changes 1 commit https://github.com/github/github-mcp-server/pull/3500/files
6268548 Stop mirroring file bodies in get_file_contents structured output jbayardo Oct 14, 2026 https://github.com/github/github-mcp-server/pull/3500/commits/6268548d2e4d11c2214dce3e597be46c61fa434e
Clear filters https://github.com/github/github-mcp-server/pull/3500/files
Please reload this pagehttps://github.com/github/github-mcp-server/pull/3500/files
Please reload this pagehttps://github.com/github/github-mcp-server/pull/3500/files
typed-tool-schemas.md https://github.com/github/github-mcp-server/pull/3500/files#diff-88e857d4ee88afddac0437de4e7dc28eef105a4cf34f2d38c932706a83741681
get_file_contents.snap https://github.com/github/github-mcp-server/pull/3500/files#diff-2d050b2b798718a28d0a0c2ac76cde287bdbfea22cd405025a78b353638c92db
repository_tool_types.go https://github.com/github/github-mcp-server/pull/3500/files#diff-1189bc0ef240f3b188742d259f7703a82230bb1010d1de025c0494ba394311b1
typed_repository_outputs_test.go https://github.com/github/github-mcp-server/pull/3500/files#diff-926dc2e15a0f64365045a0083ac1cf94dd2b9852027a3918d651d4cbef9d73d6
typed_output.go https://github.com/github/github-mcp-server/pull/3500/files#diff-0fc1366f9f596022b9f0b3805ea7829378447f4ca7d14937ea4fb15fcde00956
typed_output_test.go https://github.com/github/github-mcp-server/pull/3500/files#diff-06f02f10eebabab66576db001f49d7a87e3c70d0081978a545b39bc44ed97a26
https://github.com/github/github-mcp-server/blob/main/.github/CODEOWNERS#L1
docs/typed-tool-schemas.mdhttps://github.com/github/github-mcp-server/pull/3500/files#diff-88e857d4ee88afddac0437de4e7dc28eef105a4cf34f2d38c932706a83741681
View file https://github.com/github/github-mcp-server/blob/6268548d2e4d11c2214dce3e597be46c61fa434e/docs/typed-tool-schemas.md
Open in desktop https://desktop.github.com
https://github.co/hiddenchars
https://github.com/github/github-mcp-server/pull/3500/{{ revealButtonHref }}
https://github.com/github/github-mcp-server/pull/3500/files#diff-88e857d4ee88afddac0437de4e7dc28eef105a4cf34f2d38c932706a83741681
https://github.com/github/github-mcp-server/blob/main/.github/CODEOWNERS#L1
pkg/github/__toolsnaps__/get_file_contents.snaphttps://github.com/github/github-mcp-server/pull/3500/files#diff-2d050b2b798718a28d0a0c2ac76cde287bdbfea22cd405025a78b353638c92db
View file https://github.com/github/github-mcp-server/blob/6268548d2e4d11c2214dce3e597be46c61fa434e/pkg/github/__toolsnaps__/get_file_contents.snap
Open in desktop https://desktop.github.com
https://github.co/hiddenchars
https://github.com/github/github-mcp-server/pull/3500/{{ revealButtonHref }}
https://github.com/github/github-mcp-server/pull/3500/files#diff-2d050b2b798718a28d0a0c2ac76cde287bdbfea22cd405025a78b353638c92db
https://github.com/github/github-mcp-server/pull/3500/files#diff-2d050b2b798718a28d0a0c2ac76cde287bdbfea22cd405025a78b353638c92db
https://github.com/github/github-mcp-server/blob/main/.github/CODEOWNERS#L1
pkg/github/repository_tool_types.gohttps://github.com/github/github-mcp-server/pull/3500/files#diff-1189bc0ef240f3b188742d259f7703a82230bb1010d1de025c0494ba394311b1
View file https://github.com/github/github-mcp-server/blob/6268548d2e4d11c2214dce3e597be46c61fa434e/pkg/github/repository_tool_types.go
Open in desktop https://desktop.github.com
https://github.co/hiddenchars
https://github.com/github/github-mcp-server/pull/3500/{{ revealButtonHref }}
https://github.com/github/github-mcp-server/pull/3500/files#diff-1189bc0ef240f3b188742d259f7703a82230bb1010d1de025c0494ba394311b1
https://github.com/github/github-mcp-server/pull/3500/files#diff-1189bc0ef240f3b188742d259f7703a82230bb1010d1de025c0494ba394311b1
https://github.com/github/github-mcp-server/pull/3500/files#diff-1189bc0ef240f3b188742d259f7703a82230bb1010d1de025c0494ba394311b1
https://github.com/github/github-mcp-server/pull/3500/files#diff-1189bc0ef240f3b188742d259f7703a82230bb1010d1de025c0494ba394311b1
https://github.com/github/github-mcp-server/pull/3500/files#diff-1189bc0ef240f3b188742d259f7703a82230bb1010d1de025c0494ba394311b1
https://github.com/github/github-mcp-server/pull/3500/files#diff-1189bc0ef240f3b188742d259f7703a82230bb1010d1de025c0494ba394311b1
https://github.com/github/github-mcp-server/pull/3500/files#diff-1189bc0ef240f3b188742d259f7703a82230bb1010d1de025c0494ba394311b1
https://github.com/github/github-mcp-server/pull/3500/files#diff-1189bc0ef240f3b188742d259f7703a82230bb1010d1de025c0494ba394311b1
https://github.com/github/github-mcp-server/blob/main/.github/CODEOWNERS#L1
pkg/github/typed_repository_outputs_test.gohttps://github.com/github/github-mcp-server/pull/3500/files#diff-926dc2e15a0f64365045a0083ac1cf94dd2b9852027a3918d651d4cbef9d73d6
View file https://github.com/github/github-mcp-server/blob/6268548d2e4d11c2214dce3e597be46c61fa434e/pkg/github/typed_repository_outputs_test.go
Open in desktop https://desktop.github.com
https://github.co/hiddenchars
https://github.com/github/github-mcp-server/pull/3500/{{ revealButtonHref }}
https://github.com/github/github-mcp-server/pull/3500/files#diff-926dc2e15a0f64365045a0083ac1cf94dd2b9852027a3918d651d4cbef9d73d6
https://github.com/github/github-mcp-server/pull/3500/files#diff-926dc2e15a0f64365045a0083ac1cf94dd2b9852027a3918d651d4cbef9d73d6
https://github.com/github/github-mcp-server/pull/3500/files#diff-926dc2e15a0f64365045a0083ac1cf94dd2b9852027a3918d651d4cbef9d73d6
https://github.com/github/github-mcp-server/pull/3500/files#diff-926dc2e15a0f64365045a0083ac1cf94dd2b9852027a3918d651d4cbef9d73d6
https://github.com/github/github-mcp-server/pull/3500/files#diff-926dc2e15a0f64365045a0083ac1cf94dd2b9852027a3918d651d4cbef9d73d6
https://github.com/github/github-mcp-server/pull/3500/files#diff-926dc2e15a0f64365045a0083ac1cf94dd2b9852027a3918d651d4cbef9d73d6
https://github.com/github/github-mcp-server/blob/main/.github/CODEOWNERS#L1
pkg/inventory/typed_output.gohttps://github.com/github/github-mcp-server/pull/3500/files#diff-0fc1366f9f596022b9f0b3805ea7829378447f4ca7d14937ea4fb15fcde00956
View file https://github.com/github/github-mcp-server/blob/6268548d2e4d11c2214dce3e597be46c61fa434e/pkg/inventory/typed_output.go
Open in desktop https://desktop.github.com
https://github.co/hiddenchars
https://github.com/github/github-mcp-server/pull/3500/{{ revealButtonHref }}
https://github.com/github/github-mcp-server/pull/3500/files#diff-0fc1366f9f596022b9f0b3805ea7829378447f4ca7d14937ea4fb15fcde00956
https://github.com/github/github-mcp-server/pull/3500/files#diff-0fc1366f9f596022b9f0b3805ea7829378447f4ca7d14937ea4fb15fcde00956
https://github.com/github/github-mcp-server/pull/3500/files#diff-0fc1366f9f596022b9f0b3805ea7829378447f4ca7d14937ea4fb15fcde00956
https://github.com/github/github-mcp-server/blob/main/.github/CODEOWNERS#L1
pkg/inventory/typed_output_test.gohttps://github.com/github/github-mcp-server/pull/3500/files#diff-06f02f10eebabab66576db001f49d7a87e3c70d0081978a545b39bc44ed97a26
View file https://github.com/github/github-mcp-server/blob/6268548d2e4d11c2214dce3e597be46c61fa434e/pkg/inventory/typed_output_test.go
Open in desktop https://desktop.github.com
https://github.co/hiddenchars
https://github.com/github/github-mcp-server/pull/3500/{{ revealButtonHref }}
https://github.com/github/github-mcp-server/pull/3500/files#diff-06f02f10eebabab66576db001f49d7a87e3c70d0081978a545b39bc44ed97a26
https://github.com/github/github-mcp-server/pull/3500/files#diff-06f02f10eebabab66576db001f49d7a87e3c70d0081978a545b39bc44ed97a26
Please reload this pagehttps://github.com/github/github-mcp-server/pull/3500/files
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.