N
nestjs/mcp
An MCP module for NestJS (Node.js) 🤖
在 GitHub 查看 ↗链接已于 2026-11-12 核查 · HTTP 200 · 打开的是厂商自己的官网
安装与配置
客户端配置(取自该仓库的安装命令)
{
"mcpServers": {
"nestjs-mcp": {
"command": "npx",
"args": ["tsc"]
}
}
}解析自我们于 2026-11-04 抓取的该仓库 README;我们未执行过。
command/args 来自仓库写明的安装命令;不确定时请以该项目 README 为准。
VS Code(.vscode/mcp.json —— 键名是 servers)
{
"servers": {
"nestjs-mcp": {
"command": "npx",
"args": ["tsc"]
}
}
}VS Code 顶层键是 <code>servers</code>,其余与上面那份相同。
Claude Code(命令行)
claude mcp add --transport stdio nestjs-mcp -- npx tsc
Claude Code 不收 JSON 文件,用这条命令直接加。
配置项的键名以你的客户端为准:客户端与 CLI
- ★ 数取值
- 13 ★ · nestjs/mcp · 取自 GitHub 搜索 API · (2026-11-13 20:00:50 核对)
- 来源明细
- 从该仓库的 GitHub 页面直接读取 · 条目类型:开源项目
- 收录与活跃
- 收录于 2026-11-05 · 最近见到 2026-11-14 · 共见到 10 次 · 被 1 个来源列出
- 评分构成
- 综合分 103 · 13 ★ · 1 个来源 · repo
- 安装
npx tsc
常见问题(答案都来自我们的记录)
怎么安装?
该仓库给出的安装命令是
npx tsc。我们的记录里它是仓库自己提供的;不保证在你的客户端上直接可用。它适合谁 / 用来做什么?
我们把它归在这些标签下: MCP 服务。标签来自条目自身,不是我们强加的分类。
谁维护它、还在更新吗?
仓库
nestjs/mcp;我们收录于 2026-11-05;最近见到 2026-11-14。这里没有"官方认证"或"质量评级"——我们只记录来源与时间。[travis-image]: https://api.travis-ci.org/nestjs/nest.svg?branch=master
以下摘录自该仓库的 README(片段) · 在 GitHub 读完整 README →
[travis-url]: https://travis-ci.org/nestjs/nest
[linux-image]: https://img.shields.io/travis/nestjs/nest/master.svg?label=linux
[linux-url]: https://travis-ci.org/nestjs/nest
A progressive Node.js framework for building efficient and scalable server-side applications.
## Description
Model Context Protocol module for Nest: tools, resources and prompts are methods of your providers, declared with decorators and a schema (Zod, ArkType, Valibot or JSON Schema), and run through Nest's guards, interceptors, pipes and exception filters. The server is served over Streamable HTTP from your existing Nest application (Express, Fastify or the Node adapter), statelessly so it scales behind any load balancer, to clients of both the 2026-07-28 and the 2025 protocol revisions, and over stdio from a standalone application context. It can act as an OAuth 2.1 resource server with protected resource metadata, WWW-Authenticate challenges, per-tool scopes and a token verifier of your own, and comes with an in-memory test client. Built on the official MCP TypeScript SDK (@modelcontextprotocol/server).
## Installation
bash
$ npm i --save @nestjs/mcp @modelcontextprotocol/server zod
Zod 4.2 or later; any other Standard Schema library that produces JSON Schema works too.
## Quick Start
Import the module, and decorate the methods of a provider:
ts
import { Injectable, Module } from '@nestjs/common';
import { McpModule, Resource, Tool, type McpContext } from '@nestjs/mcp';
import as z from 'zod';
@Injectable()
export class NotesTools {
constructor(private readonly notes: NotesService) {}
@Tool({
description: 'Save a note',
inputSchema: z.object({ text: z.string().describe('What to remember') }),
})
add({ text }: { text: string }, ctx: McpContext) {
return this.notes.add(text, ctx.authInfo?.clientId);
@Resource({ uri: 'notes://all', mimeType: 'application/json' })
all() {
return this.notes.all();
@Module({
imports: [McpModule.forRoot({ name: 'notes', version: '1.0.0' })],
providers: [NotesService, NotesTools],
})
export class AppModule {}
app.listen(3000) now serves the MCP endpoint at http://localhost:3000/mcp, a route like any other (the global prefix and middleware apply to it). Guards, interceptors, pipes and filters run around every call; McpExecutionContext.create(context) reads the call in them, as GqlExecutionContext does for GraphQL.
The sample is a notes server with a guard and an interceptor, served over HTTP and stdio: npm run build && npx tsc -p sample/tsconfig.json, then node sample/dist/main.js (HTTP) or node sample/dist/stdio.js (stdio).
[linux-image]: https://img.shields.io/travis/nestjs/nest/master.svg?label=linux
[linux-url]: https://travis-ci.org/nestjs/nest
A progressive Node.js framework for building efficient and scalable server-side applications.
## Description
Model Context Protocol module for Nest: tools, resources and prompts are methods of your providers, declared with decorators and a schema (Zod, ArkType, Valibot or JSON Schema), and run through Nest's guards, interceptors, pipes and exception filters. The server is served over Streamable HTTP from your existing Nest application (Express, Fastify or the Node adapter), statelessly so it scales behind any load balancer, to clients of both the 2026-07-28 and the 2025 protocol revisions, and over stdio from a standalone application context. It can act as an OAuth 2.1 resource server with protected resource metadata, WWW-Authenticate challenges, per-tool scopes and a token verifier of your own, and comes with an in-memory test client. Built on the official MCP TypeScript SDK (@modelcontextprotocol/server).
## Installation
bash
$ npm i --save @nestjs/mcp @modelcontextprotocol/server zod
Zod 4.2 or later; any other Standard Schema library that produces JSON Schema works too.
## Quick Start
Import the module, and decorate the methods of a provider:
ts
import { Injectable, Module } from '@nestjs/common';
import { McpModule, Resource, Tool, type McpContext } from '@nestjs/mcp';
import as z from 'zod';
@Injectable()
export class NotesTools {
constructor(private readonly notes: NotesService) {}
@Tool({
description: 'Save a note',
inputSchema: z.object({ text: z.string().describe('What to remember') }),
})
add({ text }: { text: string }, ctx: McpContext) {
return this.notes.add(text, ctx.authInfo?.clientId);
@Resource({ uri: 'notes://all', mimeType: 'application/json' })
all() {
return this.notes.all();
@Module({
imports: [McpModule.forRoot({ name: 'notes', version: '1.0.0' })],
providers: [NotesService, NotesTools],
})
export class AppModule {}
app.listen(3000) now serves the MCP endpoint at http://localhost:3000/mcp, a route like any other (the global prefix and middleware apply to it). Guards, interceptors, pipes and filters run around every call; McpExecutionContext.create(context) reads the call in them, as GqlExecutionContext does for GraphQL.
The sample is a notes server with a guard and an interceptor, served over HTTP and stdio: npm run build && npx tsc -p sample/tsconfig.json, then node sample/dist/main.js (HTTP) or node sample/dist/stdio.js (stdio).
收录徽章(可选)
想把收录标记放进 README 就复制这行,可选,不影响收录。
[](https://anclum.com/zh/s/nestjs-mcp/)
- 来源
- github · https://github.com/nestjs/mcp
- 按领域浏览
- MCP 服务
- Traction
- 13 ★
- 收录于
- 今天
同类推荐
所属领域与标签
每个标签都能点进去看同类的全部条目。数字是当前库里的真实条数。