FrontMCP vs @nestjs/mcp

Checked against FrontMCP 1.15.2 on

@nestjs/mcp is the NestJS team's module for serving MCP from a Nest application: tools, resources and prompts are methods of your providers, declared with @Tool(), @Resource() and @Prompt(), and every call runs through Nest's guards, interceptors, pipes and exception filters. FrontMCP can run as its own server or inside a Nest application. It also declares tools with decorators, with a container for shared services and hooks around every call, and adds sessions for older clients, its own OAuth server, agents and jobs, widgets, a test library and builds for several platforms. This page shows the same tool in both and compares them on the criteria of the comparison overview.

This site documents FrontMCP, so read it knowing who wrote it. Every @nestjs/mcp fact below comes from its README, source and release notes at 0.0.5, its chapter of the NestJS documentation and its npm entry, checked on 2026-12-01, and links to them. Every FrontMCP fact links to the page on this site that shows FrontMCP 1.15.2 doing it, or to how this was checked.

Quick answer

Choose @nestjs/mcp when you already run a NestJS application and want MCP inside it: tools that are methods of your providers, your guards, interceptors and filters around every call, and an endpoint at /mcp on the server you already deploy, stateless so it scales behind any load balancer, for clients of MCP 2026-07-28 and of the 2025 revisions. Choose FrontMCP when your clients on MCP 2025-11-25 or earlier need sessions, when you want the server to issue its own tokens, or when you want agents, jobs, widgets and a test library in the same framework.


What @nestjs/mcp is

@nestjs/mcp is developed in the NestJS organization on GitHub and published on npm as @nestjs/mcp, which names Kamil Mysliwiec as its author, with nestjscore and kamilmysliwiec as its maintainers. It's MIT-licensed (LICENSE). The repository was created on 2026-11-04, the day of its first release, 0.0.1; 0.0.5, the version checked here, came out on 2026-11-26 (npm, release notes). Its documentation is a chapter of the NestJS docs, Model Context Protocol, with pages on primitives, transports, testing and migrating from @rekog/mcp-nest, and a tutorial, Build an MCP server in Node.js.

Its README describes it as a module in which "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", 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" (README).

It's built on the official SDK, v2: its package.json asks for @modelcontextprotocol/server ^2.4.0, which installed 2.4.0 on 2026-12-01, for NestJS 12 (@nestjs/common and @nestjs/core ^12.0.0), reflect-metadata and rxjs as peer dependencies, and for Node 20.19 or later (package.json). The project is at 0.0.x, and its migration page lists what this version doesn't do: the HTTP+SSE transport, sessions, registering tools at runtime, several MCP servers in one application and request-scoped providers (What's not there).

On 2026-12-01, nestjs/mcp had 19 GitHub stars (GitHub API) and 29,905 npm downloads in the week of 2026-11-23 to 2026-11-29 (npm API). FrontMCP had 154 stars and 12,061 downloads of @frontmcp/sdk in the same week. @nestjs/mcp is under a month old, and was downloaded more than twice as often as @frontmcp/sdk that week.

The same tool in both

One tool, add, that takes two numbers and returns their sum, called with { "a": 2, "b": 3 }.

In @nestjs/mcp

We created a project with the Nest CLI 12.0.15, nest new add-server --minimal, as the tutorial's Create the project does, and installed the packages the README's Installation names: npm i --save @nestjs/mcp @modelcontextprotocol/server zod. We then replaced the scaffold's src/main.ts with the README's Quick Start, a provider with a decorated method and a module that imports McpModule, and the main.ts of the docs' Register the module:

src/calculator.tools.ts
import { Injectable } from '@nestjs/common';
import { Tool } from '@nestjs/mcp';
import * as z from 'zod';

@Injectable()
export class CalculatorTools {
  @Tool({
    name: 'add',
    description: 'Add two numbers',
    inputSchema: z.object({ a: z.number(), b: z.number() }),
  })
  add({ a, b }: { a: number; b: number }) {
    return a + b;
  }
}
src/app.module.ts
import { Module } from '@nestjs/common';
import { McpModule } from '@nestjs/mcp';
import { CalculatorTools } from './calculator.tools.js';

@Module({
  imports: [McpModule.forRoot({ name: 'calc', version: '1.0.0' })],
  providers: [CalculatorTools],
})
export class AppModule {}
src/main.ts
import { NestFactory } from '@nestjs/core';
import { AppModule } from './app.module.js';

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

For stdio, a second entry point serves the same module from a standalone application context, as Over stdio shows. McpStdioLogger sends Nest's log to stderr, since stdout carries the protocol:

src/stdio.ts
import { NestFactory } from '@nestjs/core';
import { McpStdioLogger, McpStdioServer } from '@nestjs/mcp';
import { AppModule } from './app.module.js';

async function bootstrap() {
  const app = await NestFactory.createApplicationContext(AppModule, {
    logger: new McpStdioLogger(),
  });
  await app.get(McpStdioServer).listen();
  await app.close();
}
bootstrap();

npm run build compiled both, and node dist/main.js started the Express application, whose log listed McpController {/mcp}. A client from @modelcontextprotocol/client 2.4.0 called add at http://127.0.0.1:3000/mcp and over node dist/stdio.js, once with its default, which opens a 2025-era connection with initialize, and once with versionNegotiation: { mode: "auto" }, which asks for 2026-07-28 first:

http  legacy 2025-11-25 {"content":[{"type":"text","text":"5"}]}
http  modern 2026-07-28 {"_meta":{"io.modelcontextprotocol/serverInfo":{"name":"calc","version":"1.0.0"}},"content":[{"type":"text","text":"5"}]}
stdio legacy 2025-11-25 {"content":[{"type":"text","text":"5"}]}
stdio modern 2026-07-28 {"_meta":{"io.modelcontextprotocol/serverInfo":{"name":"calc","version":"1.0.0"}},"content":[{"type":"text","text":"5"}]}

The number came back as text, as the docs' Tools table says for a value without an outputSchema. Called with { "a": "2", "b": 3 }, add returned a tool error, Input validation error: Invalid arguments for tool add: a: Invalid input: expected number, received string, and the method didn't run. The --minimal scaffold also installs the NestJS Observe SDK, @nestjs/observe, and wires it into the file we replaced; we uninstalled it, so the project has only what MCP needs.

In FrontMCP

The same tool, in a one-app FrontMCP server. The Playground runs it and calls add; the Tests tab runs the checks below it.

Open
import { App, FrontMcp, Tool, ToolContext, z } from "@frontmcp/sdk";

@Tool({
  name: "add",
  description: "Add two numbers",
  inputSchema: { a: z.number(), b: z.number() },
})
export class Add extends ToolContext {
  async execute({ a, b }: { a: number; b: number }) {
    return { sum: a + b };
  }
}

@App({ id: "calc", name: "Calculator", tools: [Add] })
export class CalcApp {}

@FrontMcp({ info: { name: "calc", version: "1.0.0" }, apps: [CalcApp] })
export default class Server {}

Starting FrontMCP in your browser…

FrontMCP starts when this example comes into view.

The two look alike: a decorator, a Zod schema, and a module or an app that lists the tool. In @nestjs/mcp the tool is a method of a Nest provider, and the server is the Nest application; in FrontMCP it's a class in an app of a FrontMCP server, which runs as its own process. FrontMCP returns the object as structuredContent with a text copy (Your First Tool); @nestjs/mcp does the same for a tool with an outputSchema. FrontMCP needs Node 24 or later and TypeScript's decorator settings (Installation), and frontmcp dev runs it; @nestjs/mcp needs Node 20.19 or later.

On 2026-12-01, in empty projects, the README's npm install @nestjs/mcp@0.0.5 @modelcontextprotocol/server zod added 26 packages, npm installing its peers @nestjs/common, @nestjs/core, reflect-metadata and rxjs with it. A Nest application also needs an HTTP platform: with @nestjs/platform-express, the one nest new installs, it was 99 packages, and with @nestjs/platform-node 95. npm install @frontmcp/sdk added 128.

Side by side

@nestjs/mcp 0.0.5FrontMCP 1.15.2
MCP revisions served2024-11-05 to 2026-07-28 over Streamable HTTP and stdio, in our run and in the docs, with no session for the older four over HTTP (The HTTP endpoint, Over stdio). legacy: 'reject' serves 2026-07-28 only2024-11-05 to 2026-07-28 over Streamable HTTP and stdio (except 2026-07-28 on stdio servers with channels), with a session for the older four (Protocol versions)
Declaring a tool@Tool() on a method of a provider, found at startup (Tools)A @Tool class, or the tool() function
SchemasStandard Schema that produces JSON Schema: Zod 4.2 or later, ArkType, Valibot through toStandardJsonSchema(), JSON Schema through the SDK's fromJsonSchema(); Zod 3 is refused at startup. outputSchema validates structured results (Installation, Tools)Zod 4; outputSchema checks every result (Schemas Are Contracts, Shaping Tool Results)
Shared servicesNest's container: a tool's provider injects your services in its constructor. Request-scoped providers fail at startup; the request and the token are in the call's ctx (How a call is served, Migration)@Provider services, injected in a constructor or read with this.get(), one per server or one per request or session (Scopes)
Code around every callNest's guards, interceptors, pipes and exception filters, on the class, the method or global; McpExecutionContext reads the call (Guards, interceptors, pipes and filters)Hooks before, after and around each stage of a call, and plugins built from them
AuthAn OAuth 2.1 resource server: a token verifier you write (JWT or introspection), protected resource metadata, WWW-Authenticate challenges, scopes per tool, resource or prompt; it never issues tokens. Guards, such as an API key check, and @nestjs/authentication and @nestjs/authorization policies (Authorization, The HTTP endpoint)Five modes: public, static keys, JWTs from your identity provider, and FrontMCP as the OAuth server, with its own sign-in page or an upstream provider's (Auth modes); per-entry rules (Authorities)
Asking the client for inputA tool returns inputRequired(), and the client calls it again with the answer: over HTTP for 2026-07-28 clients only, where a 2025 client gets a tool error; over stdio for both (The call context). Sampling and roots: not documentedthis.elicit(), which becomes input_required for 2026-07-28 clients; this.sample() and this.listRoots() for clients that offer them
TestingconnectMcpClient() from @nestjs/mcp/testing: the SDK's client, in memory, against a Nest testing module, through the token check, the schemas and the enhancers; McpRegistry to check every tool (Testing)@frontmcp/testing with MCP matchers, run by frontmcp test (Testing)
Resources, prompts, completionsResources and templates, prompts (Resources, Prompts); completion: not documentedResources and templates, prompts, completion of template parameters (@Resource, @Prompt, completers)
Agents, jobs, workflows, tasksNot documented@Agent, @Job, @Workflow; background tasks
Widgets (MCP Apps)Not documentedA tool's ui option, for MCP Apps hosts and the OpenAI Apps SDK (Tool UI, Hosts)
TransportsStreamable HTTP, stateless, as a route of the Nest application; stdio, from a standalone application context; in memory, for tests. HTTP+SSE isn't served (Transports, What's not there)Streamable HTTP with or without sessions, the older HTTP+SSE, stdio, a Unix socket, in-memory (FrontMcpInstance, transport)
Runtimes and deploymentNode 20.19+; NestJS 12 on Express, Fastify or Nest's Node adapter (README). Served by your Nest application, on as many instances as you like with no session affinity (How a call is served)Node 24+; frontmcp build targets for Node, Vercel, AWS Lambda, Cloudflare Workers and a browser module (Production build); @frontmcp/edge for Cloudflare Workers with Durable Object sessions; a fetch handler for other runtimes (createFetchHandler()); FrontMcpModule mounts on Nest Express or Fastify
CLINo MCP CLI; the project comes from the Nest CLI, nest new (Create the project), and the docs try it with the MCP Inspector (Try it)frontmcp create, dev, build, test, inspector (CLI); an Nx plugin
LicenseMITApache-2.0

What each does that the other doesn't

What @nestjs/mcp documents, or did in our run, and this site doesn't show for FrontMCP:

  • Nest's enhancers on MCP calls: the guards, interceptors, pipes and exception filters your routes use, a global ValidationPipe that validates a DTO class, and custom parameter decorators (Guards, interceptors, pipes and filters). FrontMCP has hooks of its own.
  • Policies from @nestjs/authentication and @nestjs/authorization: @CurrentUser() and @Can() on a tool, as on a route (Authorization).
  • A choice of schema library. ArkType, Valibot and plain JSON Schema work as well as Zod. FrontMCP's pages use Zod 4 only.
  • NestJS Observe names each MCP call in its traces, tools/call find-order rather than POST /mcp, with nothing to configure (NestJS Observe).
  • Node 20.19 or later. FrontMCP needs Node 24.
  • Install size in the 2026-12-01 check. The Nest README command installed 26 packages, or 99 with Express. The separate @frontmcp/sdk@1.14.0 install in that check added 128 packages.

What FrontMCP does that @nestjs/mcp's docs don't document:

  • Sessions for clients on 2025-11-25 and earlier, which Redis can share between instances. @nestjs/mcp keeps none over HTTP, so it can't ask those clients for input during a call there (What's not there).
  • Requests from the server to the client: this.sample() and this.listRoots() for clients that offer them, and this.elicit() over HTTP for clients of the 2025 revisions as well as 2026-07-28.
  • Services for one request or one session: a CONTEXT provider is new for each. @nestjs/mcp refuses request-scoped providers at startup.
  • An OAuth server: in local mode FrontMCP issues the tokens and serves the sign-in page, and you check the user in authenticate (Local auth); in remote mode it signs users in at an upstream provider (Remote and proxied auth). @nestjs/mcp verifies tokens that an identity provider issues.
  • Completion of resource template parameters (completers).
  • Agents, jobs, workflows and tasks: agents that run a model loop on the server, jobs that run in the background, workflows that chain them, and tools that run as MCP tasks.
  • Widgets. A tool's ui option renders an HTML or React widget for MCP Apps hosts and the OpenAI Apps SDK (Your First Widget).
  • Plugins for caching, memory, approval, feature flags and CodeCall (Plugins and adapters).
  • A test library with MCP matchers and fixtures, run by frontmcp test (Testing Your Server).
  • Project scaffolding and platform builds: frontmcp create, and frontmcp build for Vercel, AWS Lambda and Cloudflare Workers (Deploying Your Server).

Both declare tools with decorators and validate arguments before your code runs, serve MCP 2026-07-28 and the 2025 revisions on one endpoint, check per tool who may call it (@nestjs/mcp's scopes and FrontMCP's authorities), and can leave tools out of a request's list: @nestjs/mcp with its filter option, new in 0.0.5, and FrontMCP with authorities and feature flags.

When to choose @nestjs/mcp

  • You already run NestJS and want MCP inside it: the same application, the same deployment, an endpoint next to your routes, and tools that call your services through Nest's container.
  • Your guards, interceptors, pipes and filters should apply to MCP calls as they do to routes, and your auth already lives in a guard or in @nestjs/authentication and @nestjs/authorization.
  • Your identity provider issues the tokens, and the server only verifies them.
  • Every request can stand on its own, and you scale the application across instances without session affinity.
  • You want ArkType, Valibot or plain JSON Schema rather than Zod, or you're on Node 20 or 22.
  • You want the module the NestJS team maintains and documents with the framework. It's at 0.0.x; its migration page lists what this version doesn't do yet.

When to choose FrontMCP

  • You want FrontMCP apps, providers, hooks and plugins, either in a standalone service or mounted with FrontMcpModule.
  • Your clients use MCP 2025-11-25 or earlier and need a session: a server that asks them for input, sampling or roots over HTTP, or several instances that share sessions (Running Several Instances).
  • You want the server to issue tokens itself, with its own sign-in page or machine tokens.
  • You want agents, background jobs, workflows, tasks or widgets from the same framework.
  • You want tests written with a dedicated library, or a build for Vercel, AWS Lambda or Cloudflare Workers.

How this was checked

On 2026-12-01 we created a project with the Nest CLI 12.0.15, with Node 24.22.1 and npm 11.19.1, installed @nestjs/mcp 0.0.5, @modelcontextprotocol/server 2.4.0 and zod 4.6.7, with NestJS 12.6.3 on Express, built the code above with nest build (TypeScript 6.0.3), and called add over Streamable HTTP and stdio with @modelcontextprotocol/client 2.4.0. We then sent each server an initialize request for every MCP revision from 2024-11-05 to 2025-11-25, and the 2026-07-28 server/discover and tools/call requests, with the MCP-Protocol-Version: 2026-07-28 header and the revision in _meta. Over HTTP and over stdio, all five answered and returned 5; over HTTP the 2025-era initialize answers carried no Mcp-Session-Id, and server/discover listed only 2026-07-28 in supportedVersions. With http: { legacy: 'reject' } and stdio: { legacy: 'reject' }, the four older revisions got -32022 Unsupported protocol version (with 400 over HTTP), and 2026-07-28 was still served. We didn't run it on Fastify or the Node adapter, or try OAuth.

FrontMCP serves all five revisions over Streamable HTTP and stdio, except stdio servers with channels, which decline 2026-07-28. Its stdio router returns discovery and resultType results for 2026-07-28, and keeps initialize sessions for older clients. The overview describes the method for every library.

Report a docs issue · Report a security concern privately