1. Conduid
  2. Developer Tools
  3. Nestjs MCP
MCP server · Developer Tools

Nestjs MCP

MCP server: Nestjs MCP

Unclaimed MIT last commit a year ago devtools
47Fair

Scored 7 days ago · breakdown

About Nestjs MCP

Nestjs MCP is an MCP server published by cazvid-ai in the Developer Tools category: mCP server: Nestjs MCP.

The repository has 1 stars and 0 forks, with the last commit a year ago. Six months or more without a commit doesn't mean the server is broken, but check the open issues before depending on it in production.

Install

From source
git clone https://github.com/cazvid-ai/nestjs-mcp

This server has no ConduID identity, so agent calls to it are not receipted. Pin the version you install and review the source before granting it credentials.

Ask AI

✦

Ask AI about Nestjs MCP

Powered by Claude · Grounded in docs

I know everything about Nestjs MCP. Ask me about installation, configuration, usage, or troubleshooting.

Security checks

Static checks derived from the repository 7 days ago. Heuristics on the source, not an audit.

  • ✓README presentThe repository ships documentation.
  • ✓License declaredUsable under a stated license.
  • ✓Tests presentA test suite exists in the repository.
  • ✓Dependencies pinnedA lockfile pins dependency versions.
  • ✓No dynamic code executionSource scan found no eval, dynamic Function, or shell execution.
  • !Scoped permissionsDoesn't declare a permission scope. Assume it can do anything its process can.

Releases

nestjs-mcp-v0.4.1nestjs-mcp: v0.4.1 · 12 Oct 20250.4.1 (2025-10-12) Bug Fixes registry: skip outputSchema validation for error results to match MCP spec (933e447)
nestjs-mcp-v0.4.0nestjs-mcp: v0.4.0 · 11 Oct 20250.4.0 (2025-10-11) ⚠ BREAKING CHANGES strict outputSchema validation; DI-safe guards; hardened auth; docs/tests Features strict outputSchema validation; DI-safe guards; hardened auth; docs/tests (1df2ec8)
nestjs-mcp-v0.3.0nestjs-mcp: v0.3.0 · 11 Oct 20250.3.0 (2025-10-11) ⚠ BREAKING CHANGES Non-CallToolResult handlers no longer emit legacy structuredContent; 0.3.0 removes the deprecated bridge in favor of spec-compliant CallToolResult responses. Features remove structuredContent fallback…
nestjs-mcp-v0.2.4nestjs-mcp: v0.2.4 · 11 Oct 20250.2.4 (2025-10-11) Bug Fixes path (9430935) Miscellaneous Chores graduate to stable (1b13721) release 0.2.4 (be4e796) release 0.2.4 (27c207d)

README

@cazvid-ai/nestjs-mcp

NestJS utilities for exposing Model Context Protocol tools without hand-rolling a server in every project. Decorate any injectable with @McpTool(), import McpModule, and you get a streamable HTTP endpoint backed by the official MCP TypeScript SDK.

🚧 This package is pre-1.0. Expect breaking changes while the API stabilizes and please send feedback.

Installation

  • Node.js ≥ 18.18 with ES module support ("type": "module" in your package.json).
  • Nest app using @nestjs/platform-express.
  • Peer dependencies: @nestjs/common, @nestjs/core, reflect-metadata, zod, and @modelcontextprotocol/sdk.
# Stable release
pnpm add @cazvid-ai/nestjs-mcp @modelcontextprotocol/sdk zod reflect-metadata

# Preview channel (optional)
pnpm add @cazvid-ai/nestjs-mcp@next @modelcontextprotocol/sdk zod reflect-metadata

Ensure your tsconfig.json enables decorators and NodeNext module resolution (see docs/getting-started.md for the full example).

Quick Start

// app.module.ts
import { Module } from '@nestjs/common';
import { McpModule } from '@cazvid-ai/nestjs-mcp';
import { DataTools } from './data.tools.js';

@Module({
  imports: [
    McpModule.forRoot({
      auth: { mode: 'service', key: process.env.MCP_SERVICE_KEY! },
      path: '/mcp', // optional, defaults to '/mcp'
    }),
  ],
  providers: [DataTools],
})
export class AppModule {}
// data.tools.ts
import { Injectable } from '@nestjs/common';
import { McpTool, McpExecutionContext } from '@cazvid-ai/nestjs-mcp';
import type { CallToolResult } from '@modelcontextprotocol/sdk/types.js';
import { z } from 'zod';

const PingInput = z.object({ message: z.string().default('ping') });
const PingOutput = z.object({
  reply: z.string(),
});

@Injectable()
export class DataTools {
  @McpTool({
    name: 'ping',
    description: 'Simple health check',
    inputSchema: PingInput,
    outputSchema: PingOutput,
  })
  async ping(
    input: z.infer<typeof PingInput>,
    ctx: McpExecutionContext
  ): Promise<CallToolResult> {
    const ua = ctx.headers['user-agent'];
    const base = input.message === 'ping' ? 'pong' : `echo:${input.message}`;
    const reply = typeof ua === 'string' ? `${base} (from ${ua})` : base;

    return {
      structuredContent: { reply },
      content: [
        {
          type: 'text',
          text: reply,
        },
      ],
    };
  }
}
// main.ts
import 'reflect-metadata';
import { NestFactory } from '@nestjs/core';
import { AppModule } from './app.module.js';

async function bootstrap() {
  const app = await NestFactory.create(AppModule);
  await app.listen(process.env.PORT ?? 3000);
}
bootstrap();

Need separate endpoints with different auth or tool groups? Import the module once with forRoot() and use McpModule.register() for each additional route:

@Module({
  imports: [
    McpModule.forRoot({
      auth: { mode: 'service', key: process.env.MCP_SERVICE_KEY! },
      path: '/mcp',
      groups: ['public'],
    }),
    McpModule.register({
      auth: { mode: 'bearer', verifier: AdminBearerVerifier },
      path: '/mcp-admin',
      groups: ['admin'],
    }),
  ],
  providers: [AdminBearerVerifier],
})
export class AppModule {}

Heads up: Router registration is enabled by default. Only set registerRouter: false if you intend to mount the controller manually—the module will otherwise fall back to mounting at /mcp when no explicit path is provided.

Async callers can return path or registerRouter from forRootAsync()/registerAsync() factories and the router will align once the factory resolves.

By default the HTTP controller is mounted at /mcp. Override the path option or provide an array when you need additional aliases. Run the app and probe the endpoint:

PORT=3000 MCP_SERVICE_KEY=xyz pnpm start

curl -i -X POST http://localhost:3000/mcp \
  -H 'content-type: application/json' \
  -H 'x-api-key: xyz' \
  --data '{"method":"ping","params":{"message":"ping"}}'

If you configure outputSchema, success results should return a CallToolResult with structuredContent that matches the schema. Error results (isError: true) may omit structuredContent; the server will pass the error through without validating it. Non-string outputs without a schema are JSON‑stringified into a text item, so prefer the structured MCP shape for production handlers.

Documentation

Verification Checklist

Before submitting changes (or when picking up the repo), make sure the following commands succeed and fix implementations rather than muting tests:

pnpm lint
pnpm typecheck
pnpm test

Roadmap

  • Optional JWT/OAuth guard
  • Schema-to-docs utilities
  • More granular error mapping and logging helpers

License

MIT © Cazvid AI

README fetched from the repository 7 days ago. The original is authoritative.

Questions

About Nestjs MCP

How do I install Nestjs MCP?

No package has been published for this server, so install it from source: clone the repository and follow its README.

Is Nestjs MCP safe to use with an AI agent?

Its trust score is 47 out of 100 (fair). It passes 5 of the 6 static security checks run so far; the failures are listed above. It has no ConduID identity yet, so agent calls to it are not receipted.

Is Nestjs MCP still maintained?

The last commit was a year ago. That's long enough that you should check whether the maintainer is responding to issues before depending on it.