loading…
Search for a command to run...
loading…
Enables AI agents to analyze and scaffold React/Next.js applications enforcing Feature-Sliced Design (FSD) conventions, providing tools for project analysis, ru
Enables AI agents to analyze and scaffold React/Next.js applications enforcing Feature-Sliced Design (FSD) conventions, providing tools for project analysis, rule retrieval, and entity generation.
A powerful Orchestration Core that enables AI agents to interact with React applications, enforcing Feature-Sliced Design (FSD) conventions through the Model Context Protocol.
The MCP React Frontend Server is a Model Context Protocol (MCP) implementation designed to act as an Orchestration Core and Architectural Hub for React/Next.js applications. It enforces Feature-Sliced Design (FSD) boundaries, semantic naming conventions, and project-specific constraints. The server interacts with MCP clients (like IDEs or agents) to validate code architecture, prevent structural entropy, and scaffold standardized FSD entities through deterministic rules rather than ephemeral prompts.
analyze_project
files (array of strings): List of file paths to analyze (relative to project root).codeSnippets (array of objects, optional): Objects containing fileName and content for deep linter analysis.status (SUCCESS/ERROR), summary (total errors/warnings), violations array, and recommendations array.FsdAgent and code snippet analysis to LinterAgent. The combined violations are processed by RecommenderAgent to generate actionable fixes.get_rules
{}.RulesProvider.scaffold_entity
name (string): The name of the entity.path (string): The target directory path (relative to src/entities).api/, types/, schema/, converters/, ui/) and boilerplate files including RTK Query services, Zod schemas, data converters, and a public API index.The application is built on top of the Next.js App Router and the @modelcontextprotocol/sdk.
mcp-server.ts: The factory that creates the McpServer instance, registers tools, and bridges MCP SDK with internal logic.Agents:FsdAgent: Responsible for cross-import checking and FSD semantic layer isolation constraints.LinterAgent: Checks AST or string content against naming and structural rules.RecommenderAgent: Generates mitigation steps for detected violations.src/app/api/mcp. Exposes both WebStandardStreamableHTTPServerTransport (standard HTTP) and SSEServerTransport (Server-Sent Events) for different client compatibilities./api/mcp. Next.js routes the request.McpServer. For tool calls, the specific agent (FsdAgent, LinterAgent) is invoked.@modelcontextprotocol/sdk: Core MCP logic.next / react: Driving the API routes and web interface.zod: Schema validation.Clients can connect to this server over HTTP or SSE depending on their MCP transport capabilities.
Add the following to your mcp_config.json manually:
Fastest and most stable for development. Uses the local script directly.
{
"mcpServers": {
"mcp-react-frontend-local": {
"command": "npx",
"args": ["-y", "tsx", "scripts/mcp-stdio.ts"],
"cwd": "D://<path_to_project_root>"
}
}
}
Connects over HTTP to a running server on localhost:3000. Requires mcp-remote.
{
"mcpServers": {
"mcp-react-frontend-http": {
"command": "npx",
"args": ["-y", "mcp-remote", "http://localhost:3000/api/mcp"]
}
}
}
[!IMPORTANT] Initial connection can take up to 60 seconds due to server "warm-up" (cold start).
{
"mcpServers": {
"mcp-react-frontend-remote": {
"command": "npx",
"args": ["-y", "mcp-remote", "https://mcp-react-frontend.vercel.app/api/mcp"]
}
}
}
{
"mcpServers": {
"mcp-react-frontend-remote": {
"command": "npx",
"args": ["-y", "mcp-remote", "https://mcp-react-frontend.onrender.com/api/mcp"]
}
}
}
The MCP server enforces a highly deterministic, strict architectural contract defined in src/entities/rules/config/default-rules.json. The validation scope guarantees structural integrity across the following domains:
1. Feature-Sliced Design (FSD) Topology
app → pages → widgets → features → entities → shared.index.ts) usage.2. Semantic Naming & Typing Contracts
kebab-case for file systems.I for interfaces, T for types, ENUM_ for enums) and DTO backend suffixes (*Backend, -backend.interface.ts).page, layout, etc.) and React hooks (use*) from generic naming constraints.3. Structural Integrity & Boilerplate Constraints
api, types, schema, converters, ui).*.schema.ts, *.converters.ts, *.service.ts).4. Code Quality & Safety (Linter)
console.* usage and any types.enum usage (forcing object/const maps) and mandates strict typing.5. UI & Design Token Constraints
bg-, text-, p-, m-, gap-, flex-, grid-).slate, red, blue, emerald), forcing the application to use semantic CSS variables and design tokens.cn utility wrapper for dynamic class composition.6. Implementation Protocol Validation
injectEndpoints, centralized tags, and base queries.mapToFrontend, mapToBackend) between network boundaries and domain models.i18n localization keys.ErrorBoundary wrappers and withErrorBoundary HOCs on dynamic or volatile UI components.ThemeProvider and useTheme hooks for stable DOM synchronization.NEXT_PUBLIC_APP_URL — Used for resolving the base application URL (defaults to http://localhost:3000).RulesProvider (FSD constraints).# 1. Install dependencies
npm install
# 2. Build the project (includes TypeScript compilation and Next.js build)
npm run build
# 3. Start the application
npm run dev
# Server will be available at http://localhost:3000
Requirements: Node.js 18+ (inferred from Next 14+), npm.
mcpConnectPromise) and instances are cached on the NodeJS global object. This could cause issues or race conditions in serverless deployments if the instance is frozen or repeatedly cold-started.src/entities/ prefix for generating files.*) built into the route handlers by default. Anyone with network access to the API route can call the underlying tools.Run in your terminal:
claude mcp add mcp-react-frontend -- npx Security
Low riskAutomated heuristic from public metadata — not a security guarantee.