Is your feature request related to a problem? Please describe.
The current MCP Tool model in Nacos does not fully comply with the MCP protocol specification. According to the MCP protocol, Tool objects should support two additional fields:
_meta: A generic metadata object for storing arbitrary key-value pairs
annotations: Additional properties describing a Tool to clients (ToolAnnotations)
Without these fields, Nacos cannot store and manage the complete MCP Tool specification, which limits interoperability with MCP-compliant clients and servers.
Describe the solution you'd like
Add support for _meta and annotations fields in the MCP Tool model:
-
Backend Changes:
- Add
_meta field to McpTool.java with proper JSON serialization using @JsonProperty("_meta")
- Create
McpToolAnnotations.java class with the following fields as defined in MCP protocol:
title (String): A human-readable title for the tool
readOnlyHint (Boolean): If true, the tool does not modify its environment
destructiveHint (Boolean): If true, the tool may perform destructive updates
idempotentHint (Boolean): If true, repeated calls have no additional effect
openWorldHint (Boolean): If true, the tool may interact with external entities
- Add
annotations field to McpTool.java
-
Frontend Changes:
- Add "Meta" tab in CreateTools dialog with JSON editor for
_meta field
- Add "Annotations" tab in CreateTools dialog with form controls for annotation fields
- Display
_meta and annotations in ShowTools component
Describe alternatives you've considered
-
Store as generic Map<String, Object>: We could store both fields as generic maps, but this would lose type safety for annotations and make frontend form binding more complex.
-
Only support _meta field: We could implement only the _meta field as it's more flexible, but this would still leave Nacos non-compliant with the full MCP Tool specification.
Additional context
MCP Protocol Tool Definition Reference:
{
"name": "tool_name",
"description": "Tool description",
"inputSchema": {...},
"_meta": {
"additionalProperties": {},
"type": "object"
},
"annotations": {
"title": "Human readable title",
"readOnlyHint": false,
"destructiveHint": true,
"idempotentHint": false,
"openWorldHint": true
}
}
Note: All properties in annotations are hints and are not guaranteed to provide a faithful description of tool behavior. Clients should never make tool use decisions based on annotations received from untrusted servers.
Is your feature request related to a problem? Please describe.
The current MCP Tool model in Nacos does not fully comply with the MCP protocol specification. According to the MCP protocol, Tool objects should support two additional fields:
_meta: A generic metadata object for storing arbitrary key-value pairsannotations: Additional properties describing a Tool to clients (ToolAnnotations)Without these fields, Nacos cannot store and manage the complete MCP Tool specification, which limits interoperability with MCP-compliant clients and servers.
Describe the solution you'd like
Add support for
_metaandannotationsfields in the MCP Tool model:Backend Changes:
_metafield toMcpTool.javawith proper JSON serialization using@JsonProperty("_meta")McpToolAnnotations.javaclass with the following fields as defined in MCP protocol:title(String): A human-readable title for the toolreadOnlyHint(Boolean): If true, the tool does not modify its environmentdestructiveHint(Boolean): If true, the tool may perform destructive updatesidempotentHint(Boolean): If true, repeated calls have no additional effectopenWorldHint(Boolean): If true, the tool may interact with external entitiesannotationsfield toMcpTool.javaFrontend Changes:
_metafield_metaandannotationsin ShowTools componentDescribe alternatives you've considered
Store as generic Map<String, Object>: We could store both fields as generic maps, but this would lose type safety for annotations and make frontend form binding more complex.
Only support _meta field: We could implement only the
_metafield as it's more flexible, but this would still leave Nacos non-compliant with the full MCP Tool specification.Additional context
MCP Protocol Tool Definition Reference:
{ "name": "tool_name", "description": "Tool description", "inputSchema": {...}, "_meta": { "additionalProperties": {}, "type": "object" }, "annotations": { "title": "Human readable title", "readOnlyHint": false, "destructiveHint": true, "idempotentHint": false, "openWorldHint": true } }Note: All properties in
annotationsare hints and are not guaranteed to provide a faithful description of tool behavior. Clients should never make tool use decisions based on annotations received from untrusted servers.