nestjs-mcp

rodrigoalejandrorios/nestjs-mcp

3.2

If you are the rightful owner of nestjs-mcp and would like to certify it and/or have it hosted online, please leave a comment on the right or send an email to henry@mcphub.com.

This document provides a comprehensive overview of the Model Context Protocol (MCP) Server implemented using NodeJS and NestJS.

Tools
  1. tool1

    Example tool 1 for demonstration purposes.

  2. tool2

    Example tool 2 for demonstration purposes.

  3. tool3

    Example tool 3 for demonstration purposes.

  4. tool4

    Example tool 4 for demonstration purposes.

MCP Server (NodeJS and NestJS version)

NodeJS integrated MCP Server version.

Integrations:

  • Tools
  • Resources
  • Prompts

Tools:

When starting the server you will see 4 example tools.

ref arch

Check the tools-example.service.ts file to understand how it works.

Resources:

When starting the server you will see 3 available resources to test. It provides example files to allow interaction with them.

ref arch

Check the resources-example.service.ts file to understand how it works.

Prompts:

When starting the server you will see 6 types of available prompts to interact with. Each one has a specific characteristic to exemplify different use cases.

ref arch

Check the prompts-example.service.ts file to understand how it works.

Environment variables:

To start MCPs locally make sure to add these variables:

# Port for NestJS HTTP API
PORT=8002

# MCP Transport: 'stdio' or 'http'
MCP_TRANSPORT=http

# Logging level
LOG_LEVEL=debug

Starting the server

Docker:

If you use docker you can run the command docker build -t mcp-node . and then the following command:

docker run --name mcp-node-container -p 8002:8002 \
  -e MCP_TRANSPORT=http \
  -e LOG_LEVEL=debug \
  mcp-node
Using NestJS:

Run npm run start:dev to view logs and make changes dynamic.

Another option is to run npm run build and then npm run start:prod to run the compiled product.

Test your MCP

Run the command npx @modelcontextprotocol/inspector to visualize something like this:

ref arch