MCP-Nest
View on GitHubA NestJS module to effortlessly create Model Context Protocol (MCP) servers for exposing AI tools, resources, and prompts.
NestJS module that turns decorated controllers into Model Context Protocol servers, exposing tools, resources, and prompts over Streamable HTTP or STDIO. It reuses NestJS DI, guards, and pipes, and supports OAuth auth, elicitation, and dynamic capability registration.
Use Cases
Expose existing NestJS services as MCP tools for AI clientsBuild enterprise MCP servers with DI, guards, pipes, and interceptorsServe MCP over Streamable HTTP and STDIO from one codebaseDefine MCP resources and parameterized resource templatesPublish reusable MCP prompt templatesAdd per-tool OAuth/JWT authorization to an MCP serverRegister tools, resources, and prompts dynamically at runtimeImplement interactive tools with elicitation and multi round-trip requestsRun a built-in or external OAuth authorization server for MCPSupport both 2025-era and 2026-07-28 MCP protocol revisions concurrently
Built With
- Language
- TypeScript
- Frameworks
- NestJS · Model Context Protocol SDK · Express · Fastify · Zod · TypeORM · Passport · class-validator · class-transformer · Jest · Bun · ESLint · Prettier
Tags
mcp · mcp-server · nestjs · typescript · model-context-protocol · tools · resources · prompts · dependency-injection · streamable-http · stdio · oauth · authorization · zod-validation · multi-transport · microservice