Labsco
pirumar logo

NestJsMcp

โ˜… 4

from pirumar

NestJS MCP Server is a powerful Model Context Protocol server that provides 40+ specialized tools for NestJS development. It integrates seamlessly with AI assistants like Claude Desktop, Cursor, Claude Code CLI, and any MCP-compatible client.

๐Ÿ”ฅ๐Ÿ”ฅ๐Ÿ”ฅโœ“ VerifiedFreeAdvanced setup

NestJS MCP Server

A comprehensive Model Context Protocol (MCP) server for NestJS development

Supercharge your NestJS development with AI-powered assistance

Features โ€ข Installation โ€ข Configuration โ€ข Tools โ€ข Usage โ€ข Contributing


Overview

NestJS MCP Server is a powerful Model Context Protocol server that provides 40+ specialized tools for NestJS development. It integrates seamlessly with AI assistants like Claude Desktop, Cursor, Claude Code CLI, and any MCP-compatible client.

Why NestJS MCP?

  • Accelerate Development: Generate boilerplate code, controllers, services, and complete CRUD resources in seconds
  • Best Practices Built-in: All generated code follows NestJS best practices and conventions
  • Security First: Built-in security audit tools to identify vulnerabilities in your code
  • Complete Ecosystem: From scaffolding to deployment, covers the entire development lifecycle
  • AI-Powered Learning: Instant explanations of NestJS concepts, decorators, and patterns

Features

Code Generation

Generate production-ready NestJS code with proper decorators, types, and best practices.

Project Scaffolding

Create complete NestJS projects with your preferred database, authentication, and tooling pre-configured.

Testing Tools

Generate unit tests, E2E tests, test factories, and mock repositories automatically.

Security Auditing

Scan your code for common vulnerabilities (SQL injection, XSS, hardcoded secrets, etc.) with severity ratings.

Deployment Automation

Generate Docker, Kubernetes, CI/CD pipelines, Nginx configs, and more.

Documentation & Learning

Access NestJS documentation, concepts, and best practices directly through your AI assistant.


Available Tools

Code Generation Tools

ToolDescription
nestjs_generate_controllerGenerate controllers with optional CRUD operations
nestjs_generate_serviceGenerate services with repository integration
nestjs_generate_moduleGenerate modules with providers and imports
nestjs_generate_resourceGenerate complete CRUD resources (module, controller, service, entity, DTOs)
nestjs_generate_dtoGenerate DTOs with class-validator decorators
nestjs_generate_entityGenerate TypeORM/Mongoose entities
nestjs_generate_guardGenerate auth, roles, or custom guards
nestjs_generate_interceptorGenerate logging, transform, cache, or timeout interceptors
nestjs_generate_pipeGenerate validation or transform pipes
nestjs_generate_filterGenerate exception filters
nestjs_generate_middlewareGenerate custom middleware

Project Scaffolding Tools

ToolDescription
nestjs_scaffold_projectGenerate a complete NestJS project with customizable options

Scaffolding Options:

  • Database: PostgreSQL, MySQL, MongoDB, SQLite
  • Authentication: JWT-based auth with Passport
  • Documentation: Swagger/OpenAPI integration
  • Containerization: Docker & Docker Compose
  • Testing: Jest configuration with coverage
  • WebSockets: Socket.io integration

Testing Tools

ToolDescription
nestjs_generate_unit_testGenerate unit tests for services
nestjs_generate_controller_testGenerate controller unit tests
nestjs_generate_e2e_testGenerate end-to-end tests
nestjs_generate_test_factoryGenerate test data factories
nestjs_generate_mock_repositoryGenerate mock repository for testing
nestjs_generate_test_helpersGenerate common test utilities

Security Tools

ToolDescription
nestjs_security_auditComprehensive security audit of your codebase
nestjs_security_checklistGet security best practices checklist
nestjs_generate_secure_mainGenerate security-hardened main.ts

Security Checks Include:

  • SQL Injection vulnerabilities
  • Cross-Site Scripting (XSS)
  • Hardcoded secrets and credentials
  • Insecure cryptographic practices
  • Path traversal vulnerabilities
  • Command injection risks
  • Sensitive data exposure
  • Missing security headers

Deployment Tools

ToolDescription
nestjs_generate_dockerfileGenerate optimized multi-stage Dockerfile
nestjs_generate_docker_composeGenerate Docker Compose configuration
nestjs_generate_github_actionsGenerate GitHub Actions CI/CD pipeline
nestjs_generate_gitlab_ciGenerate GitLab CI/CD pipeline
nestjs_generate_kubernetesGenerate Kubernetes deployment manifests
nestjs_generate_pm2_configGenerate PM2 ecosystem configuration
nestjs_generate_nginx_configGenerate Nginx reverse proxy configuration
nestjs_generate_systemd_serviceGenerate systemd service file
nestjs_generate_env_filesGenerate environment configuration files

Documentation & Learning Tools

ToolDescription
nestjs_explain_conceptDetailed explanation of NestJS concepts
nestjs_explain_decoratorExplain specific decorators with examples
nestjs_explain_cliExplain NestJS CLI commands
nestjs_list_schematicsList all available NestJS schematics
nestjs_list_decoratorsList decorators by category
nestjs_best_practicesGet best practices by category
nestjs_recommended_packagesGet recommended packages by use case
nestjs_search_docsSearch through NestJS documentation
nestjs_request_lifecycleUnderstand the request lifecycle
nestjs_dependency_injectionLearn about dependency injection
nestjs_get_common_errorsGet solutions for common errors

Code Analysis Tools

ToolDescription
nestjs_analyze_codeAnalyze code for issues and anti-patterns
nestjs_suggest_improvementsGet improvement suggestions
nestjs_validate_structureValidate project structure

Available Resources

Access NestJS documentation directly through MCP resources:

Resource URIDescription
nestjs://docs/concepts/{topic}Core concepts (modules, controllers, providers, etc.)
nestjs://docs/techniques/{topic}Techniques (database, auth, validation, caching, etc.)
nestjs://docs/advanced/{topic}Advanced topics (CQRS, events, microservices, etc.)
nestjs://docs/cli/commandsCLI commands reference
nestjs://docs/cli/schematicsSchematics reference
nestjs://docs/decoratorsComplete decorators reference
nestjs://docs/best-practicesBest practices guide
nestjs://docs/packagesRecommended packages
nestjs://docs/errors/{error}Common errors and solutions

Project Structure

nestjs-mcp/
โ”œโ”€โ”€ src/
โ”‚   โ”œโ”€โ”€ index.ts                    # Main MCP server entry point
โ”‚   โ”œโ”€โ”€ data/
โ”‚   โ”‚   โ”œโ”€โ”€ nestjs-docs.ts          # Core NestJS documentation
โ”‚   โ”‚   โ””โ”€โ”€ advanced-techniques.ts  # Advanced topics & error solutions
โ”‚   โ”œโ”€โ”€ tools/
โ”‚   โ”‚   โ”œโ”€โ”€ index.ts                # Tools barrel export
โ”‚   โ”‚   โ”œโ”€โ”€ generate.ts             # Code generation tools
โ”‚   โ”‚   โ”œโ”€โ”€ explain.ts              # Documentation tools
โ”‚   โ”‚   โ”œโ”€โ”€ analyze.ts              # Code analysis tools
โ”‚   โ”‚   โ”œโ”€โ”€ scaffold.ts             # Project scaffolding
โ”‚   โ”‚   โ”œโ”€โ”€ testing.ts              # Test generation tools
โ”‚   โ”‚   โ”œโ”€โ”€ security.ts             # Security audit tools
โ”‚   โ”‚   โ””โ”€โ”€ deployment.ts           # Deployment config generators
โ”‚   โ”œโ”€โ”€ resources/
โ”‚   โ”‚   โ”œโ”€โ”€ index.ts
โ”‚   โ”‚   โ””โ”€โ”€ documentation.ts        # MCP resources
โ”‚   โ””โ”€โ”€ prompts/
โ”‚       โ”œโ”€โ”€ index.ts
โ”‚       โ””โ”€โ”€ templates.ts            # Prompt templates
โ”œโ”€โ”€ dist/                           # Compiled JavaScript
โ”œโ”€โ”€ package.json
โ”œโ”€โ”€ tsconfig.json
โ””โ”€โ”€ README.md

Advanced Topics Covered

The MCP server includes comprehensive documentation and code generation for:

TopicDescription
CQRSCommand Query Responsibility Segregation pattern
Event-DrivenEvent emitters and event sourcing
File UploadMulter integration and streaming uploads
StreamingSSE and streaming responses
Health ChecksTerminus health indicators
Task SchedulingCron jobs and intervals
CompressionGzip/Brotli response compression
Rate LimitingThrottling and rate limiting
API VersioningURI, header, and media type versioning
SerializationClass-transformer and interceptors

Roadmap

  • GraphQL code generation
  • Microservices scaffolding
  • gRPC integration templates
  • Database migration generators
  • OpenAPI spec to code generation
  • Custom template support
  • Plugin architecture