Repository navigation
Release 0.0.1
The first release of @nestjs/mcp: Model Context Protocol servers built from Nest providers.
- Primitives: tools, resources, resource templates and prompts are provider methods with a decorator each (
@Tool(),@Resource(),@ResourceTemplate(),@Prompt()), with schemas from Zod, ArkType, Valibot or a JSON Schema. - Enhancers: guards, interceptors, pipes and exception filters run on every call, with the execution context type
'mcp', andMcpExecutionContextreads the call in them. - Streamable HTTP: the endpoint is a route of your application on Express, Fastify or the Node adapter. Each request is served on its own, for clients of the 2026-07-28 and the 2025 protocol revisions.
- stdio:
McpStdioServerserves the same module from a standalone application context. - Authorization: the HTTP endpoint can be an OAuth 2.1 resource server, with a token verifier of your own, protected resource metadata (RFC 9728) and scopes per tool, resource or prompt.
- Testing:
@nestjs/mcp/testingconnects an MCP client to the application in memory. - Auth packages: with
@nestjs/authentication0.1.3 and@nestjs/authorization0.1.1 or later, their global guard,@CurrentUser()and@Can()policies work on tool calls.