MCP.so
登录

NestJS MCP Server Module

@rahosung

基本信息

分类

其他

许可证

MIT license

传输方式

stdio

作者

rahosung

关于 NestJS MCP Server Module

暂无概览

NestJS MCP Server Module 配置

暂无标准配置

该服务器的 README 中没有可解析的 MCP 配置块,请前往代码仓库查看安装说明。

代码仓库

NestJS MCP Server Module 工具

工具列表暂未提供

当前收录暂时没有可展示的工具列表,不代表服务没有工具。请查阅项目文档了解支持的能力。

工具是从 README 中自动提取的。维护者可以在 ## Tools 标题下列出工具,即可填充这部分内容。

概览

What is NestJS MCP Server Module?

It is a NestJS module that simplifies building an MCP (Model Context Protocol) server with Server-Sent Events (SSE) transport. It automatically discovers and registers tools and resources defined with decorators, and integrates Zod-based request validation, progress notifications, and NestJS guard authentication.

How to use NestJS MCP Server Module?

Install the package and its peer dependencies (npm install @rekog/mcp-nest @modelcontextprotocol/sdk zod), then import McpModule.forRoot in your root module with a server name and version. Decorate service methods with @Tool and @Resource to register tools and resources. Optionally apply NestJS guards for endpoint authentication.

Key features of NestJS MCP Server Module

  • SSE transport for streaming tool execution and resource access
  • Automatic tool and resource discovery via decorators
  • Zod-based request validation for tool parameters
  • Progress notifications during long-running operations
  • Guard-based authentication on /sse and /messages endpoints

Use cases of NestJS MCP Server Module

  • Building a secure MCP server within an existing NestJS application
  • Streaming tool calls with real‑time progress updates to AI clients
  • Exposing dynamic resources via URI templates with guard‑protected access
  • Using MCP tool and resource discovery without manual route registration

常见问题

1

What is the difference between using this module and the raw MCP SDK?

This module provides NestJS‑native decorators (`@Tool`, `@Resource`), automatic discovery, and guard integration, so you don’t have to manually wire tool/resource handlers or handle SSE connections.

2

What are the runtime dependencies?

Node.js, NestJS (any version supporting dynamic modules), `@modelcontextprotocol/sdk`, and `zod`. The module itself is `@rekog/mcp-nest`.

3

Which transport does the server use?

Server-Sent Events (SSE) on the GET `/sse` endpoint, with POST `/messages` for receiving client responses.

4

How can I secure the MCP endpoints?

Pass standard NestJS guards to `McpModule.forRoot` in the `guards` array. Those guards are applied to both the SSE and messages endpoints. You can also exclude `/sse` and `/messages` from a global prefix using `{ exclude: ['sse', 'messages'] }`.

5

Does the module support resource templates?

Yes. Use the `@Resource` decorator with a URI template (e.g., `mcp://hello-world/{userName}`) – the module captures the dynamic parameters and passes them to the handler.

评论

其他 分类下的更多 MCP 服务器