René's URL Explorer Experiment


Title: create_or_update_file cannot represent true binary content — no encoding parameter, JSON string requires valid UTF-8 · Issue #3312 · github/github-mcp-server · GitHub

Open Graph Title: create_or_update_file cannot represent true binary content — no encoding parameter, JSON string requires valid UTF-8 · Issue #3312 · github/github-mcp-server

X Title: create_or_update_file cannot represent true binary content — no encoding parameter, JSON string requires valid UTF-8 · Issue #3312 · github/github-mcp-server

Description: Describe the bug create_or_update_file has no way to write a genuine binary file (e.g. a PNG) without corruption, even when the caller follows the tool's own current description exactly. The content parameter description says: "Content o...

Open Graph Description: Describe the bug create_or_update_file has no way to write a genuine binary file (e.g. a PNG) without corruption, even when the caller follows the tool's own current description exactly. The conten...

X Description: Describe the bug create_or_update_file has no way to write a genuine binary file (e.g. a PNG) without corruption, even when the caller follows the tool's own current description exactly. The co...

Opengraph URL: https://github.com/github/github-mcp-server/issues/3312

X: @github

direct link

Domain: github.com

IPv4 address: 140.82.114.4


Hey, it has json ld scripts:
{"@context":"https://schema.org","@type":"DiscussionForumPosting","headline":"create_or_update_file cannot represent true binary content — no encoding parameter, JSON string requires valid UTF-8","articleBody":"### Describe the bug\n\n`create_or_update_file` has no way to write a genuine binary file (e.g. a PNG) without corruption, even when the caller follows the tool's own current description exactly.\n\nThe `content` parameter description says:\n\n> \"Content of the file, exactly as it should appear once written. Do not base64-encode it; this server does that before calling the REST API.\"\n\nThis reads as a fix for #2981 (models pre-encoding out of confusion with the REST API docs). But it doesn't address the deeper problem: **`content` is a JSON string, and JSON strings must be valid UTF-8.** Raw binary bytes (arbitrary byte sequences, e.g. PNG magic bytes `89 50 4E 47 ...`) are frequently *not* valid UTF-8, so there is no way to place them into this parameter at all — encoded or not:\n\n- Pass the raw bytes as-is → most MCP/JSON transports will reject the call outright (invalid UTF-8 in a string field), or the bytes get mangled by whatever text encoding recovery the client/transport applies.\n- Pre-encode as base64 yourself (the \"obvious\" workaround, and what #2981's own reproduction did) → per the current server behavior, the base64 **text** is stored literally as the file's bytes. The tool reports success; the resulting file is corrupt (its content is the ASCII base64 string, not the decoded image).\n\n### Minimal reproduction\n\nCreated a 77-byte, 10×10 solid-color PNG, base64-encoded it (104 chars), and called `create_or_update_file` with that base64 string as `content`:\n\ncontent: \"iVBORw0KGgoAAAANSUhEUgAAAAoAAAAKCAIAAAACUFjqAAAAFElEQVR4nGP8n2XJgBsw4ZEbwdIABR4Btgm0KTcAAAAASUVORK5CYII=\"\n\n\nResult: commit succeeds, `content.size` in the response is **104** (the length of the base64 *text*), not 77 (the actual PNG size). Fetching the file back with `get_file_contents` returns the literal base64 string as the file's text content — not a decodable/valid PNG.\n\nThere is no parameter on this tool to say \"this content is base64\" or otherwise indicate a binary-safe encoding, unlike what a `content_base64` / `encoding` field would provide. Every path leads to a corrupted binary file for any client that can only pass JSON string parameters (which is all MCP clients).\n\n### Impact\n\nAny MCP client — including AI agents — that needs to commit a binary asset (image, font, icon, PDF, zip, etc.) via `create_or_update_file` (or the equivalent multi-file `push_files`, which has the identical `content: string` shape per-file) cannot do so reliably. The only safe workaround currently is bypassing this tool entirely (e.g. driving the GitHub web upload UI in a browser, or using a real `git` client locally), which defeats the purpose of having this tool.\n\n### Suggested fix\n\nAdd an explicit binary-safe path, e.g.:\n- An optional `encoding` (or `content_encoding`) parameter on `create_or_update_file` and each file entry in `push_files`, with values like `\"utf-8\"` (default, current behavior) and `\"base64\"` — when `\"base64\"`, the server decodes the given base64 string once and writes the resulting raw bytes, instead of writing the base64 text (or double-encoding it).\n- Document clearly in the parameter description which mode is used, since this is exactly the ambiguity #2981 tried (and, per this report, failed) to close.\n\n### Related\n\n- #2981 — addressed the *ambiguity* around double-encoding of text-ish content, but this report shows the description fix alone does not make binary uploads possible; there is still no valid way to submit non-UTF-8 bytes.\n- #3097 — the mirror-image bug on the read path (`get_file_contents` double-base64-encoding binaries), already fixed.\n- #372 — requested a non-base64 *read* option; this report is the write-side binary-safe request.\n\n### Environment\n\nReproduced via the hosted GitHub MCP Server connector, 2026-09-19, through an Anthropic Claude MCP connector session. Not version-specific — the tool's `content` parameter has always been a plain JSON string with no encoding flag.","author":{"url":"https://github.com/DrWilliamBell","@type":"Person","name":"DrWilliamBell"},"datePublished":"2026-09-19T21:28:44Z","url":"https://github.com/github/github-mcp-server/issues/3312"}

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/_view_fragments/issues/show/:user_id/:repository/:id/issue_layout(.:format)
route-controllervoltron_issues_fragments
route-actionissue_layout
fetch-noncev2:13fac41b-6a65-e5ed-49fd-4a3fff0728d4
current-catalog-service-hash81bb79d38c15960b92d99bca9288a9108c7a47b18f2423d0f6438c5b7bcd2114
request-idD438:1188C0:AD6ABB:E0BE80:6B0638A7
html-safe-nonce36512feb7a08f0b63b94513ca94747b9196a4908e19200b852e77870335bac22
visitor-payloadeyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiJENDM4OjExODhDMDpBRDZBQkI6RTBCRTgwOjZCMDYzOEE3IiwidmlzaXRvcl9pZCI6IjQ2MjIwMjMxNDY0OTEyMjk4MyIsInJlZ2lvbl9lZGdlIjoiaWFkIiwicmVnaW9uX3JlbmRlciI6ImlhZCJ9
visitor-hmac2bc9ce568b8dfa18b8504a7bf5c605d3c30b58c75764cdcafb206ee4cb3d9be3
hovercard-subject-tagissue:5513696634
github-keyboard-shortcutsrepository,issues,copilot
google-site-verificationApib7-x98H0j5cPqHWwSMm6dNU4GmODRoqxLiDzdx9I
octolytics-urlhttps://collector.github.com/github/collect
analytics-location///voltron/issues_fragments/issue_layout
fb:app_id1401488693436528
apple-itunes-appapp-id=1477376905, app-argument=https://github.com/_view_fragments/issues/show/github/github-mcp-server/3312/issue_layout
twitter:imagehttps://opengraph.githubassets.com/90634290c6b0a51dcb314827b0f7d377bad0ec79f23bbed9ef4ac3d16fe0ae01/github/github-mcp-server/issues/3312
twitter:cardsummary_large_image
og:imagehttps://opengraph.githubassets.com/90634290c6b0a51dcb314827b0f7d377bad0ec79f23bbed9ef4ac3d16fe0ae01/github/github-mcp-server/issues/3312
og:image:altDescribe the bug create_or_update_file has no way to write a genuine binary file (e.g. a PNG) without corruption, even when the caller follows the tool's own current description exactly. The conten...
og:image:width1200
og:image:height600
og:site_nameGitHub
og:typeobject
og:author:usernameDrWilliamBell
hostnamegithub.com
expected-hostnamegithub.com
Nonedcf72c457c022486d23c3cbb0dd21aba537a87611ca9ddabd1799cf2eaa9b297
turbo-cache-controlno-preview
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
disable-turbofalse
browser-stats-urlhttps://api.github.com/_private/browser/stats
browser-errors-urlhttps://api.github.com/_private/browser/errors
release0f38f5735226749ec5e08a8649dce4cb2613d9ad
ui-targetfull
theme-color#1e2327
color-schemelight dark
react-app-nameissues

Links:

Skip to contenthttps://github.com/github/github-mcp-server/issues/3312#start-of-content
https://github.com/
Sign inhttps://github.com/login?return_to=https%3A%2F%2Fgithub.com%2Fgithub%2Fgithub-mcp-server%2Fissues%2F3312
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%2Fissues%2F3312
Sign uphttps://github.com/signup?ref_cta=Sign+up&ref_loc=header+logged+out&ref_page=%2F%3Cuser-name%3E%2F%3Crepo-name%3E%2Fvoltron%2Fissues_fragments%2Fissue_layout&source=header-repo&source_repo=github%2Fgithub-mcp-server
Reloadhttps://github.com/github/github-mcp-server/issues/3312
Reloadhttps://github.com/github/github-mcp-server/issues/3312
Reloadhttps://github.com/github/github-mcp-server/issues/3312
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
https://github.com/github/github-mcp-server
New issuehttps://github.com/login?return_to=https://github.com/github/github-mcp-server/issues/3312
New issuehttps://github.com/login?return_to=https://github.com/github/github-mcp-server/issues/3312
#3313https://github.com/github/github-mcp-server/pull/3313
create_or_update_file cannot represent true binary content — no encoding parameter, JSON string requires valid UTF-8https://github.com/github/github-mcp-server/issues/3312#top
#3313https://github.com/github/github-mcp-server/pull/3313
bughttps://github.com/github/github-mcp-server/issues?q=state%3Aopen%20label%3A%22bug%22
https://github.com/DrWilliamBell
DrWilliamBellhttps://github.com/DrWilliamBell
on Sep 19, 2026https://github.com/github/github-mcp-server/issues/3312#issue-5513696634
#2981https://github.com/github/github-mcp-server/issues/2981
create_or_update_file content description doesn't specify plaintext, leading models to double-encode #2981https://github.com/github/github-mcp-server/issues/2981
create_or_update_file content description doesn't specify plaintext, leading models to double-encode #2981https://github.com/github/github-mcp-server/issues/2981
create_or_update_file content description doesn't specify plaintext, leading models to double-encode #2981https://github.com/github/github-mcp-server/issues/2981
get_file_contents double-base64-encodes binary files, corrupting all images #3097https://github.com/github/github-mcp-server/issues/3097
get_file_contents tool should have non-base64 option #372https://github.com/github/github-mcp-server/issues/372
github-actionshttps://github.com/apps/github-actions
request ai reviewhttps://github.com/github/github-mcp-server/issues?q=state%3Aopen%20label%3A%22request%20ai%20review%22
request ai reviewhttps://github.com/github/github-mcp-server/issues?q=state%3Aopen%20label%3A%22request%20ai%20review%22
on Sep 19, 2026https://github.com/github/github-mcp-server/issues/3312#event-31460515779
SamMorrowDrumshttps://github.com/SamMorrowDrums
bughttps://github.com/github/github-mcp-server/issues?q=state%3Aopen%20label%3A%22bug%22
on Sep 26, 2026https://github.com/github/github-mcp-server/issues/3312#event-31894385066
kyletserhttps://github.com/kyletser
on Oct 12, 2026https://github.com/github/github-mcp-server/issues/3312#event-33039625625
fix: support binary file content via base64 encoding in create_or_upd…https://github.com/kyletser/github-mcp-server/commit/a284127eb37681ada895280e9a22eee08805a4be
https://docs.github.com/articles/closing-issues-via-commit-messages
a284127https://github.com/kyletser/github-mcp-server/commit/a284127eb37681ada895280e9a22eee08805a4be
kyletserhttps://github.com/kyletser
on Oct 24, 2026https://github.com/github/github-mcp-server/issues/3312#event-34117611780
fix: support binary file content via base64 encoding in create_or_upd…https://github.com/kyletser/github-mcp-server/commit/68e73ed4b8b135a11f53f2a3dee38cab79a22ed1
https://docs.github.com/articles/closing-issues-via-commit-messages
68e73edhttps://github.com/kyletser/github-mcp-server/commit/68e73ed4b8b135a11f53f2a3dee38cab79a22ed1
Sign up for freehttps://github.com/signup?return_to=https://github.com/github/github-mcp-server/issues/3312
Sign in to commenthttps://github.com/login?return_to=https://github.com/github/github-mcp-server/issues/3312
bughttps://github.com/github/github-mcp-server/issues?q=state%3Aopen%20label%3A%22bug%22
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-Controlmax-age=0, private, must-revalidate

Viewport: width=device-width


URLs of crawlers that visited me.