NestJS MCP Server Module
A NestJS module to effortlessly expose tools, resources, and prompts for AI, from your NestJS applications using the Model Context Protocol (MCP).
With @rekog/mcp-nest
you define tools, resources, and prompts in a way that's familiar in NestJS and leverage the full power of dependency injection to utilize your existing codebase in building complex enterprise ready MCP servers.
Features
- 🚀 Multi-Transport Support: HTTP+SSE, Streamable HTTP, and STDIO
- 🔧 Tools: Expose NestJS methods as MCP tools with automatic discovery and Zod validation
- 🛠️ Elicitation: Interactive tool calls with user input elicitation
- 📊 Progress Notifications: Real-time progress updates for long-running operations
- 🌐 HTTP Request Access: Full access to request context within MCP handlers
- 📁 Resources: Serve content and data through MCP resource system
- 📚 Resource Templates: Dynamic resources with parameterized URIs
- 💬 Prompts: Define reusable prompt templates for AI interactions
- 🔐 Guard-based Authentication: Guard-based security with OAuth support
- 🏠 Built-in Authorization Server — Using the built-in Authorization Server for easy setups. (Beta)
- 🌐 External Authorization Server — Securing your MCP server with an external authorization server (Keycloak, Auth0, etc).
- 💉 Dependency Injection: Leverage NestJS DI system throughout MCP components
Installation
Quick Start
Documentation
- Tools Guide - Define and expose NestJS methods as MCP tools
- Resources Guide - Serve static and dynamic content
- Resource Templates Guide - Create parameterized resources
- Prompts Guide - Build reusable prompt templates
- Built-in Authorization Server - Secure your MCP server with built-in OAuth
- External Authorization Server - Securing your MCP server with an external authorization server (Keycloak, Auth0, etc)
- Server examples - MCP servers examples (Streamable HTTP, HTTP, and STDIO) and with Fastify support
Playground
The playground
directory contains working examples for all features.
Refer to playground/README.md
for details.
This server cannot be installed
remote-capable server
The server can be hosted and run remotely because it primarily relies on remote services or has no dependency on the local environment.
Server-Sent Events トランスポートを備えた MCP サーバーとしてサービスを公開し、クライアントによるツールの検出と実行を容易にする NestJS モジュール。
Related Resources
Related MCP Servers
- -securityAlicense-qualityA demonstration server that implements the Model Context Protocol (MCP) SDK, providing tools and endpoints for server-sent events and message handling.Last updated -1910MIT License
- -securityFlicense-qualityA server for Model Context Protocol (MCP) that uses Server-Sent Events (SSE) for streaming communication, enabling tools like the HackerNews API to be accessed through a secure HTTP+SSE transport.Last updated -23
- -securityAlicense-qualityA TypeScript framework for building MCP servers with features for client sessions, authentication, image/audio content, and typed server events.Last updated -MIT License
- -securityFlicense-qualityAn MCP server that enables interaction with Nexmo's Messages API, allowing agents to send and manage messages across various channels via natural language commands.Last updated -