Skip to content

[Schema][Server][Client] Add resource template icons, completion context, content block _meta and lastModified - #765

Open
ajibarra wants to merge 4 commits into
modelcontextprotocol:mainfrom
ajibarra:feature/protocol-gaps
Open

ajibarra wants to merge 4 commits into
modelcontextprotocol:mainfrom
ajibarra:feature/protocol-gaps

Conversation

@ajibarra

Copy link
Copy Markdown

Adds four optional fields the spec defines but the SDK did not read or write yet: icons on resource templates, context in completion/complete (handed to providers that implement the new ContextAwareProviderInterface), _meta on text, image, audio and embedded resource content, and the lastModified annotation. Each is its own commit, and every new argument is optional and comes last, so nothing existing breaks; I am happy to split them into separate PRs, or to add the context to ProviderInterface itself as a [BC Break], if you prefer.

ResourceTemplate extends Icons since protocol revision 2025-11-25, like
Resource, Tool and Prompt. The template now parses and serializes the
field, and #[McpResourceTemplate] and Builder::addResourceTemplate()
accept it, so resources/templates/list can carry icons.

The new parameter comes last to keep positional calls working.
Since protocol revision 2025-06-18, completion/complete carries an
optional context.arguments with the arguments the user already resolved
for the prompt or URI template. CompletionCompleteRequest now parses and
serializes it, Client::complete() can send it, and a provider that
implements the new ContextAwareProviderInterface receives the arguments.
Existing ProviderInterface implementations keep working unchanged.
Since protocol revision 2025-06-18, every content block can carry its
own _meta. ResourceLink already had it; TextContent, ImageContent,
AudioContent and EmbeddedResource now take an optional $meta, parse a
_meta object and serialize it. The _meta of an EmbeddedResource is the
block's own, separate from the one of its resource contents.
Annotations gained lastModified in protocol revision 2025-06-18: the
moment a resource or content block was last modified, as an ISO 8601
string. Annotations now takes it as an optional third argument, parses
it and serializes it, so it reaches resources, resource templates,
resource links and content blocks alike.

This branch has not been deployed

No deployments
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