rekog-labs

MCP Nest

Built by rekog-labs 611 stars

What is MCP Nest?

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

How to use MCP Nest?

1. Install a compatible MCP client (like Claude Desktop). 2. Open your configuration settings. 3. Add MCP Nest using the following command: npx @modelcontextprotocol/mcp-nest 4. Restart the client and verify the new tools are active.
🛡️ Scoped (Restricted)
npx @modelcontextprotocol/mcp-nest --scope restricted
🔓 Unrestricted Access
npx @modelcontextprotocol/mcp-nest

Key Features

Native MCP Protocol Support
Real-time Tool Activation & Execution
Verified High-performance Implementation
Secure Resource & Context Handling

Optimized Use Cases

Extending AI models with custom local capabilities
Automating system workflows via natural language
Connecting external data sources to LLM context windows

MCP Nest FAQ

Q

Is MCP Nest safe?

Yes, MCP Nest follows the standardized Model Context Protocol security patterns and only executes tools with explicit user-granted permissions.

Q

Is MCP Nest up to date?

MCP Nest is currently active in the registry with 611 stars on GitHub, indicating its reliability and community support.

Q

Are there any limits for MCP Nest?

Usage limits depend on the specific implementation of the MCP server and your system resources. Refer to the official documentation below for technical details.

Official Documentation

View on GitHub

NestJS MCP Server Module

<div align="center"> <img src="https://raw.githubusercontent.com/rekog-labs/MCP-Nest/main/image.png" height="200">

CI Code Coverage NPM Version NPM Downloads NPM License

</div>

A NestJS module to effortlessly expose tools, resources, and prompts for AI, from your NestJS applications using the Model Context Protocol (MCP).

With @rekog/mcp-nest you define tools, resources, and prompts in a way that's familiar in NestJS and leverage the full power of dependency injection to utilize your existing codebase in building complex enterprise ready MCP servers.

Features

Are you interested to build ChatGPT widgets (with the OpenAI SDK) or MCP apps? Find out how to do that with @rekog/MCP-Nest in this repository MCP-Nest-Samples

[!TIP] You can easily learn about this package using the chat tab in Context7. Better yet, connect the Context7 MCP server to allow your AI agents to access the documentation and implement MCP-Nest for you.

Installation

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

Optional dependencies

If you use the built-in authorization server with the TypeORM store, install the following optional peer dependencies:

npm install @nestjs/typeorm typeorm

Quick Start

// app.module.ts
import { Module } from '@nestjs/common';
import { McpModule } from '@rekog/mcp-nest';
import { GreetingTool } from './greeting.tool';

@Module({
  imports: [
    McpModule.forRoot({
      name: 'my-mcp-server',
      version: '1.0.0',
    }),
  ],
  providers: [GreetingTool],
})
export class AppModule {}
// greeting.tool.ts
import { Injectable } from '@nestjs/common';
import { Tool, Context } from '@rekog/mcp-nest';
import { z } from 'zod';

@Injectable()
export class GreetingTool {
  @Tool({
    name: 'greeting-tool',
    description: 'Returns a greeting with progress updates',
    parameters: z.object({
      name: z.string().default('World'),
    }),
  })
  async sayHello({ name }, context: Context) {
    await context.reportProgress({ progress: 50, total: 100 });
    return `Hello, ${name}!`;
  }
}

Documentation

Playground

The playground directory contains working examples for all features. Refer to playground/README.md for details.

<!-- Badges -->

Global Ranking

-
Trust ScoreMCPHub Index

Based on codebase health & activity.

Manual Config

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