Skip to main content
This guide covers proven patterns for organizing FrontMCP projects at scale using the Nx monorepo structure.

Three-Layer Architecture

FrontMCP monorepos follow a three-layer architecture:
Servers never contain business logic — they only compose apps. Apps never contain infrastructure config — they only define capabilities. Libs are reusable across both.

Multi-App Server Composition

Create different servers that compose different app combinations:

Shared Libraries

Generic Libraries

Shared utilities used across multiple apps:

Plugin Libraries

Reusable plugins published as npm packages:

Tool Register Libraries

Multi-tool packages shared across apps:

Dependency Graph

Visualize your workspace dependencies:
Nx tracks which projects depend on which, enabling:
  • Affected commands: nx affected -t test — only test projects affected by your changes
  • Build ordering: nx run-many -t build — builds in correct dependency order
  • Caching: Unchanged projects skip builds entirely

Tagging Convention

Use tags to enforce dependency rules:
Example boundary rules in .eslintrc.json:

Per-Environment Servers

Create environment-specific servers with different configurations:
Each server’s main.ts can customize providers and auth:
servers/production/src/main.ts