Github MCP not returning the file contents requested with get_file_contents #9700
Unanswered
hi-fox
asked this question in
General Question
Replies: 2 comments
-
|
👀 @hi-fox Thank you for raising an issue. We will investigate into the matter and get back to you as soon as possible. |
Beta Was this translation helpful? Give feedback.
0 replies
-
|
I think it's more like the GitHub MCP Server issue. maybe you can combine this mcp server with some other MCP Server like |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
-
📦 Platform
Self hosting Docker
📦 Deploymenet mode
server db(lobe-chat-database image)
📌 Version
1.99.2
💻 Operating System
Windows
🌐 Browser
Firefox
🐛 Bug Description
I am trying to use the github MCP server (https://github.com/github/github-mcp-server) and I have got the entire thing connected and working except for when I try and call the "get_file_contents" method, it is failing as the response is that a file was downloaded:
function call:
{
"id": "call_0_44f94fb9-54aa-4fda-a988-683e314a8d69",
"type": "mcp",
"apiName": "get_file_contents",
"arguments": "{"owner": "hi-fox", "repo": "ark-sms", "path": "paths.py"}",
"identifier": "github"
}
response:
"successfully downloaded text file"
This is not expected behaviour. when you use a command like “get_file_contents” via this type of integration (or directly through the GitHub REST API), you should receive the actual text content of the file as part of the response usually either Base64-encoded (in GitHub API v3) or as a plain string, depending on the integration.
Normally, a successful response would include the file's content (or an error if something went wrong).
Is this an error on lobechat's end, or is this an error with the github MCP?
You can see I have correctly linked the MCP and attempting to get a list of the contents of the root directory does work:
{
"id": "call_ACeXV3TaEyIk8qjKfDurJ2Ks",
"type": "mcp",
"apiName": "get_file_contents",
"arguments": "{"path":"/","repo":"ark-sms","owner":"hi-fox"}",
"identifier": "github"
}
response:
[
{
"type": "file",
"size": 36,
"name": ".gitignore",
"path": ".gitignore",
"sha": "e4e1ff7cbcad60723ac1f9fb2ae600124965",
"url": "https://api.github.com/repos/hi-fox/ark-sms/contents/.gitignore?ref=main",
"git_url": "https://api.github.com/repos/hi-fox/ark-sms/git/blobs/e4e1ff7cbcad6072322ac1f9fb2ae600124965",
"html_url": "https://github.com/hi-fox/ark-sms/blob/main/.gitignore",
"download_url": "https://raw.githubusercontent.com/hi-fox/ark-sms/main/.gitignore?token=AGA5CYCGCVQEHPLIZG3IOZYG2"
},
{
"type": "file",
"size": 43037,
"name": "ARKBackup.py",
"path": "ARKBackup.py",
"sha": "491e77f97e0985b55e91597be36bc2420211f",
"url": "https://api.github.com/repos/hi-fox/ark-sms/contents/ARKBackup.py?ref=main",
"git_url": "https://api.github.com/repos/hi-fox/ark-sms/git/blobs/491e77f97e098e91597be39e6bc24920211f",
"html_url": "https://github.com/hi-fox/ark-sms/blob/main/ARKBackup.py",
"download_url": "https://raw.githubusercontent.com/hi-fox/ark-sms/main/ARKBackup.py?token=AGA5CYDI3757JEEEEBVLIOZYG2"
},
etc
But the actual file contents does not.
📷 Recurrence Steps
Add the github MCP from their official github page, and try and use the get_file_contents method to pull the contents of any file. This error is reproducible on any repo I have tried.
🚦 Expected Behavior
I expect the output of the file to be given in the JSON response. I should receive JSON including:
something like:
{
"name": "file.py",
"path": "file.py",
"sha": "abc123...",
"size": 1234,
"content": "aW1wb3J0IG9zCmltcG9ydCBzeXMKLi4u",
"encoding": "base64",
"url": "...",
}
Tools/integrations should extract and decode that, returning a plain-text version for users.
📝 Additional Information
No response
Beta Was this translation helpful? Give feedback.
All reactions