Nestjs MCP Server
MCP server by adrian-d-hidalgo Verified · npm:@nestjs-mcp
NestJS MCP Server provides decorators and NestJS modules for building MCP servers. It wraps the official MCP TypeScript SDK and is aimed at developers using NestJS.
Install Nestjs MCP Server
Built from the published package, never by AI.
claude mcp add nestjs-mcp-server -- npx -y @nestjs-mcp/serverRun in your terminal. Add --scope user to use it in every project.
{
"mcpServers": {
"nestjs-mcp-server": {
"args": [
"-y",
"@nestjs-mcp/server"
],
"command": "npx"
}
}
}Settings, Developer, Edit config. Paste into claude_desktop_config.json and restart.
{
"mcpServers": {
"nestjs-mcp-server": {
"args": [
"-y",
"@nestjs-mcp/server"
],
"command": "npx"
}
}
}Add to ~/.cursor/mcp.json (all projects) or .cursor/mcp.json (this project).
{
"servers": {
"nestjs-mcp-server": {
"args": [
"-y",
"@nestjs-mcp/server"
],
"command": "npx"
}
}
}Add to .vscode/mcp.json. VS Code uses "servers", not "mcpServers".
codex mcp add nestjs-mcp-server -- npx -y @nestjs-mcp/server{
"mcpServers": {
"nestjs-mcp-server": {
"args": [
"-y",
"@nestjs-mcp/server"
],
"command": "npx"
}
}
}Add to ~/.gemini/config/mcp_config.json (all projects) or .agents/mcp_config.json (this project).
gemini mcp add nestjs-mcp-server npx -y @nestjs-mcp/serverGemini CLI was replaced by Antigravity CLI in June 2026 and remains only for enterprise licences and paid API keys.
MCP servers run with your permissions and can read what you give them access to. Some need an API key: check the README and add it under env in the nestjs-mcp-server block.
About
NestJS MCP Server is a modular library for building Model Context Protocol (MCP) servers with NestJS. It provides decorators, modules, and integration patterns to expose MCP resources, tools, and prompts. The project is a wrapper for the official @modelcontextprotocol/sdk and is described as kept compatible with its types and specification.
Developers register the library with McpModule.forRoot or McpModule.forRootAsync, then mark resolver classes with decorators such as Resource, Tool, and Prompt. Larger servers can split capabilities across feature modules using McpModule.forFeature. The README also covers guards, dynamic capabilities, authentication and authorization, and transport options. It suits NestJS developers who want to build MCP servers in a structured way.
Written from the project's README and checked against it.
Tools it gives your assistant
Resolver decoratorMarks a class as a resolver that holds MCP capabilities.Tool decoratorExposes methods as MCP tools, with ToolOptions and tool annotations.Resource decoratorExposes structured data identified by a URI as MCP resources.Prompt decoratorDefines conversational flows or templates as MCP prompts.GuardsAdds global, resolver-level, or method-level guards to MCP capabilities.Authentication and authorizationConfigures auth with strategies, OAuth discovery, and per-capability scopes.
What you need
- NestJS
- npm, yarn, or pnpm
- @modelcontextprotocol/sdk package
- zod package
Try asking
- Add a health check tool to my NestJS MCP server using the Tool decorator
- Split my MCP server into feature modules with McpModule.forFeature
- Show me how to configure my MCP server with McpModule.forRootAsync and ConfigService
Good to know
- McpModule.forFeature options are currently unused and reserved for future enhancements.
Security check
ANo download-and-run commands, hidden instructions or signs of sending keys out were found.
Checked automatically: README.md, package.json. This looks for known risky patterns and is not a full audit. How grades work
Alternatives to Nestjs MCP Server
All alternatives →Turns GitHub repositories into architecture diagrams, written explanations, Mermaid source and narrated explainer videos. Built for developers who want to understand a codebase, and for AI agents that need to read one.
Mocks, records, and chaos-tests HTTP(S) dependencies for development and testing. One port serves many protocols, including gRPC, WebSockets, and LLM chat APIs. Built for developers and testers who need stand-in services during tests.
Provides MCP server and CLI tools that let AI coding agents build, test and manage iOS and macOS projects with Xcode and simulators. It is aimed at developers working on Apple platform apps.
Creates editable draw.io diagrams in AI chat from Mermaid, PlantUML, CSV or draw.io XML. Built for people who want diagrams from text prompts that stay editable in draw.io.
Indexes your code, git history, tests and decisions on your machine so AI coding agents can query the index instead of re-reading files. Built for developers who want fewer files opened and clearer answers about change risk and code health.
Gives your AI assistant hosted codebase intelligence for repos indexed on repowise.dev. Use it to ask how code works, what a change may break, and which tests to run.
Compare with GitDiagram, mockserver or XcodeBuildMCP
Nestjs MCP Server: common questions
What does NestJS MCP Server wrap?
It is a wrapper for the official @modelcontextprotocol/sdk, and the project says it is kept compatible with its types and specification.
How do I configure the server with environment variables?
The README shows McpModule.forRootAsync with a useFactory that reads values from ConfigService, such as the server name and log level.
Can I organize a large MCP server into several modules?
Yes. Resolvers can be registered in feature modules that import McpModule.forFeature, which the README recommends for large servers.
How do I install Nestjs MCP Server?
In Claude Code run claude mcp add nestjs-mcp-server -- npx -y @nestjs-mcp/server. For Claude Desktop, Cursor and VS Code, paste the config shown above and restart. See the install guides.
Is Nestjs MCP Server the official server?
Nestjs MCP Server is published by npm:@nestjs-mcp from its verified domain in the official MCP Registry.
Is Nestjs MCP Server free?
The code is published under the MIT licence. The service it connects to may have its own pricing.
Is Nestjs MCP Server safe to use?
It scores 83 of 100. Grades: maintenance B, licence A, quality C. Security check: grade A, no risky patterns found in the files checked. Review the code before you install. How grades work.
What are alternatives to Nestjs MCP Server?
Similar MCP servers: GitDiagram, mockserver, XcodeBuildMCP, draw.io.
Does Nestjs MCP Server work with ChatGPT?
Not directly. It runs locally, and ChatGPT only connects to remote servers with a URL. Use it in Claude Code, Claude Desktop, Cursor, VS Code or Codex.
