Skip to content

Conversation

@vdm24
Copy link

@vdm24 vdm24 commented Nov 7, 2025

Append the ability to define "_meta" property in tool, prompt, resource declarations

Usage:

@McpTool(metaProvider = MyMetaProvider.class)
String myTool() {
}

class MyMetaProvider implements MetaProvider {

    @Override
    public Map<String, Object> getMeta() {
        return Map.of(
            "openai/widgetPrefersBorder", true,
            "openai/widgetDomain", "https://chatgpt.com",
            "openai/widgetCSP", new WidgetCsp());
    }
}

Issue: #81

@vdm24 vdm24 force-pushed the main branch 2 times, most recently from 18f07b9 to 1ae76f8 Compare November 7, 2025 15:59
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>
@vdm24
Copy link
Author

vdm24 commented Nov 13, 2025

Hi @tzolov
what do you think about this concept? Is it okay in general? If you have a better idea, I can try to implement it.

@vdm24
Copy link
Author

vdm24 commented Nov 25, 2025

Hi everyone,

is this "community" project alive?

It has been nearly three weeks since the PR was opened, but there hasn’t been any reaction from maintainers - no comments, no reviews, no even an emoji. This lack of activity seems weird for a Spring project...

@valery1707
Copy link

It has been nearly three weeks since the PR was opened, but there hasn’t been any reaction from maintainers - no comments, no reviews, no even an emoji. This lack of activity seems weird for a Spring project...

I have PR spring-projects/spring-ai#3666 with almost half year of inactivity ... but with some reaction, but only after about 3 months ...

@embesozzi
Copy link

In version 1.1.2, it supports defining at least some annotations.

   annotations = @McpTool.McpAnnotations(
                    title = "",
                    readOnlyHint = true,
                    destructiveHint = false,
                    idempotentHint = true
            )

@scottslewis
Copy link

scottslewis commented Dec 18, 2025

For all information:

There are active discussions around moving the MCP - specified annotation types in this package to the mcp-java-sdk

modelcontextprotocol/java-sdk#491

and

#10

this would likely mean a new package in the mcp-java-sdk package namespace (e.g.io.modelcontextprotocol.annotation or io.modelcontextprotocol.spec.annotation, etc).

A main reason for such a move of annotation classes from mcp-annotation to mcp-java-sdk is that the annotations are completely specified by the MCP protocol spec...which defines the specific meta-data that the tooling can provide...e.g. @mcptool fields correspond to the specification schema of Tool properties....i.e. description, title, name, annotation

If there is consensus in this and the mcp-java-sdk projects around a move/refactor of annotation classes from mcp-annotations to new io.modelcontextprotocol.annotation package, I will produce a pull request to the mcp-java-sdk project that adds all the annotation types currently defined in mcp-annotations.

If there is consensus around the solution provided above (MetaProvider) it could be added as part of this refactor.

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.

4 participants