Practical overview
When it fits
Use MCP Nest when an existing or planned NestJS backend needs to provide application operations, data or prompt templates to MCP clients. It is particularly relevant when developers want to reuse dependency-injected services and NestJS request-processing features in MCP handlers.
Who it is for
- TypeScript developers building NestJS applications.
- Teams connecting existing NestJS services or data to MCP-compatible AI clients.
- Developers who want MCP handlers to use NestJS guards, pipes, interceptors and exception filters.
Documented uses
- Expose selected NestJS methods as MCP tools with discovered handlers and Zod parameter validation.
- Serve application content and data as MCP resources, including parameterized resource templates.
- Define reusable prompts for AI interactions within a NestJS application.
- Connect dependency-injected application services to MCP handlers.
- Choose Streamable HTTP or STDIO as the server transport.
Requirements & limits
The repository is public and identifies the project as MIT-licensed. The documented installation uses npm.
- Requires a NestJS application and TypeScript development; it is a library, not a hosted server or an end-user AI app.
- The README documents Streamable HTTP and STDIO transports, so transport choice depends on the intended MCP client setup.
- Tool parameters can use Zod validation, and handlers can use NestJS guards, pipes, interceptors and exception filters.
- The built-in authorization server is supplied as a separate package and is labeled beta.
- The README lists additional optional TypeORM dependencies when using the authorization server's TypeORM store.
Check current requirements in the official documentation. Source-based guidance does not mean OpenViST has run or independently tested this project.
Set up a NestJS MCP server with a greeting tool over Streamable HTTP
Install MCP-Nest, define a greeting tool, configure the HTTP transport, and start the NestJS microservice.
Before you start
- A NestJS application.
- The packages @rekog/mcp-nest, @modelcontextprotocol/server, @modelcontextprotocol/core, @modelcontextprotocol/node, and zod@^4.
Steps
Install the listed packages with npm.
Create an @McpController() class with a @Tool() method; define its parameters with a Zod schema and return MCP content from the handler.
Create an McpStrategy configured with a StreamableHttpTransport and register the controller in the NestJS module.
In the bootstrap function, create the Nest application, set the strategy's HTTP adapter, connect the microservice, call startAllMicroservices(), and then call listen().
Expected outcome
A NestJS application starts its MCP transport with the documented greeting tool and mounts the MCP HTTP routes before accepting connections.
Guide limitations
- The documented bootstrap order is required: startAllMicroservices() must run before listen() so MCP HTTP routes are mounted first.
- This recipe documents setup and server startup, not a client connection or successful tool invocation.
Sources & review
Source record details
- Source availability
- Active
- Sources checked
- 13 October 2026
- Original website title
- rekog-labs/MCP-Nest · Official homepage title · retained in its source language

