Skip to content

filesystem: read_media_file returns invalid 'blob' content type, violating MCP spec #4029

@blackwell-systems

Description

@blackwell-systems

Bug

read_media_file returns type: "blob" in the content array, which is not a valid MCP content type. The MCP 2025-11-25 specification defines only five valid content types: text, image, audio, resource_link, and resource.

Reproduction

# Start the filesystem server
npx @modelcontextprotocol/server-filesystem /tmp

# Create a text file
echo "hello" > /tmp/test.txt

# Call read_media_file on a non-media file via MCP
# The server returns type: "blob" which causes:
# MCP error -32602: Invalid tools/call result

The MCP client rejects the response at the transport layer because "blob" doesn't match any valid content type union variant (text, image, audio, resource_link, resource).

Expected behavior

Either:

  1. Return isError: true with a message like "not a media file" when the file is not an image/audio type
  2. Return type: "image" with mimeType: "application/octet-stream" and the base64 data (if the intent is to support arbitrary binary files)

Environment

  • @modelcontextprotocol/server-filesystem (latest via npx)
  • MCP protocol version: 2025-11-05
  • Client: mcp-assert (deterministic MCP server testing tool)

Found while writing a comprehensive assertion suite for all 14 filesystem server tools.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions