Back to Home
jhenbertgit icon

nest-mcp-server

by jhenbertgit

Overview

A NestJS server implementing the Model Context Protocol (MCP) to expose developer tools to AI agents via HTTP or standard I/O, supporting real-time streaming of tool outputs.

Installation

Run Command
pnpm run start

Environment Variables

  • PORT
  • TRANSPORT

Security Notes

CRITICAL VULNERABILITY: The `filereader` tool (src/tools/filereader/filereader.service.ts) is susceptible to path traversal. It uses `fs.readFile` directly with user-provided `path` input without sufficient validation or restriction. An attacker can read arbitrary files on the server (e.g., `/etc/passwd`, `../../.env`). NETWORK RISKS: - CORS is enabled for all origins (`origin: '*'`), which is insecure for production environments. - The `/register`, `/authorize`, and `/token` endpoints are explicitly mock implementations, providing no real authentication or authorization. Deploying this server publicly without a robust external authentication layer would be highly insecure. - The `file-search` tool, while using `glob`, operates with `cwd: '.'` and could be leveraged for information disclosure (e.g., listing sensitive files outside intended scope) if patterns are not adequately restricted, though less critical than arbitrary file read.

Similar Servers

Stats

Interest Score0
Security Score2
Cost ClassMedium
Avg Tokens2000
Stars0
Forks0
Last Update2025-12-01

Tags

NestJSMCPAI ToolsBackendMicroservices