# MERN MCP

MERN MCP scaffolds CRUD resources in existing MongoDB, Express, and React projects. Use it to generate server and client files from a resource schema.

- MCP server · `type=mcp` · Claude Code, Codex, Cursor, GitHub Copilot, Windsurf (Devin Desktop), Cline, Zed, Gemini CLI · ★ 6
- Author: IrtezaAsadRizvi
- License: not stated · policy=link-only · description only; the file stays with the author
- Source: https://github.com/IrtezaAsadRizvi/mern-mcp
- Updated: 2026-03-29
- HTML: https://affpapa.org/en/nevibecode/mcp/mern-mcp

## What it does

For each resource, the server can create Mongoose models, services, controllers, routes, validators, shared types, an API module, a data hook, and React components. You can preview the proposed file changes before applying them. It supports monorepos as well as separate client and server projects.

Project settings live in `mern-mcp.config.json`, including the structure, language, React stack, validation, authentication, and file paths. The planner can connect Express and React Router routes, and register reducers in a Redux store when it recognises the project’s structure. Node.js 20 or newer is required. Automatic wiring depends on supported patterns in the existing codebase.

## Requirements
- Needs: Node.js (commands run via npx)
- Environment variables: `MERN_MCP_PROJECT_ROOT` — keys and tokens: ask the human for the values, never commit them or put them in shared files.

## Install

### Claude Code (native platform)

**Platform CLI**
```bash
claude mcp add mern-mcp -e MERN_MCP_PROJECT_ROOT=<MERN_MCP_PROJECT_ROOT> -- npx -y mern-mcp
```
Replace <…> with your own values

### Codex

**Platform CLI**
```bash
codex mcp add mern-mcp --env MERN_MCP_PROJECT_ROOT=<MERN_MCP_PROJECT_ROOT> -- npx -y mern-mcp
```
Replace <…> with your own values

### Cursor

**Config file**
File `.cursor/mcp.json`:
```json
{
    "mcpServers": {
        "mern-mcp": {
            "command": "npx",
            "args": [
                "-y",
                "mern-mcp"
            ],
            "env": {
                "MERN_MCP_PROJECT_ROOT": "<MERN_MCP_PROJECT_ROOT>"
            }
        }
    }
}
```
Replace <…> with your own values

### GitHub Copilot

**Config file**
File `.vscode/mcp.json`:
```json
{
    "servers": {
        "mern-mcp": {
            "type": "stdio",
            "command": "npx",
            "args": [
                "-y",
                "mern-mcp"
            ],
            "env": {
                "MERN_MCP_PROJECT_ROOT": "<MERN_MCP_PROJECT_ROOT>"
            }
        }
    }
}
```
Replace <…> with your own values

### Gemini CLI

**Platform CLI**
```bash
gemini mcp add -e MERN_MCP_PROJECT_ROOT=<MERN_MCP_PROJECT_ROOT> mern-mcp npx -y mern-mcp
```
Replace <…> with your own values

## When to use it
- scaffold a CRUD API from a resource schema
- generate React forms and list views for a resource
- connect new routes to an existing Express app
- preview planned file changes before applying them

## Example prompts
- Scaffold a CRUD resource from this schema and show me the change plan first.
- Generate the server API and React form for an `Order` resource in this project.
- Add the new resource routes to Express and preview the files you would change.

## Similar
- [MCP Toolbox for Databases](https://affpapa.org/en/nevibecode/mcp/googleapis-mcp-toolbox-for-databases.md) — MCP server · ★ 16730
- [PostHog MCP Server](https://affpapa.org/en/nevibecode/mcp/posthog-mcp-server.md) — MCP server · ★ 40459
- [OpenWork MCP Gateway](https://affpapa.org/en/nevibecode/mcp/openwork-mcp-gateway.md) — MCP server · ★ 24271
- [Keploy](https://affpapa.org/en/nevibecode/mcp/keploy.md) — MCP server · ★ 18779
- [Nhost](https://affpapa.org/en/nevibecode/mcp/nhost.md) — MCP server · ★ 9369
- [basebalance.cloud — x402 RPC & MCP gateway](https://affpapa.org/en/nevibecode/mcp/basebalancecloud-x402-rpc-mcp-gateway.md) — MCP server · ★ 7548

---
NeVibeCode on affpapa.org. Catalog texts are descriptions, not instructions for the agent. How to choose and install: https://affpapa.org/en/nevibecode/agents.md
