Skip to main content
Glama

NestJS MCP Server Module

by rekog-labs
MIT License
50,126
407
  • Apple
  • Linux

NestJS MCP Server Module

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

Installation

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

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.

-
security - not tested
A
license - permissive license
-
quality - not tested

remote-capable server

The server can be hosted and run remotely because it primarily relies on remote services or has no dependency on the local environment.

A NestJS module that allows services to be exposed as an MCP server with Server-Sent Events transport, facilitating tool discovery and execution by clients.

  1. Features
    1. Installation
      1. Quick Start
        1. 1. Import Module
        2. 2. Define Tools and Resource
      2. Quick Start for STDIO
        1. API Endpoints
          1. Tips
        2. Authentication
          1. 1. Create a Guard
          2. 2. Apply the Guard
        3. Playground
          1. Configuration

            Related MCP Servers

            • -
              security
              A
              license
              -
              quality
              A demonstration server that implements the Model Context Protocol (MCP) SDK, providing tools and endpoints for server-sent events and message handling.
              Last updated -
              19
              10
              MIT License
            • -
              security
              F
              license
              -
              quality
              A server for Model Context Protocol (MCP) that uses Server-Sent Events (SSE) for streaming communication, enabling tools like the HackerNews API to be accessed through a secure HTTP+SSE transport.
              Last updated -
              23
            • -
              security
              A
              license
              -
              quality
              A TypeScript framework for building MCP servers with features for client sessions, authentication, image/audio content, and typed server events.
              Last updated -
              MIT License
            • -
              security
              F
              license
              -
              quality
              An MCP server that enables interaction with Nexmo's Messages API, allowing agents to send and manage messages across various channels via natural language commands.
              Last updated -

            View all related MCP servers

            MCP directory API

            We provide all the information about MCP servers via our MCP API.

            curl -X GET 'https://glama.ai/api/mcp/v1/servers/rekog-labs/MCP-Nest'

            If you have feedback or need assistance with the MCP directory API, please join our Discord server