@abgov/nx-adsp 13.31.3 → 13.33.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/README.md CHANGED
@@ -101,8 +101,9 @@ deploy details.
101
101
 
102
102
  ### `init`
103
103
 
104
- Sets up nx-adsp's own workspace-root concerns: registers the ADSP SDK MCP server
105
- (`@abgov/adsp-sdk-mcp-server`) in `.mcp.json`, and shared VS Code settings. Every app/service
104
+ Sets up nx-adsp's own workspace-root concerns: installs the ADSP SDK MCP server
105
+ (`@abgov/adsp-sdk-mcp-server`) as a dev dependency and registers it in `.mcp.json`, and shared
106
+ VS Code settings. Every app/service
106
107
  generator below already runs this as one of its own steps — always run it directly right after
107
108
  installing the plugin, too, so grounded ADSP platform knowledge (tenant/realm/role model,
108
109
  `@abgov/adsp-service-sdk` reference) is available immediately, not only once you've scaffolded
@@ -114,10 +115,22 @@ npx nx g @abgov/nx-adsp:init
114
115
  ```
115
116
 
116
117
  No options. Idempotent — merges into existing `.mcp.json`/`.vscode/settings.json` without
117
- clobbering another server, a customized `adsp-sdk` entry, or unrelated settings; safe to re-run.
118
- Project-scoped MCP servers only load at session start, so reconnect (or restart) your MCP client
119
- after running this before relying on the new tools the generator's own output says so as a
120
- reminder.
118
+ clobbering another server, a customized `adsp-sdk` entry, a version you've pinned yourself, or
119
+ unrelated settings; safe to re-run. Project-scoped MCP servers only load at session start, so
120
+ install dependencies and then reconnect (or restart) your MCP client after running this before
121
+ relying on the new tools — the generator's own output says so as a reminder.
122
+
123
+ The server is a dev dependency rather than an on-demand `npx -y` fetch so that the version your
124
+ agent executes is the one your lockfile resolved and `npm audit` can see — along with its
125
+ transitive dependencies. The `.mcp.json` entry uses `npx --no`, which prefers the local install
126
+ over anything in npm's `_npx` cache, and refuses to reach the registry for a version you haven't
127
+ installed. Plain `npx` would fetch and run one silently, because npm assumes `--yes` whenever
128
+ stdin isn't a TTY, as it never is for a stdio MCP server.
129
+
130
+ One caveat worth knowing: `--no` treats an already-populated `_npx` cache entry as satisfying the
131
+ request, so on a machine that previously ran the `npx -y` form it will use that cached copy rather
132
+ than erroring. Run `npm install` before relying on the pin — with the dependency present, the
133
+ local copy always wins.
121
134
 
122
135
  ---
123
136
 
package/migrations.json CHANGED
@@ -6,6 +6,12 @@
6
6
  "description": "Wrap express-service's generated src/migrate.ts drizzle migrate() call in a Postgres advisory lock, so concurrent init containers serialize instead of racing.",
7
7
  "implementation": "./src/migrations/add-migrate-advisory-lock/add-migrate-advisory-lock",
8
8
  "prompt": "./src/migrations/add-migrate-advisory-lock/add-migrate-advisory-lock.md"
9
+ },
10
+ "pin-adsp-mcp-server": {
11
+ "version": "13.33.0",
12
+ "description": "Pin the adsp-sdk MCP server in .mcp.json to an @abgov/adsp-sdk-mcp-server dev dependency, so the version an agent executes is the one the lockfile resolved rather than whatever npx fetches at session start.",
13
+ "implementation": "./src/migrations/pin-adsp-mcp-server/pin-adsp-mcp-server",
14
+ "prompt": "./src/migrations/pin-adsp-mcp-server/pin-adsp-mcp-server.md"
9
15
  }
10
16
  }
11
17
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@abgov/nx-adsp",
3
- "version": "13.31.3",
3
+ "version": "13.33.0",
4
4
  "license": "Apache-2.0",
5
5
  "main": "src/index.js",
6
6
  "description": "Government of Alberta - Nx plugin for ADSP apps.",
@@ -95,7 +95,7 @@ describe('Express Service Generator', () => {
95
95
  const mcp = readJson(host, '.mcp.json');
96
96
  expect(mcp.mcpServers['adsp-sdk']).toEqual({
97
97
  command: 'npx',
98
- args: ['-y', '@abgov/adsp-sdk-mcp-server'],
98
+ args: ['--no', '@abgov/adsp-sdk-mcp-server'],
99
99
  });
100
100
  // Agents are pointed at the tools, not left to guess the SDK.
101
101
  const agents = host.read('apps/test/AGENTS.md').toString();
@@ -1,2 +1,2 @@
1
1
  import { Tree } from '@nx/devkit';
2
- export default function (host: Tree): Promise<void>;
2
+ export default function (host: Tree): Promise<() => void>;
@@ -4,6 +4,7 @@ exports.default = default_1;
4
4
  const tslib_1 = require("tslib");
5
5
  const devkit_1 = require("@nx/devkit");
6
6
  const quality_1 = require("../../utils/quality");
7
+ const mcp_1 = require("../../utils/mcp");
7
8
  // express-service writes CLIENT_SECRET, DATABASE_URL, and MONGODB_URI to
8
9
  // .env.local — these must be gitignored before any generator run can commit.
9
10
  // Idempotent: no-op if the patterns are already present.
@@ -33,9 +34,15 @@ function ensureEnvLocalGitignored(host) {
33
34
  function default_1(host) {
34
35
  return tslib_1.__awaiter(this, void 0, void 0, function* () {
35
36
  ensureEnvLocalGitignored(host);
36
- (0, quality_1.addAdspMcpServer)(host);
37
+ (0, mcp_1.addAdspMcpServer)(host);
37
38
  (0, quality_1.addVsCodeSettings)(host);
38
39
  yield (0, devkit_1.formatFiles)(host);
40
+ // addAdspMcpServer adds a dev dependency, so standalone runs need the install.
41
+ // App/service generators discard this and return their own install task —
42
+ // same package.json in the same Tree, so the dependency still lands.
43
+ return () => {
44
+ (0, devkit_1.installPackagesTask)(host);
45
+ };
39
46
  });
40
47
  }
41
48
  //# sourceMappingURL=init.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"init.js","sourceRoot":"","sources":["../../../../../../packages/nx-adsp/src/generators/init/init.ts"],"names":[],"mappings":";;AAmCA,4BAKC;;AAxCD,uCAA+C;AAC/C,iDAA0E;AAE1E,yEAAyE;AACzE,6EAA6E;AAC7E,yDAAyD;AACzD,MAAM,4BAA4B,GAAG,CAAC,YAAY,EAAE,cAAc,CAAC,CAAC;AAEpE,SAAS,wBAAwB,CAAC,IAAU;IAC1C,MAAM,IAAI,GAAG,YAAY,CAAC;IAC1B,IAAI,CAAC,IAAI,CAAC,MAAM,CAAC,IAAI,CAAC,EAAE,CAAC;QACvB,IAAI,CAAC,KAAK,CAAC,IAAI,EAAE,GAAG,4BAA4B,CAAC,IAAI,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC;QACjE,OAAO;IACT,CAAC;IACD,MA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E;QAC1E,qEAAqE;QACrE,OAAO,GAAG,EAAE;YACV,IAAA,4BAAmB,EAAC,IAAI,CAAC,CAAC;QAC5B,CAAC,CAAC;IACJ,CAAC;CAAA"}
@@ -16,7 +16,7 @@ describe('nx-adsp init generator', () => {
16
16
  const mcp = readJson(host, '.mcp.json');
17
17
  expect(mcp.mcpServers['adsp-sdk']).toEqual({
18
18
  command: 'npx',
19
- args: ['-y', '@abgov/adsp-sdk-mcp-server'],
19
+ args: ['--no', '@abgov/adsp-sdk-mcp-server'],
20
20
  });
21
21
  });
22
22
 
@@ -38,6 +38,32 @@ describe('nx-adsp init generator', () => {
38
38
  });
39
39
  });
40
40
 
41
+ it('adds the MCP server as a dev dependency, so the lockfile pins what runs', async () => {
42
+ await generator(host);
43
+
44
+ const packageJson = readJson(host, 'package.json');
45
+ expect(
46
+ packageJson.devDependencies['@abgov/adsp-sdk-mcp-server'],
47
+ ).toBeDefined();
48
+ expect(
49
+ packageJson.dependencies?.['@abgov/adsp-sdk-mcp-server'],
50
+ ).toBeUndefined();
51
+ });
52
+
53
+ it('does not bump a version a team has already pinned', async () => {
54
+ writeJson(host, 'package.json', {
55
+ name: 'test-workspace',
56
+ devDependencies: { '@abgov/adsp-sdk-mcp-server': '1.11.0' },
57
+ });
58
+
59
+ await generator(host);
60
+
61
+ const packageJson = readJson(host, 'package.json');
62
+ expect(packageJson.devDependencies['@abgov/adsp-sdk-mcp-server']).toBe(
63
+ '1.11.0',
64
+ );
65
+ });
66
+
41
67
  it('reminds that a session reconnect is needed before the MCP server is usable', async () => {
42
68
  const logSpy = jest.spyOn(console, 'log').mockImplementation();
43
69
 
@@ -2,7 +2,7 @@
2
2
  "$schema": "http://json-schema.org/schema",
3
3
  "id": "NxAdspInit",
4
4
  "title": "nx-adsp workspace setup",
5
- "description": "Sets up nx-adsp's own workspace-root concerns: registers the @abgov/adsp-sdk-mcp-server MCP server in .mcp.json, and shared VS Code settings. Run once per workspace, right after installing @abgov/nx-adsp — every app/service generator (express-service, react-app, angular-app, vue-app) already calls this as one of its own steps, but running it standalone lets grounded ADSP platform knowledge be available before any app exists, e.g. during a design pass. Idempotent — safe to re-run, never clobbers a customized entry.",
5
+ "description": "Sets up nx-adsp's own workspace-root concerns: installs the @abgov/adsp-sdk-mcp-server MCP server as a dev dependency and registers it in .mcp.json, and shared VS Code settings. Run once per workspace, right after installing @abgov/nx-adsp — every app/service generator (express-service, react-app, angular-app, vue-app) already calls this as one of its own steps, but running it standalone lets grounded ADSP platform knowledge be available before any app exists, e.g. during a design pass. Idempotent — safe to re-run, never clobbers a customized entry or a version you've pinned yourself.",
6
6
  "type": "object",
7
7
  "properties": {},
8
8
  "required": [],
@@ -0,0 +1,7 @@
1
+ import { Tree } from '@nx/devkit';
2
+ interface MigrationReport {
3
+ nextSteps: string[];
4
+ agentContext?: string[];
5
+ }
6
+ export default function pinAdspMcpServer(tree: Tree): Promise<MigrationReport | undefined>;
7
+ export {};
@@ -0,0 +1,93 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.default = pinAdspMcpServer;
4
+ const tslib_1 = require("tslib");
5
+ const devkit_1 = require("@nx/devkit");
6
+ const MCP_PATH = '.mcp.json';
7
+ const SERVER_KEY = 'adsp-sdk';
8
+ const PACKAGE = '@abgov/adsp-sdk-mcp-server';
9
+ // The version this migration pins to, and the entry it knows how to rewrite,
10
+ // are both frozen literals rather than imports from utils/quality.ts. A
11
+ // released migration has to keep applying the same change forever, so reading
12
+ // the live value would let a later edit there silently change what this
13
+ // migration does to an old workspace.
14
+ const PINNED_VERSION = '^1.12.1';
15
+ const PRIOR_ENTRY = { command: 'npx', args: ['-y', PACKAGE] };
16
+ const PINNED_ENTRY = { command: 'npx', args: ['--no', PACKAGE] };
17
+ // Only ever compared against the two-key entry this generator emits, so key
18
+ // order is the sole structural difference JSON.stringify can't see — and
19
+ // `args` is the one field whose order is meaningful.
20
+ function isEntry(value, expected) {
21
+ if (typeof value !== 'object' || value === null)
22
+ return false;
23
+ const keys = Object.keys(value);
24
+ if (keys.length !== Object.keys(expected).length)
25
+ return false;
26
+ return keys.every((key) => JSON.stringify(value[key]) ===
27
+ JSON.stringify(expected[key]));
28
+ }
29
+ function pinAdspMcpServer(tree) {
30
+ return tslib_1.__awaiter(this, void 0, void 0, function* () {
31
+ var _a, _b, _c;
32
+ // No .mcp.json, or no entry in it, means nx-adsp's init never ran here —
33
+ // there's no server to pin, and adding the dependency would be noise.
34
+ if (!tree.exists(MCP_PATH)) {
35
+ return undefined;
36
+ }
37
+ let entry;
38
+ try {
39
+ entry = (_c = (_b = JSON.parse((_a = tree.read(MCP_PATH, 'utf-8')) !== null && _a !== void 0 ? _a : '{}')) === null || _b === void 0 ? void 0 : _b.mcpServers) === null || _c === void 0 ? void 0 : _c[SERVER_KEY];
40
+ }
41
+ catch (_d) {
42
+ devkit_1.logger.warn(`[nx-adsp] ${MCP_PATH} is not valid JSON — left untouched. Re-run ` +
43
+ `\`nx g @abgov/nx-adsp:init\` once it parses.`);
44
+ return undefined;
45
+ }
46
+ if (entry === undefined) {
47
+ return undefined;
48
+ }
49
+ // Already pinned, by a newer generator or a previous run of this migration.
50
+ // Still ensure the dependency is present: the entry is only a real pin if
51
+ // there's a local install for `--no` to resolve.
52
+ const alreadyPinned = isEntry(entry, PINNED_ENTRY);
53
+ if (!alreadyPinned && !isEntry(entry, PRIOR_ENTRY)) {
54
+ devkit_1.logger.warn(`[nx-adsp] ${MCP_PATH}'s "${SERVER_KEY}" server is customised — left ` +
55
+ `untouched rather than rewritten.`);
56
+ return {
57
+ nextSteps: [
58
+ `${MCP_PATH}'s "${SERVER_KEY}" entry differs from the generated one, so it was ` +
59
+ `left as-is. If it still runs \`npx\` without \`--no\`, the version your agent ` +
60
+ `executes is whatever the registry resolves at session start — outside your ` +
61
+ `lockfile and invisible to \`npm audit\`. To pin it, add ${PACKAGE} to ` +
62
+ `devDependencies and change the entry's args to ` +
63
+ `${JSON.stringify(PINNED_ENTRY.args)}, keeping whatever else you've customised. ` +
64
+ `An entry deliberately pointing at a local build needs no change.`,
65
+ ],
66
+ agentContext: [
67
+ `${MCP_PATH} has a customised "${SERVER_KEY}" MCP server entry that this migration ` +
68
+ `did not rewrite. Read it, and unless it points at a local build, pin it: add ` +
69
+ `${PACKAGE} to devDependencies and set the entry's args to ` +
70
+ `${JSON.stringify(PINNED_ENTRY.args)}. Preserve any other customisation.`,
71
+ ],
72
+ };
73
+ }
74
+ (0, devkit_1.addDependenciesToPackageJson)(tree, {}, { [PACKAGE]: PINNED_VERSION }, 'package.json',
75
+ // Respect a version the workspace already chose.
76
+ true);
77
+ if (!alreadyPinned) {
78
+ (0, devkit_1.updateJson)(tree, MCP_PATH, (json) => (Object.assign(Object.assign({}, json), { mcpServers: Object.assign(Object.assign({}, json.mcpServers), { [SERVER_KEY]: PINNED_ENTRY }) })));
79
+ }
80
+ yield (0, devkit_1.formatFiles)(tree);
81
+ devkit_1.logger.info(`[nx-adsp] Pinned the ${SERVER_KEY} MCP server to a ${PACKAGE} dev dependency.`);
82
+ return {
83
+ nextSteps: [
84
+ `Install dependencies, then reconnect (or restart) your MCP client — in that order. ` +
85
+ `\`npx --no\` will fall back to a copy left in npm's _npx cache by the previous ` +
86
+ `\`npx -y\` form, so until the dependency is actually installed you'd still be ` +
87
+ `running an unpinned version. Project-scoped MCP servers also load only at session ` +
88
+ `start, so the entry stays inert until the reconnect.`,
89
+ ],
90
+ };
91
+ });
92
+ }
93
+ //# sourceMappingURL=pin-adsp-mcp-server.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"pin-adsp-mcp-server.js","sourceRoot":"","sources":["../../../../../../packages/nx-adsp/src/migrations/pin-adsp-mcp-server/pin-adsp-mcp-server.ts"],"names":[],"mappings":";;AAkDA,mCAqFC;;AAvID,uCAMoB;AAEpB,MAAM,QAAQ,GAAG,WAAW,CAAC;AAC7B,MAAM,UAAU,GAAG,UAAU,CAAC;AAC9B,MAAM,OAAO,GAAG,4BAA4B,CAAC;A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E,CAAC,iCAChC,IAAI,KACP,UAAU,kCAAO,IAAI,CAAC,UAAU,KAAE,CAAC,UAAU,CAAC,EAAE,YAAY,OAC5D,CAAC,CAAC;QACN,CAAC;QAED,MAAM,IAAA,oBAAW,EAAC,IAAI,CAAC,CAAC;QACxB,eAAM,CAAC,IAAI,CACT,wBAAwB,UAAU,oBAAoB,OAAO,kBAAkB,CAChF,CAAC;QAEF,OAAO;YACL,SAAS,EAAE;gBACT,qFAAqF;oBACnF,iFAAiF;oBACjF,gFAAgF;oBAChF,oFAAoF;oBACpF,sDAAsD;aACzD;SACF,CAAC;IACJ,CAAC;CAAA"}
@@ -0,0 +1,36 @@
1
+ # Pin the ADSP SDK MCP server
2
+
3
+ The codemod half of this migration has already run. It rewrote the workspace-root
4
+ `.mcp.json` `adsp-sdk` entry from `npx -y @abgov/adsp-sdk-mcp-server` to
5
+ `npx --no @abgov/adsp-sdk-mcp-server` and added `@abgov/adsp-sdk-mcp-server` to
6
+ `devDependencies` — **unless** the entry had been customised, in which case it warned and
7
+ left it alone. Your job is only the customised case.
8
+
9
+ ## Why the change
10
+
11
+ npm assumes `--yes` whenever stdin isn't a TTY, which is always true for a stdio MCP
12
+ server. So the old `npx -y` form fetched and executed whatever the registry resolved at
13
+ session start — the server _and_ its transitive dependencies
14
+ (`@modelcontextprotocol/sdk`, `zod`, `@abgov/adsp-cli`), outside the lockfile and
15
+ invisible to `npm audit`. `--no` resolves the local install instead and fails loudly if
16
+ it's missing, so the version your agent executes is the one your lockfile pinned.
17
+
18
+ ## What to do
19
+
20
+ Check `agentContext` for the entry that was skipped. If there is none, there is nothing
21
+ to do — stop here and say so.
22
+
23
+ Otherwise, read the `adsp-sdk` entry in `.mcp.json` and decide:
24
+
25
+ - **It points at a local build** (e.g. `node /path/to/main.js`) — deliberate. Leave it,
26
+ and say why you left it.
27
+ - **It runs `npx` in any other form** — pin it. Add
28
+ `@abgov/adsp-sdk-mcp-server` to `devDependencies` (use the version already named in the
29
+ entry's args if there is one, otherwise `^1.12.1`), then set the entry's `args` to
30
+ `["--no", "@abgov/adsp-sdk-mcp-server"]`. Preserve every other field on the entry, and
31
+ every other server in the file.
32
+
33
+ Do not touch any other `mcpServers` entry — they belong to other plugins or to the team.
34
+
35
+ Finish by telling the user to install dependencies and then reconnect their MCP client,
36
+ since a project-scoped server loads only at session start.
@@ -0,0 +1,134 @@
1
+ import { readJson, Tree, writeJson } from '@nx/devkit';
2
+ import { createTreeWithEmptyWorkspace } from '@nx/devkit/testing';
3
+ import migration from './pin-adsp-mcp-server';
4
+
5
+ const PACKAGE = '@abgov/adsp-sdk-mcp-server';
6
+
7
+ describe('pin-adsp-mcp-server migration', () => {
8
+ let tree: Tree;
9
+
10
+ beforeEach(() => {
11
+ tree = createTreeWithEmptyWorkspace({ layout: 'apps-libs' });
12
+ });
13
+
14
+ function writeMcpJson(entry: unknown, others: Record<string, unknown> = {}) {
15
+ writeJson(tree, '.mcp.json', {
16
+ mcpServers: { ...others, 'adsp-sdk': entry },
17
+ });
18
+ }
19
+
20
+ it('rewrites the fetching entry to the pinned form and adds the dev dependency', async () => {
21
+ writeMcpJson({ command: 'npx', args: ['-y', PACKAGE] });
22
+
23
+ await migration(tree);
24
+
25
+ expect(readJson(tree, '.mcp.json').mcpServers['adsp-sdk']).toEqual({
26
+ command: 'npx',
27
+ args: ['--no', PACKAGE],
28
+ });
29
+ expect(
30
+ readJson(tree, 'package.json').devDependencies[PACKAGE],
31
+ ).toBeDefined();
32
+ });
33
+
34
+ it('leaves other MCP servers alone', async () => {
35
+ writeMcpJson(
36
+ { command: 'npx', args: ['-y', PACKAGE] },
37
+ { other: { command: 'other-cmd', args: ['-y', 'something'] } },
38
+ );
39
+
40
+ await migration(tree);
41
+
42
+ expect(readJson(tree, '.mcp.json').mcpServers.other).toEqual({
43
+ command: 'other-cmd',
44
+ args: ['-y', 'something'],
45
+ });
46
+ });
47
+
48
+ it('is idempotent, and backfills the dependency for an already-pinned entry', async () => {
49
+ writeMcpJson({ command: 'npx', args: ['--no', PACKAGE] });
50
+
51
+ await migration(tree);
52
+
53
+ expect(readJson(tree, '.mcp.json').mcpServers['adsp-sdk']).toEqual({
54
+ command: 'npx',
55
+ args: ['--no', PACKAGE],
56
+ });
57
+ expect(
58
+ readJson(tree, 'package.json').devDependencies[PACKAGE],
59
+ ).toBeDefined();
60
+ });
61
+
62
+ it('does not bump a version the workspace already chose', async () => {
63
+ writeJson(tree, 'package.json', {
64
+ name: 'test-workspace',
65
+ devDependencies: { [PACKAGE]: '1.11.0' },
66
+ });
67
+ writeMcpJson({ command: 'npx', args: ['-y', PACKAGE] });
68
+
69
+ await migration(tree);
70
+
71
+ expect(readJson(tree, 'package.json').devDependencies[PACKAGE]).toBe(
72
+ '1.11.0',
73
+ );
74
+ });
75
+
76
+ it('warns and skips a customised entry rather than rewriting it', async () => {
77
+ const custom = { command: 'node', args: ['/local/build/main.js'] };
78
+ writeMcpJson(custom);
79
+
80
+ const report = await migration(tree);
81
+
82
+ expect(readJson(tree, '.mcp.json').mcpServers['adsp-sdk']).toEqual(custom);
83
+ expect(
84
+ readJson(tree, 'package.json').devDependencies?.[PACKAGE],
85
+ ).toBeUndefined();
86
+ expect(report?.nextSteps.join('\n')).toContain('.mcp.json');
87
+ expect(report?.agentContext?.join('\n')).toContain('customised');
88
+ });
89
+
90
+ it('skips an entry that pins a version in args, since that is not the generated form', async () => {
91
+ const pinnedInArgs = { command: 'npx', args: ['-y', `${PACKAGE}@1.11.0`] };
92
+ writeMcpJson(pinnedInArgs);
93
+
94
+ const report = await migration(tree);
95
+
96
+ expect(readJson(tree, '.mcp.json').mcpServers['adsp-sdk']).toEqual(
97
+ pinnedInArgs,
98
+ );
99
+ expect(report?.nextSteps).toHaveLength(1);
100
+ });
101
+
102
+ it('does nothing when the workspace has no .mcp.json', async () => {
103
+ const report = await migration(tree);
104
+
105
+ expect(report).toBeUndefined();
106
+ expect(
107
+ readJson(tree, 'package.json').devDependencies?.[PACKAGE],
108
+ ).toBeUndefined();
109
+ });
110
+
111
+ it('does nothing when .mcp.json has no adsp-sdk server', async () => {
112
+ writeJson(tree, '.mcp.json', {
113
+ mcpServers: { other: { command: 'other-cmd', args: [] } },
114
+ });
115
+
116
+ const report = await migration(tree);
117
+
118
+ expect(report).toBeUndefined();
119
+ expect(
120
+ readJson(tree, 'package.json').devDependencies?.[PACKAGE],
121
+ ).toBeUndefined();
122
+ });
123
+
124
+ it('warns and leaves an unparseable .mcp.json untouched', async () => {
125
+ tree.write('.mcp.json', '{ not json');
126
+ const warn = jest.spyOn(console, 'warn').mockImplementation();
127
+
128
+ const report = await migration(tree);
129
+
130
+ expect(report).toBeUndefined();
131
+ expect(tree.read('.mcp.json', 'utf-8')).toBe('{ not json');
132
+ warn.mockRestore();
133
+ });
134
+ });
@@ -0,0 +1,25 @@
1
+ import { Tree } from '@nx/devkit';
2
+ /**
3
+ * Registers the @abgov/adsp-sdk-mcp-server MCP server in the workspace-root
4
+ * `.mcp.json` so a coding agent (Claude Code and other MCP clients) can look up
5
+ * grounded ADSP docs and `@abgov/adsp-service-sdk` reference instead of guessing.
6
+ *
7
+ * It's a stdio knowledge server (no credentials), but wiring is not just config:
8
+ * it's also a dev dependency, so the version the client executes is the one the
9
+ * lockfile resolved and `npm audit` can see. `--no` is what makes that binding
10
+ * real — npm assumes `--yes` when stdin isn't a TTY, which is always the case for
11
+ * a stdio MCP server, so without it a resolution miss would silently fetch from
12
+ * the registry instead of failing. Merges into an existing `.mcp.json` and never
13
+ * clobbers a user-customized `adsp-sdk` entry (or a pinned version), so it's safe
14
+ * to re-run and to run for every generated service.
15
+ *
16
+ * The caller is responsible for the install task; every app/service generator
17
+ * already returns one for its own dependencies, and `init` returns one for this.
18
+ *
19
+ * The reconnect reminder lives here, not in each caller — project-scoped MCP
20
+ * servers load at session start, so a file write mid-session (whether from
21
+ * an app/service generator or the standalone `init` generator) leaves the
22
+ * entry configured but inert until the client reconnects, and every caller
23
+ * needs to say so, not just one.
24
+ */
25
+ export declare function addAdspMcpServer(host: Tree): void;
@@ -0,0 +1,64 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.addAdspMcpServer = addAdspMcpServer;
4
+ const devkit_1 = require("@nx/devkit");
5
+ // Pinned rather than floating: `npx` resolves a bare package name against the
6
+ // local project, so the lockfile entry this produces is what pins the server
7
+ // and its whole transitive closure (@modelcontextprotocol/sdk, zod,
8
+ // @abgov/adsp-cli) — none of which `npm audit` can see when the server is
9
+ // fetched on demand instead. Bumping it for already-scaffolded workspaces
10
+ // needs a migration; consuming workspaces on Dependabot/Renovate get a
11
+ // reviewable PR instead of silent per-machine version drift.
12
+ const ADSP_MCP_SERVER_VERSION = '^1.12.1';
13
+ /**
14
+ * Registers the @abgov/adsp-sdk-mcp-server MCP server in the workspace-root
15
+ * `.mcp.json` so a coding agent (Claude Code and other MCP clients) can look up
16
+ * grounded ADSP docs and `@abgov/adsp-service-sdk` reference instead of guessing.
17
+ *
18
+ * It's a stdio knowledge server (no credentials), but wiring is not just config:
19
+ * it's also a dev dependency, so the version the client executes is the one the
20
+ * lockfile resolved and `npm audit` can see. `--no` is what makes that binding
21
+ * real — npm assumes `--yes` when stdin isn't a TTY, which is always the case for
22
+ * a stdio MCP server, so without it a resolution miss would silently fetch from
23
+ * the registry instead of failing. Merges into an existing `.mcp.json` and never
24
+ * clobbers a user-customized `adsp-sdk` entry (or a pinned version), so it's safe
25
+ * to re-run and to run for every generated service.
26
+ *
27
+ * The caller is responsible for the install task; every app/service generator
28
+ * already returns one for its own dependencies, and `init` returns one for this.
29
+ *
30
+ * The reconnect reminder lives here, not in each caller — project-scoped MCP
31
+ * servers load at session start, so a file write mid-session (whether from
32
+ * an app/service generator or the standalone `init` generator) leaves the
33
+ * entry configured but inert until the client reconnects, and every caller
34
+ * needs to say so, not just one.
35
+ */
36
+ function addAdspMcpServer(host) {
37
+ const mcpPath = '.mcp.json';
38
+ const server = {
39
+ command: 'npx',
40
+ args: ['--no', '@abgov/adsp-sdk-mcp-server'],
41
+ };
42
+ (0, devkit_1.addDependenciesToPackageJson)(host, {}, { '@abgov/adsp-sdk-mcp-server': ADSP_MCP_SERVER_VERSION }, 'package.json',
43
+ // A team may have pinned their own version; don't bump it out from under them.
44
+ true);
45
+ if (host.exists(mcpPath)) {
46
+ (0, devkit_1.updateJson)(host, mcpPath, (existing) => {
47
+ var _a, _b;
48
+ const mcpServers = Object.assign({}, ((_a = existing === null || existing === void 0 ? void 0 : existing.mcpServers) !== null && _a !== void 0 ? _a : {}));
49
+ // Preserve an existing entry (a team may have pinned a version or repointed
50
+ // it at a local build) — only add ours when it isn't already configured.
51
+ mcpServers['adsp-sdk'] = (_b = mcpServers['adsp-sdk']) !== null && _b !== void 0 ? _b : server;
52
+ return Object.assign(Object.assign({}, existing), { mcpServers });
53
+ });
54
+ }
55
+ else {
56
+ (0, devkit_1.writeJson)(host, mcpPath, { mcpServers: { 'adsp-sdk': server } });
57
+ }
58
+ console.log('\n✓ .mcp.json configures the ADSP SDK MCP server (adsp-sdk), pinned to the\n' +
59
+ ' @abgov/adsp-sdk-mcp-server dev dependency.\n' +
60
+ ' Project-scoped MCP servers load at session start, not on a mid-session file\n' +
61
+ ' change — install dependencies, then reconnect (or restart) your MCP client\n' +
62
+ ' before relying on it.\n');
63
+ }
64
+ //# sourceMappingURL=mcp.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"mcp.js","sourceRoot":"","sources":["../../../../../packages/nx-adsp/src/utils/mcp.ts"],"names":[],"mappings":";;AAuCA,4CAmCC;AA1ED,uCAKoB;AAEpB,8EAA8E;AAC9E,6EAA6E;AAC7E,oEAAoE;AACpE,0EAA0E;AAC1E,0EAA0E;AAC1E,uEAAuE;AACvE,6DAA6D;AAC7D,MAAM,uBAAuB,GAAG,SAAS,CAAC;AAE1C;;;;;;;;;;;;;;;;;;;;;;GAsBG;AACH,SAAgB,gBAAgB,CAAC,IAAU;IACzC,MAAM,OAAO,GAAG,WAAW,CAAC;IAC5B,MAAM,MAAM,GAAG;QACb,OAAO,EAAE,KAAK;QACd,IAAI,EAAE,CAAC,MAAM,EAAE,4BAA4B,CAAC;KAC7C,CAAC;IAEF,IAAA,qCAA4B,EAC1B,IAAI,EACJ,EAAE,EACF,EAAE,4BAA4B,EAAE,uBAAuB,EAAE,EACzD,cAAc;IACd,+EAA+E;IAC/E,IAAI,CACL,CAAC;IAEF,IAAI,IAAI,CAAC,MAAM,CAAC,OAAO,CAAC,EAAE,CAAC;QACzB,IAAA,mBAAU,EAAC,IAAI,EAAE,OAAO,EAAE,CAAC,QAAQ,EAAE,EAAE;;YACrC,MAAM,UAAU,qBAAQ,CAAC,MAAA,QAAQ,aAAR,QAAQ,uBAAR,QAAQ,CAAE,UAAU,mCAAI,EAAE,CAAC,CAAE,CAAC;YACvD,4EAA4E;YAC5E,yEAAyE;YACzE,UAAU,CAAC,UAAU,CAAC,GAAG,MAAA,UAAU,CAAC,UAAU,CAAC,mCAAI,MAAM,CAAC;YAC1D,uCAAY,QAAQ,KAAE,UAAU,IAAG;QACrC,CAAC,CAAC,CAAC;IACL,CAAC;SAAM,CAAC;QACN,IAAA,kBAAS,EAAC,IAAI,EAAE,OAAO,EAAE,EAAE,UAAU,EAAE,EAAE,UAAU,EAAE,MAAM,EAAE,EAAE,CAAC,CAAC;IACnE,CAAC;IAED,OAAO,CAAC,GAAG,CACT,8EAA8E;QAC5E,gDAAgD;QAChD,iFAAiF;QACjF,gFAAgF;QAChF,2BAA2B,CAC9B,CAAC;AACJ,CAAC"}
@@ -114,19 +114,3 @@ export declare function addAxeAccessibilityCheck(host: Tree, e2eProjectRoot: str
114
114
  */
115
115
  export declare function fixExpressServiceE2eProject(host: Tree, e2eProjectRoot: string, port: number): void;
116
116
  export declare function addVsCodeSettings(host: Tree): void;
117
- /**
118
- * Registers the @abgov/adsp-sdk-mcp-server MCP server in the workspace-root
119
- * `.mcp.json` so a coding agent (Claude Code and other MCP clients) can look up
120
- * grounded ADSP docs and `@abgov/adsp-service-sdk` reference instead of guessing.
121
- *
122
- * It's a stdio knowledge server (no credentials, run via npx), so wiring is just
123
- * config. Merges into an existing `.mcp.json` and never clobbers a user-customized
124
- * `adsp-sdk` entry, so it's safe to re-run and to run for every generated service.
125
- *
126
- * The reconnect reminder lives here, not in each caller — project-scoped MCP
127
- * servers load at session start, so a file write mid-session (whether from
128
- * an app/service generator or the standalone `init` generator) leaves the
129
- * entry configured but inert until the client reconnects, and every caller
130
- * needs to say so, not just one.
131
- */
132
- export declare function addAdspMcpServer(host: Tree): void;
@@ -7,7 +7,6 @@ exports.guardPlaywrightWebServer = guardPlaywrightWebServer;
7
7
  exports.addAxeAccessibilityCheck = addAxeAccessibilityCheck;
8
8
  exports.fixExpressServiceE2eProject = fixExpressServiceE2eProject;
9
9
  exports.addVsCodeSettings = addVsCodeSettings;
10
- exports.addAdspMcpServer = addAdspMcpServer;
11
10
  const devkit_1 = require("@nx/devkit");
12
11
  /**
13
12
  * Rewrites the project-level eslint.config.mjs to add:
@@ -295,39 +294,4 @@ function addVsCodeSettings(host) {
295
294
  (0, devkit_1.writeJson)(host, settingsPath, settings);
296
295
  }
297
296
  }
298
- /**
299
- * Registers the @abgov/adsp-sdk-mcp-server MCP server in the workspace-root
300
- * `.mcp.json` so a coding agent (Claude Code and other MCP clients) can look up
301
- * grounded ADSP docs and `@abgov/adsp-service-sdk` reference instead of guessing.
302
- *
303
- * It's a stdio knowledge server (no credentials, run via npx), so wiring is just
304
- * config. Merges into an existing `.mcp.json` and never clobbers a user-customized
305
- * `adsp-sdk` entry, so it's safe to re-run and to run for every generated service.
306
- *
307
- * The reconnect reminder lives here, not in each caller — project-scoped MCP
308
- * servers load at session start, so a file write mid-session (whether from
309
- * an app/service generator or the standalone `init` generator) leaves the
310
- * entry configured but inert until the client reconnects, and every caller
311
- * needs to say so, not just one.
312
- */
313
- function addAdspMcpServer(host) {
314
- const mcpPath = '.mcp.json';
315
- const server = { command: 'npx', args: ['-y', '@abgov/adsp-sdk-mcp-server'] };
316
- if (host.exists(mcpPath)) {
317
- (0, devkit_1.updateJson)(host, mcpPath, (existing) => {
318
- var _a, _b;
319
- const mcpServers = Object.assign({}, ((_a = existing === null || existing === void 0 ? void 0 : existing.mcpServers) !== null && _a !== void 0 ? _a : {}));
320
- // Preserve an existing entry (a team may have pinned a version or repointed
321
- // it at a local build) — only add ours when it isn't already configured.
322
- mcpServers['adsp-sdk'] = (_b = mcpServers['adsp-sdk']) !== null && _b !== void 0 ? _b : server;
323
- return Object.assign(Object.assign({}, existing), { mcpServers });
324
- });
325
- }
326
- else {
327
- (0, devkit_1.writeJson)(host, mcpPath, { mcpServers: { 'adsp-sdk': server } });
328
- }
329
- console.log('\n✓ .mcp.json configures the ADSP SDK MCP server (adsp-sdk).\n' +
330
- ' Project-scoped MCP servers load at session start, not on a mid-session file\n' +
331
- ' change — reconnect (or restart) your MCP client now before relying on it.\n');
332
- }
333
297
  //# sourceMappingURL=quality.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"quality.js","sourceRoot":"","sources":["../../../../../packages/nx-adsp/src/utils/quality.ts"],"names":[],"mappings":";;AAgBA,sDA0CC;AAiBD,sDAgBC;AAOD,4CAeC;AAoBD,4DAmBC;AAoED,4DAOC;AAuDD,kEA8CC;AAED,8CAkBC;AAiBD,4CAqBC;AAlYD,uCAMoB;AAEpB;;;;;;;GAOG;AACH,SAAgB,qBAAqB,CACnC,IAAU,EACV,WAAmB,EACnB,aAAuB;;IAEvB,MAAM,UAAU,GAAG,GAAG,WAAW,oBAAoB,CAAC;IACtD,IAAI,CAAC,IAAI,CAAC,MAAM,CAAC,UAAU,CAAC;QAAE,OAAO;IAErC,MAAM,QAAQ,GAAG,IAAI,CAAC,IAAI,CAAC,UAAU,CAAC,CAAC,QAAQ,EAAE,CAAC;IAClD,MAAM,eAAe,GAAG,QAAQ,CAAC,KAAK,CACpC,6CAA6C,CAC9C,CAAC;IACF,MAAM,cAAc,GAAG,MAAA,eAAe,aAAf,eAAe,uBAAf,eAAe,CAAG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