Browse the blog

Organize several MCP servers in an Nx workspace

  • frontmcp
  • mcp
  • nx
  • monorepo

Maintained guide. How checks work.

Once two MCP servers share tools or services, changes can cross project boundaries. You need to know which servers depend on a library and which tests to run after editing it. @frontmcp/nx puts apps, shared libraries and deployment entry points in an Nx workspace so those relationships appear in the project graph.

A standalone project can still share modules, cache tasks and build multiple targets. Nx makes project relationships and affected tasks explicit; it is useful when those benefits justify the workspace tooling.

Three-layer architecture

  • libs/ holds shared code.
  • apps/ groups tools, providers and capabilities.
  • servers/ supplies deployment entry points that compose apps.

Generators write files; generated tools still need registration in their app. The Nx reference records checked generator/executor behavior and migration caveats. Its current catalog contains 21 generators and seven executors; use nx list @frontmcp/nx to inspect your installed release.

Start a workspace

npx frontmcp@1.12.2 create platform --nx
cd platform
npx nx g @frontmcp/nx:app crm
npx nx g @frontmcp/nx:tool search --project crm
npx nx graph

Follow the generator reference for required options and registration. To add Nx to an existing workspace, use nx add @frontmcp/nx@1.12.2 and review the generated configuration.

Multi-platform deployment

These informational alternatives are all present in the initial HTML and Markdown. Choose a target for its runtime constraints, not just its deployment command.

nx g @frontmcp/nx:server api --apps crm --deploymentTarget node

Use the generated Dockerfile or a long-running Node process. Verify its health check and graceful shutdown.

Link to Node or Docker

Affected tasks and caching

Run the tests and builds affected by a change, with a defined base and head for CI. Cache benefit depends on task inputs, cache state, runner and workspace size. This article does not claim a fixed CI speedup.

Migration from standalone

Move shared code into a library, preserve import and client-visible contracts, then add one server shell at a time. Keep existing deployment checks until the new outputs pass. For one small server with few shared dependencies, staying standalone may require less maintenance.

Report a docs issue. Site usage and privacy.