MCP Nest

v1.0.0Developer Toolsstable

A NestJS module to effortlessly create Model Context Protocol (MCP) servers for exposing AI tools, resources, and prompts.

llmllmsmcpmcp-nestmodel-context-protocol
Share:
649
Stars
0
Downloads
0
Weekly
0/5

What is MCP Nest?

MCP Nest is a Model Context Protocol (MCP) server that allows AI assistants like Claude, Cursor, and VS Code to nestjs module to effortlessly create model context protocol (mcp) servers for exposing ai tools, resources, and prompts.

A NestJS module to effortlessly create Model Context Protocol (MCP) servers for exposing AI tools, resources, and prompts.

This server falls under the Developer Tools category on MCPgee, the world's largest MCP server directory with 33,000+ servers.

Features

  • A NestJS module to effortlessly create Model Context Protoco

Use Cases

NestJS MCP server creation
Tool and resource exposure
Model Context Protocol integration
rekog-labs

Maintainer

LicenseMIT
Languagetypescript
Versionv1.0.0
UpdatedMay 19, 2026
Statushealthy
Maintenanceactive

Works with

ClaudeOpenAIwindowsmacoslinux

Installation

Manual Installation

npx mcp-nest

Configuration

Configuration Details

Config File

claude_desktop_config.json

Performance

Response Metrics

Response Time< 200ms
ThroughputMedium

Resource Usage

Memory UsageLow
CPU UsageLow

How to Set Up and Use MCP Nest

MCP-Nest (@rekog/mcp-nest) is the NestJS module that makes it trivially easy to turn any NestJS application into a Model Context Protocol server, exposing existing services as AI-callable tools, resources, and prompt templates. It hooks directly into NestJS dependency injection so services, guards, interceptors, and repositories can be used without modification alongside AI tool definitions. Backend engineers use it to make their existing API services discoverable by Claude, Cursor, and other MCP-aware AI assistants with just a decorator and a module import.

Prerequisites

  • Node.js 18 or higher
  • An existing or new NestJS 10+ application
  • npm or yarn
  • zod v4 for parameter schema definitions
  • An MCP-compatible AI client (Claude Desktop, Cursor, Windsurf, VS Code Copilot)
1

Install @rekog/mcp-nest and peer dependencies

Install the package alongside the MCP SDK and zod. These are all required at runtime.

npm install @rekog/mcp-nest @modelcontextprotocol/sdk zod@^4
2

Register McpModule in your root module

Import McpModule.forRoot() in your AppModule with the server name and version. This sets up the transport layer and tool registry within NestJS.

import { Module } from '@nestjs/common';
import { McpModule } from '@rekog/mcp-nest';

@Module({
  imports: [
    McpModule.forRoot({
      name: 'my-api-mcp-server',
      version: '0.1.0',
    }),
  ],
})
export class AppModule {}
3

Create an MCP Tool using the @Tool decorator

Annotate any injectable NestJS class method with @Tool. Define its name, description, and zod parameter schema. The Context argument provides progress reporting and MCP request metadata.

import { Injectable } from '@nestjs/common';
import { Tool, Context } from '@rekog/mcp-nest';
import { z } from 'zod';

@Injectable()
export class SearchTool {
  @Tool({
    name: 'search-products',
    description: 'Search the product catalog by keyword',
    parameters: z.object({
      query: z.string().describe('The search term'),
      limit: z.number().int().min(1).max(50).default(10),
    }),
  })
  async search({ query, limit }: { query: string; limit: number }) {
    // Your existing service logic here
    return { results: [], query, limit };
  }
}
4

Register your tool as a NestJS provider

Add the tool class to the providers array of its feature module so NestJS can inject it and mcp-nest can discover the decorated methods automatically.

import { Module } from '@nestjs/common';
import { SearchTool } from './search.tool';

@Module({
  providers: [SearchTool],
})
export class CatalogModule {}
5

Run the application and verify

Start your NestJS app. The MCP server is embedded and accessible via HTTP+SSE at /mcp/sse by default. You can verify tool registration by checking the startup logs or connecting an MCP client.

npm run start:dev

MCP Nest Examples

Client configuration

Connect an MCP client to a NestJS application running mcp-nest over SSE. Adjust the port if your app uses a non-default port.

{
  "mcpServers": {
    "mcp-nest": {
      "url": "http://localhost:3000/mcp/sse"
    }
  }
}

Prompts to try

Example prompts after connecting a NestJS MCP-Nest server to Claude Desktop or another MCP client.

- "List all tools exposed by this NestJS server"
- "Search products for 'bluetooth speaker' with a limit of 5 results"
- "Call the user-profile tool with userId set to 42"
- "Use the order-status tool to check order #98765"
- "Invoke the generate-report tool for the current month's sales data"

Troubleshooting MCP Nest

@Tool decorated methods are not showing up in the MCP client tool list

Confirm the class is listed in the providers array of its NestJS module and that the module is imported in AppModule. Without NestJS provider registration, mcp-nest cannot discover the decorated methods through reflection.

Cannot find module '@rekog/mcp-nest' or type errors after install

Ensure your TypeScript config has experimentalDecorators and emitDecoratorMetadata set to true in tsconfig.json — these are required for NestJS decorator reflection. Run `npm install` again if the package is missing from node_modules.

MCP client SSE connection immediately closes

Check that your NestJS app is fully started before connecting the MCP client. The SSE endpoint at /mcp/sse requires the app to be listening. Also verify no authentication guard is blocking the /mcp/* routes if you have global guards configured.

Frequently Asked Questions about MCP Nest

What is MCP Nest?

MCP Nest is a Model Context Protocol (MCP) server that nestjs module to effortlessly create model context protocol (mcp) servers for exposing ai tools, resources, and prompts. It connects AI assistants to external tools and data sources through a standardized interface.

How do I install MCP Nest?

Follow the installation instructions on the MCP Nest GitHub repository. Clone the repo, install dependencies, and add the server config to your AI client.

Which AI clients work with MCP Nest?

MCP Nest works with all major MCP-compatible AI clients including Claude Desktop, Claude Code, Cursor, VS Code (GitHub Copilot), Windsurf, and Cline.

Is MCP Nest free to use?

Yes, MCP Nest is open source and available under the MIT license. You can use it freely in both personal and commercial projects.

Browse More Developer Tools MCP Servers

Explore all developer tools servers available in the MCPgee directory. Each server includes setup guides for Claude, Cursor, and VS Code.

Quick Config Preview

{ "mcpServers": { "mcp-nest": { "command": "npx", "args": ["-y", "mcp-nest"] } } }

Add this to your claude_desktop_config.json or .cursor/mcp.json

Read the full setup guide →

Ready to use MCP Nest?

Browse our complete directory of 33,000+ MCP servers, read setup guides for your editor, and start building with the Model Context Protocol.

33,000+ ServersFree & Open SourceStep-by-Step Guides