Title: Unable to obtain empty file from git repo via MCP · Issue #2041 · github/github-mcp-server · GitHub
Open Graph Title: Unable to obtain empty file from git repo via MCP · Issue #2041 · github/github-mcp-server
X Title: Unable to obtain empty file from git repo via MCP · Issue #2041 · github/github-mcp-server
Description: Describe the bug get_file_contents tool fails when you try to obtain file which is empty (0 bytes) Affected version Latest and GitHub managed MCP server Steps to reproduce the behavior Example repo: https://github.com/kubajanusz/mcp-404-...
Open Graph Description: Describe the bug get_file_contents tool fails when you try to obtain file which is empty (0 bytes) Affected version Latest and GitHub managed MCP server Steps to reproduce the behavior Example repo...
X Description: Describe the bug get_file_contents tool fails when you try to obtain file which is empty (0 bytes) Affected version Latest and GitHub managed MCP server Steps to reproduce the behavior Example repo...
Opengraph URL: https://github.com/github/github-mcp-server/issues/2041
X: @github
Domain: github.com
IPv4 address: 140.82.112.3
{"@context":"https://schema.org","@type":"DiscussionForumPosting","headline":"Unable to obtain empty file from git repo via MCP","articleBody":"### Describe the bug\n\nget_file_contents tool fails when you try to obtain file which is empty (0 bytes)\n\n### Affected version\n\nLatest and GitHub managed MCP server\n\n### Steps to reproduce the behavior\n\nExample repo: https://github.com/kubajanusz/mcp-404-and-tag-errors-example\n\n1. Prompt: `Run #get_file_contents to obtain file README.md from main branch`\n2. File is obtained\n3. See error\n```\nCannot read properties of undefined (reading 'length') (at tsx element Lx > sV > $Ne > Get > Xs > \u003canonymous> > \u003canonymous> > Wrt > zet > Zet > Uh > Ket > Sde > YD)\n```\n\n\u003cimg width=\"560\" height=\"596\" alt=\"Image\" src=\"https://github.com/user-attachments/assets/09e1d6df-9011-4914-a5da-6a832fcf26d5\" />\n\n### Expected vs actual behavior\n\nInformation that file is empty is handled and passed back to VS Code\n\n### Logs\n\n```\n2026-02-18 17:06:57.546 [info] ccreq:eb41aca6.copilotmd | success | claude-opus-4.6 -> claude-opus-4-6 | 9205ms | [panel/editAgent]\n2026-02-18 17:06:58.569 [error] TypeError (FileSystemError): Cannot read properties of undefined (reading 'length') (at tsx element Lx > sV > $Ne > Get > Xs > \u003canonymous> > \u003canonymous> > Wrt > zet > Zet > Uh > Ket > Sde > YD)\n\tat Rr.e (file:///home/user/.vscode-server/bin/c3a26841a84f20dfe0850d0a5a9bd01da4f003ea/out/vs/workbench/api/node/extensionHostProcess.js:116:18876)\n\tat Object.stat (file:///home/user/.vscode-server/bin/c3a26841a84f20dfe0850d0a5a9bd01da4f003ea/out/vs/workbench/api/node/extensionHostProcess.js:116:16027)\n\tat process.processTicksAndRejections (node:internal/process/task_queues:105:5)\n\tat async TXe (/home/user/.vscode-server/extensions/github.copilot-chat-0.37.6/dist/extension.js:1213:10510)\n\tat async woe.readFile (/home/user/.vscode-server/extensions/github.copilot-chat-0.37.6/dist/extension.js:5529:17209)\n\tat async YD.render (/home/user/.vscode-server/extensions/github.copilot-chat-0.37.6/dist/extension.js:1498:859)\n\tat async MHt (/home/user/.vscode-server/extensions/github.copilot-chat-0.37.6/dist/extension.js:144:3828)\n\tat async /home/user/.vscode-server/extensions/github.copilot-chat-0.37.6/dist/extension.js:142:28188\n\tat async Promise.all (index 0)\n\tat async Ft._processPromptPieces (/home/user/.vscode-server/extensions/github.copilot-chat-0.37.6/dist/extension.js:142:28099)\n\tat async Ft._processPromptRenderPiece (/home/user/.vscode-server/extensions/github.copilot-chat-0.37.6/dist/extension.js:142:28693)\n\tat async Ft._processPromptPieces (/home/user/.vscode-server/extensions/github.copilot-chat-0.37.6/dist/extension.js:142:28343)\n\tat async Ft._processPromptRenderPiece (/home/user/.vscode-server/extensions/github.copilot-chat-0.37.6/dist/extension.js:142:28693)\n\tat async Ft._processPromptPieces (/home/user/.vscode-server/extensions/github.copilot-chat-0.37.6/dist/extension.js:142:28343)\n\tat async Ft._processPromptRenderPiece (/home/user/.vscode-server/extensions/github.copilot-chat-0.37.6/dist/extension.js:142:28693)\n\tat async Ft._processPromptPieces (/home/user/.vscode-server/extensions/github.copilot-chat-0.37.6/dist/extension.js:142:28343)\n\tat async Ft._processPromptRenderPiece (/home/user/.vscode-server/extensions/github.copilot-chat-0.37.6/dist/extension.js:142:28693)\n\tat async Ft._processPromptPieces (/home/user/.vscode-server/extensions/github.copilot-chat-0.37.6/dist/extension.js:142:28343)\n\tat async Ft._processPromptRenderPiece (/home/user/.vscode-server/extensions/github.copilot-chat-0.37.6/dist/extension.js:142:28693)\n\tat async Ft._processPromptPieces (/home/user/.vscode-server/extensions/github.copilot-chat-0.37.6/dist/extension.js:142:28343)\n\tat async Ft._processPromptRenderPiece (/home/user/.vscode-server/extensions/github.copilot-chat-0.37.6/dist/extension.js:142:28693)\n\tat async Ft._processPromptPieces (/home/user/.vscode-server/extensions/github.copilot-chat-0.37.6/dist/extension.js:142:28343)\n\tat async Ft._processPromptRenderPiece (/home/user/.vscode-server/extensions/github.copilot-chat-0.37.6/dist/extension.js:142:28693)\n\tat async Ft._processPromptPieces (/home/user/.vscode-server/extensions/github.copilot-chat-0.37.6/dist/extension.js:142:28343)\n\tat async Ft._processPromptRenderPiece (/home/user/.vscode-server/extensions/github.copilot-chat-0.37.6/dist/extension.js:142:28693)\n\tat async Ft._processPromptPieces (/home/user/.vscode-server/extensions/github.copilot-chat-0.37.6/dist/extension.js:142:28343)\n\tat async Ft._processPromptRenderPiece (/home/user/.vscode-server/extensions/github.copilot-chat-0.37.6/dist/extension.js:142:28693)\n\tat async Ft._processPromptPieces (/home/user/.vscode-server/extensions/github.copilot-chat-0.37.6/dist/extension.js:142:28343)\n\tat async Ft._processPromptRenderPiece (/home/user/.vscode-server/extensions/github.copilot-chat-0.37.6/dist/extension.js:142:28693)\n\tat async Ft._processPromptPieces (/home/user/.vscode-server/extensions/github.copilot-chat-0.37.6/dist/extension.js:142:28343)\n\tat async Ft._processPromptRenderPiece (/home/user/.vscode-server/extensions/github.copilot-chat-0.37.6/dist/extension.js:142:28693)\n\tat async Ft._processPromptPieces (/home/user/.vscode-server/extensions/github.copilot-chat-0.37.6/dist/extension.js:142:28343)\n\tat async Ft._processPromptRenderPiece (/home/user/.vscode-server/extensions/github.copilot-chat-0.37.6/dist/extension.js:142:28693)\n\tat async Ft._processPromptPieces (/home/user/.vscode-server/extensions/github.copilot-chat-0.37.6/dist/extension.js:142:28343)\n\tat async Ft._processPromptRenderPiece (/home/user/.vscode-server/extensions/github.copilot-chat-0.37.6/dist/extension.js:142:28693)\n\tat async Ft._processPromptPieces (/home/user/.vscode-server/extensions/github.copilot-chat-0.37.6/dist/extension.js:142:28343)\n\tat async Ft.renderRaw (/home/user/.vscode-server/extensions/github.copilot-chat-0.37.6/dist/extension.js:142:29134)\n\tat async Ft.render (/home/user/.vscode-server/extensions/github.copilot-chat-0.37.6/dist/extension.js:142:29018)\n\tat async Ft.render (/home/user/.vscode-server/extensions/github.copilot-chat-0.37.6/dist/extension.js:1484:14032)\n\tat async C2.buildPrompt (/home/user/.vscode-server/extensions/github.copilot-chat-0.37.6/dist/extension.js:2007:6435)\n\tat async Che.buildPrompt (/home/user/.vscode-server/extensions/github.copilot-chat-0.37.6/dist/extension.js:2001:7518)\n\tat async Che.buildPrompt2 (/home/user/.vscode-server/extensions/github.copilot-chat-0.37.6/dist/extension.js:1648:11591)\n\tat async Che.runOne (/home/user/.vscode-server/extensions/github.copilot-chat-0.37.6/dist/extension.js:1648:6047)\n\tat async Che.run (/home/user/.vscode-server/extensions/github.copilot-chat-0.37.6/dist/extension.js:1648:2288)\n\tat async jy.runWithToolCalling (/home/user/.vscode-server/extensions/github.copilot-chat-0.37.6/dist/extension.js:2001:11)\n\tat async jy.getResult (/home/user/.vscode-server/extensions/github.copilot-chat-0.37.6/dist/extension.js:2000:1437)\n\tat async She.getResult (/home/user/.vscode-server/extensions/github.copilot-chat-0.37.6/dist/extension.js:2005:5959)\n\tat async RM.getResult (/home/user/.vscode-server/extensions/github.copilot-chat-0.37.6/dist/extension.js:2018:9182)\n\tat async t3.x (/home/user/.vscode-server/extensions/github.copilot-chat-0.37.6/dist/extension.js:6200:1359)\n\tat async _d.$invokeAgent (file:///home/user/.vscode-server/bin/c3a26841a84f20dfe0850d0a5a9bd01da4f003ea/out/vs/workbench/api/node/extensionHostProcess.js:144:53500)\n```","author":{"url":"https://github.com/kubajanusz","@type":"Person","name":"kubajanusz"},"datePublished":"2026-02-18T16:11:14Z","url":"https://github.com/github/github-mcp-server/issues/2041"}
| 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:ad7a2de1-c3a1-e14c-7366-b4295f11caf4 |
| current-catalog-service-hash | 81bb79d38c15960b92d99bca9288a9108c7a47b18f2423d0f6438c5b7bcd2114 |
| request-id | 808A:333887:426FFB:5B2C64:6B068581 |
| html-safe-nonce | 5442795f272cd60ededce48424e12783a09fbb1969aee15836804036f6a1bc00 |
| visitor-payload | eyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiI4MDhBOjMzMzg4Nzo0MjZGRkI6NUIyQzY0OjZCMDY4NTgxIiwidmlzaXRvcl9pZCI6IjI4MzAzNTYyNzg4NzY5MTEzNyIsInJlZ2lvbl9lZGdlIjoiaWFkIiwicmVnaW9uX3JlbmRlciI6ImlhZCJ9 |
| visitor-hmac | 0cc629a6644e7bb4b16198a8281558591ff8a6960511b2cef9a6ab06148d5afe |
| hovercard-subject-tag | issue:3958626972 |
| 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/2041/issue_layout |
| twitter:image | https://opengraph.githubassets.com/694275633d846ce8dab664be0eda31f83ec46788facbc8d4ae8b27d26f862a00/github/github-mcp-server/issues/2041 |
| twitter:card | summary_large_image |
| og:image | https://opengraph.githubassets.com/694275633d846ce8dab664be0eda31f83ec46788facbc8d4ae8b27d26f862a00/github/github-mcp-server/issues/2041 |
| og:image:alt | Describe the bug get_file_contents tool fails when you try to obtain file which is empty (0 bytes) Affected version Latest and GitHub managed MCP server Steps to reproduce the behavior Example repo... |
| og:image:width | 1200 |
| og:image:height | 600 |
| og:site_name | GitHub |
| og:type | object |
| og:author:username | kubajanusz |
| hostname | github.com |
| expected-hostname | github.com |
| None | 4462ff7ebfd3d551f202659f2423dae617b6849d23b1df6465dc504ef497d14a |
| 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 | 6d3909414814ff86ce7da4c51a0f4918a13fb41b |
| 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