# Nest REST Mongo Boilerplate MCP Server

> A NestJS MCP backend starter for MongoDB.

- **URL**: https://followmcp.com/en/servers/nest-rest-mongo-boilerplate
- **Category**: Database
- **Origin**: Community
- **Stars**: 301
- **FMRS Score**: 43/100 (Grade D)
- **Source**: https://github.com/msanvarov/nest-rest-mongo-boilerplate
- **Transports**: Streamable HTTP
- **Runtimes**: Node.js 20+, Docker
- **Auth**: No credential needed

## Overview
This is a backend starter built with NestJS, Fastify, and Mongoose. It includes authentication, authorization, logging, CRUD, MongoDB persistence, and built-in MCP server and client components. The MCP server exposes MongoDB-aware tools and resources over Streamable HTTP; queryable models are controlled by the MCP_ALLOWED_MODELS whitelist.

## Best for
- Developers who want to prototype a backend with NestJS, Fastify, Mongoose, and MongoDB.
- Teams that need MCP clients to connect over Streamable HTTP and query allowed models.

## Not for
- Use cases that require a documented guarantee of read-only data access; the README does not state that these tools are read-only.
- Users seeking a hosted MCP service that works without deploying the application or MongoDB.

## Required permissions
- The application needs MongoDB connection configuration; MCP tools can query models listed in MCP_ALLOWED_MODELS, which defaults to Profile.
- Deployment requires environment configuration, including a JWT signing secret and database connection string.

## Risks
- Query tools can access data in allowlisted models; filters and aggregation pipelines may return sensitive document fields.
- The README does not specify authentication or authorization requirements for the MCP endpoint, so verify network exposure and access controls before deployment.
- The model whitelist limits model scope, but does not establish database-level permissions or data redaction behavior.

## Tools (5)
- `list-collections`: Lists the Mongoose models the server is allowed to inspect.
- `count-documents`: Counts documents matching a filter in an allowed model.
- `find-documents`: Queries an allowed model with optional filter and projection; results are capped at 100.
- `aggregate-pipeline`: Runs an aggregation pipeline on an allowed model and appends a limit of 100 results.
- `get-profile`: Looks up a profile by username.
