Skip to content

Read Image File for Filesystem server #533

@cliffhall

Description

@cliffhall

Is your feature request related to a problem? Please describe.
Filesystem read_file tool currently only reads text files.

When asking Claude app with the filesystem MCP server enabled, asking it to read and analyze a file returns:

I can see there's an image file called "Untitled.png" in the directory. However, I need to clarify something: while I can see that the file exists, I cannot actually open or view image files. I can only work with text-based files and perform file system operations.
If you'd like me to analyze the image, you would need to describe what's in it or share it directly in our conversation. Is there something specific about the image you'd like to discuss?

Describe the solution you'd like
Add support for reading image files.

The "read_file" logic is in this switch statement in the filesystem server.

I haven't drilled into the MCP server deeply enough to know if another case in this switch and possibly some type declarations would be enough, or if there is some problem with handling an image returned from this tool as opposed to text. Feels like probably the latter, or it would have been relatively low-hanging fruit when the server was originally written.

Describe alternatives you've considered
I suppose the "read_file" tool could be modified to return text, images, or any other MIME type). I need to learn more about how the return from this function is consumed to know more.

Additional context
This arose from a discussion on Reddit.

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or requestserver-filesystemReference implementation for the Filesystem MCP server - src/filesystem

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions