Skip to content
This repository was archived by the owner on Apr 11, 2026. It is now read-only.

Combine PRs #102 and #83#104

Closed
habuma wants to merge 3 commits intomainfrom
habuma-metadata
Closed

Combine PRs #102 and #83#104
habuma wants to merge 3 commits intomainfrom
habuma-metadata

Conversation

@habuma
Copy link
Copy Markdown
Collaborator

@habuma habuma commented Feb 28, 2026

This PR combines #102 and #83. Both PRs address the need to specify metadata on resources and tools. The key differences:

Combining these two PRs (and addressing the conflicts from doing so) results in a "best of both" PR.

apappascs and others added 3 commits February 16, 2026 15:24
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>
Copy link
Copy Markdown
Collaborator

@tzolov tzolov left a comment

Choose a reason for hiding this comment

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

@vdm24 , @apappascs , @habuma thank you for the great, joined, effort in designing and implementing this feature

@tzolov
Copy link
Copy Markdown
Collaborator

tzolov commented Mar 2, 2026

Rebased, squashed and merged at c7ffe98

@tzolov tzolov closed this Mar 2, 2026

/**
* @author Christian Tzolov
* @author Alexandros Pappas
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

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.

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

I've updated the javadocs to add the missing hames: #105

}

@SuppressWarnings("unchecked")
private static Map<String, Object> parseMeta(String metaJson) {
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Is this method in use? Also in AsyncStatelessMcpResourceProvider, SyncMcpResourceProvider, SyncStatelessMcpResourceProvider, AbstractMcpToolProvider.

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

it doesn't and was removed in #105

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants