StaticupgradeUpgrade a running Nest application with a stateless MCP endpoint.
Scans the application container for methods decorated with McpRoute, then registers a catch-all HTTP route at the configured path. Each incoming request builds a fresh MCP server + transport on demand, wires the registered tools into it, and delegates handling.
Must be called after NestFactory.create(...) but before app.listen(...)
if you want the MCP endpoint to be reachable alongside your regular HTTP
routes.
Running Nest application instance.
Transport and identity overrides.
MCP (Model Context Protocol) adaptor.
McpAdaptorexposes every method decorated with McpRoute as an MCP tool, reachable by LLM clients through a stateless Streamable HTTP endpoint.At bootstrap the adaptor walks the NestContainer, collects every controller method carrying
"nestia/McpRoute"metadata, and caches a tool registry. A fresh MCP server and transport pair is spun up per incoming HTTP request, following MCP stateless Streamable HTTP mode. This adaptor intentionally does not manageMcp-Session-Idstate.Typia-generated JSON Schemas flow through unchanged; the Zod-based high-level registration API of
McpServeris bypassed by accessing the low-level.serverhandler.Error mapping follows the MCP specification:
-32601.-32602with structured diagnostics.isError: true, so the LLM can read the message and recover.-32603.Author
wildduck - https://github.com/wildduck2
Example