Fix Resource::Contents#to_h to use correct property names per MCP spec

This PR fixes thr following fields with the MCP specification which requires:

- Text resources use `text` and `mimeType` fields
- Binary resources use `blob` (base64-encoded) and `mimeType` fields

https://modelcontextprotocol.io/specification/2025-11-25/server/resources#resource-contents

Fixes #234.
This commit is contained in:
Koichi ITO 2026-02-19 11:29:53 +09:00
commit 08832c6b43

View file

@ -11,7 +11,7 @@ module MCP
end
def to_h
{ uri: uri, mime_type: mime_type }.compact
{ uri: uri, mimeType: mime_type }.compact
end
end
@ -37,7 +37,7 @@ module MCP
end
def to_h
super.merge(data: data)
super.merge(blob: data)
end
end
end