Skip to content

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

Open
koic wants to merge 1 commit intomodelcontextprotocol:mainfrom
koic:fix_content_image_to_h
Open

Fix Content::Image#to_h to return mimeType (camelCase) per MCP spec#241
koic wants to merge 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.
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.

1 participant