github-mcp-server icon indicating copy to clipboard operation
github-mcp-server copied to clipboard

get_file_contents throws MCP error: resource not found

Open riteshmoud opened this issue 2 months ago • 2 comments

Describe the bug

When trying to fetch a file, get_file_contents tool is called but it is giving me below error.

MCP error -32002: handler not found for resource URI `file://{organization}/{repo}/{filePath}` : resource not found

I confirm that the parameters sent like org, repo, path, ref are correct.

riteshmoud avatar Oct 04 '25 20:10 riteshmoud

Hey @riteshmoud, thank you for raising this!

The get_file_contents tool should automatically generate the correct resource URI for you (i.e., repo://...). The fact that you are seeing the error you shared suggests something else is happening, as file://{organization}/{repo}/{filePath} is not a valid URI.

Just to gather more information, as I have not been able to replicate your error using the latest version of the MCP server, could you please share:

  • what version of the MCP server you are using and any information on how you are configuring it
  • the exact tool call you are making (it's perfectly fine and actually suggested to redact anything you deem personal/sensitive)

kerobbi avatar Oct 06 '25 15:10 kerobbi

Hi @kerobbi ! With the remote mcp server, for me it works in VSCode, but not in Cursor.

After using the get_file_contents tool - e.g.

successfully downloaded text file (SHA: 050d6743e9b4ccdb00ca452bce2eee946fa0f1ee)

I can click on the repo://.... link and it opens up the file in Cursor with its content.

But when the agent continues in Cursor it cannot read those files. It errors with

/var/folders/g5/v0l6hkv97fvOh7k_2_6q0k200000gn/T/mcp-XXX-ab532db6218b40c0a55eea3e3ce0bfce7456398d.md" does not exist on my system

ThomSMG avatar Oct 31 '25 15:10 ThomSMG