rekog-labs/MCP-Nest
A NestJS module to effortlessly create Model Context Protocol (MCP) servers for exposing AI tools, resources, and prompts.
What it solves
It simplifies the process of building Model Context Protocol (MCP) servers within the NestJS framework. It allows developers to expose their existing application logic, tools, and data as AI-accessible resources without having to rebuild their backend architecture from scratch.
How it works
The library implements MCP as a NestJS microservice transport strategy. Developers use a specialized @McpController() decorator to define tools, resources, and prompts. These are then served over multiple transport options, such as Streamable HTTP or STDIO. Because it integrates directly into the NestJS ecosystem, it natively supports standard framework features like dependency injection, guards for authentication, pipes for validation, and interceptors.
Who it’s for
Backend developers using NestJS who want to create enterprise-ready MCP servers that can be consumed by AI agents and LLMs.
Highlights
- Dual-Era Protocol Support: Simultaneously serves both the 2025-era and the 2026-07-28 protocol revisions from a single endpoint.
- NestJS Integration: Full leverage of the NestJS dependency injection system and microservice architecture.
- Automatic Tool Discovery: Exposes NestJS methods as MCP tools with automatic discovery and Zod-based validation.
- Flexible Transports: Supports both STDIO and Streamable HTTP for communication.
- Enterprise Security: Includes support for guard-based authentication, OAuth, and integration with external authorization servers like Keycloak or Auth0.
Related
- Project
- Dispatch
- Project
- Project
- Project