NestJS MCP Module
@bamada
NestJS MCP Module について
NestJS module for seamless Model Context Protocol (MCP) server integration using decorators.
基本情報
設定
ツール
ツールは検出されませんでした
ツールは README から自動的に抽出されます。メンテナーは ## Tools という見出しの下に記載することで、このタブに反映できます。
概要
What is NestJS MCP Module?
A NestJS module that simplifies building Model Context Protocol (MCP) servers. It exposes resources, tools, and prompts using familiar NestJS decorators and supports STDIO and HTTP/SSE transport.
How to use NestJS MCP Module?
Install the package and its peer dependencies, then import McpModule into your root module via forRoot or forRootAsync. Define MCP capabilities by decorating provider methods with @McpResource, @McpTool, or @McpPrompt. Configure the transport type (STDIO or SSE) and run your application. For STDIO, replace the NestJS logger with the included StderrLogger.
Key features of NestJS MCP Module
- Seamless MCP integration using NestJS method decorators.
- Automatic discovery of decorated providers.
- Supports STDIO and HTTP/SSE transport.
- Uses Zod schemas for tool and prompt argument validation.
- Configurable via
forRootandforRootAsyncpatterns. - Includes
StderrLoggerfor STDIO transport compatibility.
Use cases of NestJS MCP Module
- Building CLI-based MCP servers using STDIO transport.
- Exposing MCP endpoints over HTTP/SSE for web clients.
- Defining typed MCP tools with parameter validation.
- Providing static and template MCP resources.
- Creating MCP prompt templates for LLM interactions.
FAQ from NestJS MCP Module
What peer dependencies are required?
@modelcontextprotocol/sdk (^1.10.2), @nestjs/platform-express (^10 or ^11), and zod (^3.0.0) must be installed.
How do I configure the transport type?
Pass transport in McpModule.forRoot(options). Choose TransportType.STDIO, TransportType.SSE, or TransportType.NONE.
How do I handle logging for STDIO transport?
Replace the NestJS logger with the StderrLogger class provided by the module to prevent logs from interfering with STDIO MCP communication.
What endpoints are exposed for HTTP/SSE transport?
The McpHttpController exposes /api/mcp/sse for SSE connections and /api/mcp/messages for message exchange.
What decorators are available for defining MCP capabilities?
@McpResource, @McpTool, and @McpPrompt for resources, tools, and prompts respectively.
「その他」の他のコンテンツ
Inbox Zero AI
elie222The world's best AI personal assistant for email. Open source app to help you reach inbox zero fast.
ICSS
chokcoco不止于 CSS
Unity MCP ✨
justinpbarnettUnity MCP acts as a bridge between AI assistants and your Unity Editor. Give your LLM tools to manage assets, control scenes, edit scripts, and automate tasks within Unity.
Production-ready MCP integrations for AI applications
Klavis-AIKlavis AI: MCP integration platforms that let AI agents use tools reliably at any scale

Sequential Thinking
modelcontextprotocolModel Context Protocol Servers
コメント