MERN MCP — Claude Code MCP server: features and installation
MERN MCP scaffolds CRUD resources in existing MongoDB, Express, and React projects. Use it to generate server and client files from a resource schema.
claude mcp add mern-mcp -e MERN_MCP_PROJECT_ROOT=<MERN_MCP_PROJECT_ROOT> -- npx -y mern-mcpWhat MERN MCP 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.
What it helps with
- 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 for the agent
- Scaffold a CRUD resource from this schema and show me the change plan first.
- Generate the server API and React form for an
Orderresource in this project. - Add the new resource routes to Express and preview the files you would change.
How to install MERN MCP
Platform CLI
claude mcp add mern-mcp -e MERN_MCP_PROJECT_ROOT=<MERN_MCP_PROJECT_ROOT> -- npx -y mern-mcpReplace <…> with your own values
Platform CLI
codex mcp add mern-mcp --env MERN_MCP_PROJECT_ROOT=<MERN_MCP_PROJECT_ROOT> -- npx -y mern-mcpReplace <…> with your own values
Config file
{
"mcpServers": {
"mern-mcp": {
"command": "npx",
"args": [
"-y",
"mern-mcp"
],
"env": {
"MERN_MCP_PROJECT_ROOT": "<MERN_MCP_PROJECT_ROOT>"
}
}
}
}Replace <…> with your own values
Config file
{
"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
Platform CLI
gemini mcp add -e MERN_MCP_PROJECT_ROOT=<MERN_MCP_PROJECT_ROOT> mern-mcp npx -y mern-mcpReplace <…> with your own values
Step by step, with commands for each platform: How to add an MCP server to Claude Code, Codex, Cursor, VS Code, Gemini CLI and more
Questions about MERN MCP
How do I install MERN MCP in Claude Code?
Run claude mcp add mern-mcp -e MERN_MCP_PROJECT_ROOT=<MERN_MCP_PROJECT_ROOT> -- npx -y mern-mcp. Replace the placeholder with the project root path.
What does MERN MCP do?
It scaffolds CRUD resources for MERN projects, generating server-side files for MongoDB and Express alongside React client modules and components. You can review the proposed changes before applying them.
Can I configure separate client and server apps?
Yes. Set structure to separate in mern-mcp.config.json and configure paths for the client and server directories.