Improvment: Use resources and resource urls with the filesystem MCP server #297
Labels
enhancement
New feature or request
server-filesystem
Reference implementation for the Filesystem MCP server - src/filesystem
Is your feature request related to a problem? Please describe.
The filesystem MCP server method for reading non-text files is to call the read_file tool and return a base64 encoded string of the contents of the file. This is of limited usefulness and on files of moderate size it maxes out the response size and crashes claude.
This pretty much prevents using the filesystem MCP to interact with image files on local storage as any modern image is too large to load as a base64 string (and pass all the text through the LLM consuming tons of tokens).
The modelcontextprotocol spec describes how binary resources can be used for images and documents: https://modelcontextprotocol.io/docs/concepts/resources#binary-resources
Describe the solution you'd like
As a reference implementation the filesystem MCP should return resource urls rather than raw contents for non-text files, or for files over a certain size.
Describe alternatives you've considered
Allow Claude to directly load images into its context based on a path to a file without needing to use MCP
The text was updated successfully, but these errors were encountered: