Skip to content

Conversation

@aaronpowell
Copy link
Contributor

This is an update to the Resources and ResourceTemplates part of the MCP server which aims to align the data structures more with the structure that we see in the spec (using 2024-11-05 as the spec target).

Rather than using ResourceContents as a combination of the properties across blob and text resources, I've turned this into an abstract class and have implementations of the types. This more closely aligns with the structure we see in the schema, making it easier to map our types to the source types.

- Introducing separate classes for Text and Blob ResourceContents
- Custom JSON converter to allow those types to be returned, making it easier to follow the type system against the spec
- Updated tests
@aaronpowell aaronpowell marked this pull request as ready for review March 30, 2025 21:08
Copy link
Contributor

@stephentoub stephentoub left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Once the remaining comments are addressed, LGTM. Thanks!

@aaronpowell
Copy link
Contributor Author

Once the remaining comments are addressed, LGTM. Thanks!

Fixed that one and I think I got the merge correct from your change (and I fixed that at the same time)

@stephentoub stephentoub merged commit 3c0679e into modelcontextprotocol:main Mar 31, 2025
8 checks passed
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.

Using WithReadResourceHandler should work if you only provide WithListResourceTemplatesHandler

3 participants