@frontmcp/nx

中文文档
1.12.2发布于 2026/11/15Apache-2.0TypeScriptCommonJS构建来源已验证近 30 天下载 5231

Nx plugin for FrontMCP — generators and executors for building MCP servers

原始使用文档
文档目录8 节
  1. Install
  2. Usage
  3. Generators
  4. Executors
  5. Docs
  6. Related packages
  7. Contributing
  8. License

@frontmcp/nx

The Nx plugin for FrontMCP. It adds generators that write FrontMCP apps, libraries, deployment shells and component classes, and executors that run the frontmcp CLI as Nx targets. Use it when several servers share code and you want Nx's project graph, caching and affected commands; for a single server, frontmcp create without --nx is simpler.

npm License

Install

Start a new workspace with the plugin:

npx frontmcp create help-desk-platform --nx

Or add it to a workspace you have:

npx nx add @frontmcp/nx

nx 22 or later is a peer dependency. nx add runs the plugin's init generator, which adds @frontmcp/sdk, frontmcp, reflect-metadata, zod and tslib to dependencies and @frontmcp/testing, Jest and SWC (the compiler frontmcp test uses) to devDependencies, and makes the build, build-exec and test executors cacheable in nx.json. If you installed the package with npm install -D @frontmcp/nx instead, run npx nx g @frontmcp/nx:init. Every executor runs the frontmcp CLI in the workspace's node_modules, never npx, so the workspace needs the frontmcp package. Node.js 24 or later.

Usage

npx nx g @frontmcp/nx:app tickets
npx nx g @frontmcp/nx:tool search --project=tickets
npx nx g @frontmcp/nx:resource config --project=tickets
npx nx dev tickets
npx nx build tickets
npx nx serve tickets

The app generator writes a project with build, dev, serve, test, typecheck and inspector targets. No generator adds a class to its app: after nx g @frontmcp/nx:tool, list the tool in the app's @App({ tools }) yourself.

Generators

GeneratorDescription
initPrepare an existing Nx workspace for FrontMCP (dependencies and cacheable executors)
workspaceScaffold a FrontMCP Nx monorepo with apps/, libs/ and servers/ directories
appGenerate a FrontMCP application in apps/
libGenerate a shared library in libs/
serverGenerate a deployment shell in servers/
toolGenerate a @Tool class
resourceGenerate a @Resource or @ResourceTemplate class
promptGenerate a @Prompt class
skillGenerate a @Skill class
skill-dirGenerate a skill directory based on a SKILL.md file
agentGenerate an @Agent class
providerGenerate a @Provider class for dependency injection
pluginGenerate a @Plugin class extending DynamicPlugin
adapterGenerate an @Adapter class extending DynamicAdapter
auth-providerGenerate an @AuthProvider class
flowGenerate a @Flow class extending FlowBase
jobGenerate a @Job class
workflowGenerate a @Workflow class
ui-componentAdd a component to the UI package in ui/components
ui-pageAdd a page to the UI package in ui/pages
ui-shellAdd a shell template to the UI package in ui/shells

Run one with npx nx g @frontmcp/nx:<generator>.

Executors

ExecutorRuns
buildfrontmcp build, for the target you set (node by default)
build-execfrontmcp build --target node
devfrontmcp dev, a development server
servefrontmcp start, a supervised production server
testfrontmcp test, the end-to-end tests
inspectorfrontmcp inspector, the MCP Inspector
deployThe target platform's CLI, for node, vercel, lambda or cloudflare

Use one in project.json as "executor": "@frontmcp/nx:<executor>".

Docs

Contributing

Source: libs/nx-plugin. Issues and pull requests are welcome; see CONTRIBUTING.md.

License

Apache-2.0. See LICENSE.

版本与发布记录

@frontmcp/nx 共发布 100 个版本,首次发布于 2026/02/25;过去 12 个月发布了 100 个版本。最新版本附带 npm provenance 构建来源证明,可追溯到公开的 CI 构建记录。

版本发布日期距今
1.12.2latest2026/11/151 天前
1.12.12026/11/132 天前
1.12.02026/11/114 天前
1.12.0-rc.1rc2026/11/114 天前
1.11.32026/11/106 天前
1.11.22026/11/096 天前

其他发布通道:beta → 1.1.2-beta.1,rc → 1.12.0-rc.1。

关于 @frontmcp/nx 的常见问题

@frontmcp/nx 是什么?

Nx plugin for FrontMCP — generators and executors for building MCP servers

如何安装 @frontmcp/nx?

在项目目录运行 npm install @frontmcp/nx,或使用 pnpm add / yarn add / bun add。它还需要宿主项目提供 peer 依赖:nx(>=22.0.0)。npm 7 及以上与 pnpm 8 及以上默认会自动安装必需的 peer 依赖,Yarn 需要手动安装。

@frontmcp/nx 支持 TypeScript 吗?

支持。包内自带 TypeScript 类型声明(package.json 声明了 types 入口),安装后即可获得类型提示,无需再安装 @types 包。

@frontmcp/nx 支持 ESM 还是 CommonJS?

以 CommonJS 形式发布,可以直接 require();在 ES Module 项目中也可以用 import 引入(Node.js 会把 module.exports 作为默认导出)。

@frontmcp/nx 需要什么版本的 Node.js?

package.json 的 engines 字段要求 Node.js >=24.0.0。版本不符时 npm 默认只给出警告,开启 engine-strict 后会拒绝安装。

@frontmcp/nx 可以商用吗?

@frontmcp/nx 使用 Apache-2.0 许可。宽松许可:允许商业使用、修改和再分发,并附带明确的专利授权;分发时需保留许可与 NOTICE 文件,修改过的文件要注明改动。以上为概括,不构成法律意见,请以许可原文为准。

@frontmcp/nx 的下载量有多少?

根据 npm 官方下载统计,@frontmcp/nx 在 2026/10/16 – 2026/11/14 这 30 天内被下载 5,231 次,日均约 174 次。下载量会把 CI 构建、镜像同步和作为其他包依赖的安装一并计入,适合横向比较热度,不能直接等同于使用人数。

@frontmcp/nx 还在维护吗?

最新版本 1.12.2 发布于 2026/11/15(1 天前);至今共发布 100 个版本,其中过去 12 个月发布了 100 个;首次发布于 2026/02/25。发布频率只是参考信号:功能稳定的工具可能很少需要更新,建议结合源码仓库的 issue 和提交记录判断。