-
Notifications
You must be signed in to change notification settings - Fork 0
Description
✨ Feature Request
Prerequisites
- I have searched the existing issues to make sure this feature hasn't been requested already
- I have verified this is a feature request and not a question (for questions, use GitHub Discussions instead)
Package Version
0.2.0
NestJS Version
N/A
Problem Statement
The MCP protocol and the official TypeScript SDK (release 1.11.0, PR #309) now support Tool Annotations for describing tool behavior (e.g., read-only, destructive, etc.) as per protocol version 2025-03-26.
Currently, the NestJS MCP server does not expose a way to define or return tool annotations in its tool registration or discovery APIs, which limits compatibility and expressiveness for clients and tool consumers.
Proposed Solution
- Add support for Tool Annotations in the NestJS MCP server, following the MCP spec and the implementation in the official TypeScript SDK.
- Allow tool registration to accept annotation metadata (e.g., readOnly, destructive, etc.).
- Ensure that the ListTools handler and tool discovery endpoints return the annotation data as part of the tool metadata.
- Update documentation for the new annotation functionality.
Feature Type
- Enhancement to existing functionality
- Integration with other tools/libraries
Impact Level
High (would significantly improve my workflow)
Usage Example
// Example: Registering a tool with annotations
mcpServer.tool('deleteUser', {
description: 'Deletes a user by ID',
params: { userId: 'string' },
annotations: { destructive: true }
});
When listing tools, the annotation should be present in the response:
{
"name": "deleteUser",
"description": "Deletes a user by ID",
"params": { "userId": "string" },
"annotations": { "destructive": true }
}
Alternatives Considered
- Continue without annotation support (limits protocol compatibility and client expressiveness)
- Custom metadata outside the MCP spec (not interoperable)
Contribution
- I'm willing to submit a PR with this feature
- I'd like guidance/mentoring to implement this feature
Additional Context
-
See typescript-sdk release 1.11.0 and PR #309 for reference implementation and spec details.
-
This feature will improve protocol compliance and enable richer tool discovery for clients.
-
I agree to follow this project's Code of Conduct