Skip to content

Conversation

samchenatti
Copy link

@samchenatti samchenatti commented Sep 24, 2025

This PR validates types.RequestParams.Meta to enforce the MCP specification for the _meta field.

Motivation and Context

This change ensures that users won't rely on invalid key names when using the _meta field.

How Has This Been Tested?

It was tested in a local client/server setup.

Unit-tests were also added to ensure the correct behavior.

Breaking Changes

There are breaking changes in the case some users are already using invalid _meta keys.

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

Additional context

It is the result of discussion in #1231

Although I'm not entirely sure we should enforce this validation through the SDK, I'm offering this approach as a possible option.

@samchenatti samchenatti requested review from a team and ihrpr September 24, 2025 16:53
@felixweinberger felixweinberger added this to the META Improvements milestone Sep 30, 2025
@felixweinberger felixweinberger added breaking change Will break existing deployments when updated without changes v2 Ideas, requests and plans for v2 of the SDK which will incorporate major changes and fixes labels Sep 30, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
breaking change Will break existing deployments when updated without changes v2 Ideas, requests and plans for v2 of the SDK which will incorporate major changes and fixes
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants