nest-auth-prisma-mcp
v1.0.0
Published
MCP server to scaffold a cloud-agnostic NestJS JWT auth backend with Prisma. Deployment is intentionally out of scope.
Maintainers
Readme
nest-auth-prisma-mcp
🚀 MCP server to scaffold a cloud-agnostic NestJS JWT auth backend with Prisma.
Built for vibe coders using Claude Code. Stop writing auth boilerplate, ship a production-shaped backend in seconds — then deploy it anywhere with the tool of your choice.
What is this?
An MCP (Model Context Protocol) server that gives Claude Code one focused capability:
- Scaffold a complete NestJS JWT authentication backend with Prisma.
That's it. No deployment. Deployment is intentionally out of scope — pair this MCP with a separate deployment MCP (Cloud Run, ECS, Container Apps, fly.io, etc.), a Skill, or your own CI/CD pipeline.
Why "Prisma-only"?
Earlier versions of this MCP supported an in-memory demo mode and bundled deployment to Google Cloud Run. To keep the surface small and the output reproducible across cloud providers, this version generates a single shape: NestJS + Prisma + PostgreSQL, packaged in a cloud-agnostic Dockerfile.
If you need an in-memory demo, set up a local PostgreSQL with Docker and
point DATABASE_URL at it.
Quick Start
1. Install
npm install -g nest-auth-prisma-mcp2. Configure your project
Create a .env file in your project root:
# Required
DATABASE_URL=postgresql://user:pass@host:5432/database
# Recommended
JWT_SECRET=your-super-secret-key-min-32-chars3. Add to Claude Code
claude mcp add --transport stdio nest-auth-prisma -- npx nest-auth-prisma-mcpOr with a full path:
claude mcp add --transport stdio nest-auth-prisma -- node /path/to/node_modules/nest-auth-prisma-mcp/dist/index.js4. Use it
In Claude Code, just ask:
"Check if I have everything needed to scaffold an auth backend"
"Create a new auth API in ./my-api"
Available Tools
check_prereqs
Verifies your local setup:
- Node.js 18+ installed
DATABASE_URLis set in.envJWT_SECRETis set in.env(recommended)
This tool is cloud-agnostic — no gcloud, aws, or az checks.
init
Scaffolds a complete NestJS auth backend with:
- JWT authentication (
/auth/register,/auth/login,/auth/me) - Health check endpoint (
/health) - Prisma + PostgreSQL (
Usermodel,db push/migrate devready) - Cloud-agnostic multi-stage Dockerfile
- Strict TypeScript configuration
Parameters:
targetDir(required): where to create the projectappName(optional): name forpackage.json(default:nest-auth-api)port(optional): default HTTP port (default:3000)
Configuration
All configuration is read from .env in your current working directory:
| Variable | Required | Description |
|-----------------|----------|-------------------------------------------------|
| DATABASE_URL | Yes | PostgreSQL connection string |
| JWT_SECRET | No | JWT signing secret (a placeholder is used otherwise — unsafe in prod) |
Compatible PostgreSQL providers (anything that speaks Postgres works):
- Neon, Supabase, Railway, Render, Vercel Postgres
- Google Cloud SQL, AWS RDS, Azure Database for PostgreSQL
- Self-hosted PostgreSQL, Docker Compose, etc.
Generated Project — Deployment Notes
The scaffolded project is cloud-agnostic. The provided Dockerfile is a
multi-stage build that produces an image runnable on any container host:
- Google Cloud Run
- AWS ECS, App Runner, Elastic Beanstalk
- Azure Container Apps, Azure App Service
- Fly.io, Render, Railway, DigitalOcean App Platform
- Kubernetes (GKE, EKS, AKS, k3s, …)
The container honours the PORT environment variable, so the hosting
platform can inject its own port.
Prerequisites
- Node.js 18+
- PostgreSQL (any provider) reachable from where you'll run the generated app
That's it. No cloud SDK is required to use this MCP.
Example Workflow
# 1. Create project directory
mkdir my-project && cd my-project
# 2. Create .env
cat > .env << EOF
DATABASE_URL=postgresql://user:[email protected]:5432/postgres
JWT_SECRET=$(openssl rand -hex 32)
EOF
# 3. Open Claude Code
claude
# 4. Ask Claude:
# "Check prereqs, then scaffold an auth API in ./api"
#
# 5. Deployment is then handled by your preferred tool — a separate MCP,
# a Skill, or your own pipeline.Logs
The MCP server logs to stderr (required for STDIO transport).
Troubleshooting
"DATABASE_URL is required"
This MCP only generates a Prisma-backed backend. Set DATABASE_URL in .env
in your current working directory before calling init.
"Directory already exists and is not empty"
Pick a different targetDir, or delete the existing one. The scaffold refuses
to overwrite existing files to protect your work.
Contributing
Issues and PRs welcome.
License
MIT © DjioniDev
