Skip to content

Fix Content::Image#to_h to return mimeType (camelCase) per MCP spec#241

Merged
koic merged 1 commit intomodelcontextprotocol:mainfrom
koic:fix_content_image_to_h
Mar 1, 2026
Merged

Fix Content::Image#to_h to return mimeType (camelCase) per MCP spec#241
koic merged 1 commit intomodelcontextprotocol:mainfrom
koic:fix_content_image_to_h

Conversation

@koic
Copy link
Member

@koic koic commented Feb 27, 2026

Motivation and Context

This is a fix for a similar bug that remained, as in #235.

Content::Image#to_h returned mime_type (snake_case), but the MCP spec requires mimeType (camelCase) for the MIME type field in image content.

How Has This Been Tested?

Added a repro test to verify the fix and prevent regression.

Breaking Changes

None. This fixes behavior that was incorrect with respect to the specification.

Types of changes

  • Bug fix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)
  • Breaking change (fix or feature that would cause existing functionality to change)
  • Documentation update

Checklist

  • I have read the MCP Documentation
  • My code follows the repository's style guidelines
  • New and existing tests pass locally
  • I have added appropriate error handling
  • I have added or updated documentation as needed

This is a fix for a similar bug that remained, as in modelcontextprotocol#235.

`Content::Image#to_h` returned `mime_type` (snake_case), but the MCP spec
requires `mimeType` (camelCase) for the MIME type field in image content.
@koic koic merged commit c62902b into modelcontextprotocol:main Mar 1, 2026
10 checks passed
@koic koic deleted the fix_content_image_to_h branch March 1, 2026 08:16
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants