NestJS MCP Server Module is an MCP server that provides a framework integration module for building Model Context Protocol services directly within NestJS applications. Built for TypeScript and backend developers using NestJS, it connects internal business logic, databases, and microservices to AI clients by exposing tools, prompts, and resources. Developers can define tools using familiar decorators like @Tool and validate inputs via Zod schemas, while taking advantage of NestJS's dependency injection container. The module supports multiple transport layers, including Streamable HTTP, HTTP with Server-Sent Events (SSE), and STDIO. It also provides progress notifications during long operations, direct access to underlying Express request objects inside tools for contextual metadata, and endpoint security handled via native NestJS guards. This allows engineering teams to convert existing enterprise services into MCP-compliant interfaces without re-architecting their software infrastructure.
Category: AI & LLM Tooling
Tags: backend, framework, nestjs, typescript
Visit NestJS MCP Server Module
bash npm install @rekog/mcp-nest @modelcontextprotocol/sdk zod 2. Import McpModule into your root application module: typescript import { Module } from '@nestjs/common'; import { McpModule, McpTransportType } from '@rekog/mcp-nest'; @Module({ imports: [ McpModule.forRoot({ name: 'my-mcp-server', version: '1.0.0', transport: McpTransportType.STDIO, }), ], }) export class AppModule {} 3. Build your project using your standard NestJS build scripts. 4. Register the compiled application with an MCP client such as Claude Desktop by adding it to your configuration file: json { "mcpServers": { "greeting": { "command": "node", "args": ["<path to dist js file>"] } } }Part of MCP Servers
NestJS MCP Server Module is an open-source library that allows developers to build Model Context Protocol servers within NestJS applications. It exposes tools, resources, and prompts to AI agents using standard NestJS decorators and dependency injection.
You can install it using npm by running npm install @rekog/mcp-nest @modelcontextprotocol/sdk zod. After installing, import McpModule.forRoot into your root module and register your tool classes as providers.
The module supports three transport protocols: STDIO for local command-line operations, HTTP with Server-Sent Events (SSE), and Streamable HTTP, which supports both stateless execution and stateful session management.
Authentication is handled through native NestJS Guards. You can pass any standard CanActivate guard into the guards array option in McpModule.forRoot, which will protect endpoints like /sse and /messages.
Yes, NestJS MCP Server Module is an open-source project hosted on GitHub under the repository kyee-rs/MCP-Nest and published to npm under the package name @rekog/mcp-nest.