This repository was archived by the owner on Apr 11, 2026. It is now read-only.
Closed
Conversation
Add `meta` attribute to both annotations, enabling MCP Apps UI metadata (e.g. _meta.ui.resourceUri, _meta.ui.csp) to be declared directly on annotated methods. Meta propagates to tool/resource declarations and to resource content in ReadResourceResult. Signed-off-by: Alexandros Pappas <apappascs@gmail.com>
Append the ability to define "_meta" property in tool, prompt, resource declarations Usage: ``` @mcptool(metaProvider = MyMetaProvider.class) String myTool() { } class MyMetaProvider implements MetaProvider { return Map.of( "openai/widgetPrefersBorder", true, "openai/widgetDomain", 'https://chatgpt.com', "openai/widgetCSP", new WidgetCsp()); } ``` Signed-off-by: Vadzim Shurmialiou <vadzim.shurmialiou@check24.de>
tzolov
approved these changes
Mar 2, 2026
Collaborator
tzolov
left a comment
There was a problem hiding this comment.
@vdm24 , @apappascs , @habuma thank you for the great, joined, effort in designing and implementing this feature
Collaborator
|
Rebased, squashed and merged at c7ffe98 |
vdm24
reviewed
Mar 2, 2026
|
|
||
| /** | ||
| * @author Christian Tzolov | ||
| * @author Alexandros Pappas |
Contributor
There was a problem hiding this comment.
Since here are multiple authors I would suggest to remove them from JavaDoc and keep them in the git log. Here and in 26 other changed files.
Also, it would be nice to write a couple words explaining the class purpose.
Collaborator
There was a problem hiding this comment.
I've updated the javadocs to add the missing hames: #105
| } | ||
|
|
||
| @SuppressWarnings("unchecked") | ||
| private static Map<String, Object> parseMeta(String metaJson) { |
Contributor
There was a problem hiding this comment.
Is this method in use? Also in AsyncStatelessMcpResourceProvider, SyncMcpResourceProvider, SyncStatelessMcpResourceProvider, AbstractMcpToolProvider.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to subscribe to this conversation on GitHub.
Already have an account?
Sign in.
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
This PR combines #102 and #83. Both PRs address the need to specify metadata on resources and tools. The key differences:
Stringof JSON, which is non-ideal.Combining these two PRs (and addressing the conflicts from doing so) results in a "best of both" PR.