@aws/nx-plugin-mcp 1.0.0-rc.45 → 1.0.0-rc.46

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/bin/aws-nx-mcp.js CHANGED
@@ -19758,7 +19758,7 @@ var generators$1 = {
19758
19758
  "factory": "./src/init/generator",
19759
19759
  "schema": "./src/init/schema.json",
19760
19760
  "description": "Configure an existing Nx workspace to use the @aws/nx-plugin",
19761
- "metric": "g57",
19761
+ "metric": "g66",
19762
19762
  "guidePages": ["existing-project"]
19763
19763
  },
19764
19764
  "agentcore-gateway": {
@@ -19778,7 +19778,7 @@ var generators$1 = {
19778
19778
  "factory": "./src/agentcore-gateway/gateway-connection/generator",
19779
19779
  "schema": "./src/agentcore-gateway/gateway-connection/schema.json",
19780
19780
  "description": "Connect an AgentCore Gateway to another AgentCore Gateway",
19781
- "metric": "g52",
19781
+ "metric": "g65",
19782
19782
  "hidden": true
19783
19783
  },
19784
19784
  "connection": {
@@ -19966,7 +19966,7 @@ var generators$1 = {
19966
19966
  "factory": "./src/ts/dcr-proxy/generator",
19967
19967
  "schema": "./src/ts/dcr-proxy/schema.json",
19968
19968
  "description": "Generate an OAuth Dynamic Client Registration (DCR) proxy construct for Cognito-authenticated MCP servers",
19969
- "metric": "g56"
19969
+ "metric": "g67"
19970
19970
  },
19971
19971
  "ts#mcp-server": {
19972
19972
  "factory": "./src/ts/mcp-server/generator",
@@ -19999,7 +19999,7 @@ var generators$1 = {
19999
19999
  "factory": "./src/ts/website/app/generator",
20000
20000
  "schema": "./src/ts/website/app/schema.json",
20001
20001
  "description": "Generates a website application",
20002
- "metric": "g43",
20002
+ "metric": "g60",
20003
20003
  "guidePages": ["website", "react-website"]
20004
20004
  },
20005
20005
  "ts#website#auth": {
@@ -20160,27 +20160,27 @@ var generators$1 = {
20160
20160
  "factory": "./src/ts/dynamodb/generator",
20161
20161
  "schema": "./src/ts/dynamodb/schema.json",
20162
20162
  "description": "Create a TypeScript DynamoDB project",
20163
- "metric": "g43"
20163
+ "metric": "g61"
20164
20164
  },
20165
20165
  "ts#dynamodb#trpc-connection": {
20166
20166
  "factory": "./src/ts/dynamodb/trpc-connection/generator",
20167
20167
  "schema": "./src/ts/dynamodb/trpc-connection/schema.json",
20168
20168
  "description": "Connect a ts#trpc-api project to a ts#dynamodb project",
20169
- "metric": "g44",
20169
+ "metric": "g62",
20170
20170
  "hidden": true
20171
20171
  },
20172
20172
  "ts#dynamodb#smithy-connection": {
20173
20173
  "factory": "./src/ts/dynamodb/smithy-connection/generator",
20174
20174
  "schema": "./src/ts/dynamodb/smithy-connection/schema.json",
20175
20175
  "description": "Connect a Smithy backend to a ts#dynamodb project",
20176
- "metric": "g45",
20176
+ "metric": "g63",
20177
20177
  "hidden": true
20178
20178
  },
20179
20179
  "ts#dynamodb#agent-connection": {
20180
20180
  "factory": "./src/ts/dynamodb/agent-connection/generator",
20181
20181
  "schema": "./src/ts/dynamodb/agent-connection/schema.json",
20182
20182
  "description": "Connect a ts#agent to a ts#dynamodb project",
20183
- "metric": "g46",
20183
+ "metric": "g64",
20184
20184
  "hidden": true
20185
20185
  },
20186
20186
  "ts#dynamodb#mcp-server-connection": {
@@ -308,7 +308,7 @@ To test the generator, we'll link our local Nx Plugin for AWS to an existing cod
308
308
  #### Create a Test Project with a tRPC API
309
309
 
310
310
  :::note[Using Your Own Project]
311
- If you have completed the <Link path="get_started/tutorials/dungeon_game/overview">dungeon adventure tutorial</Link>, or already have another existing Nx workspace which uses a tRPC API, you can skip this step.
311
+ If you have completed the <Link path="get_started/tutorials/dungeon-game/overview">dungeon adventure tutorial</Link>, or already have another existing Nx workspace which uses a tRPC API, you can skip this step.
312
312
  :::
313
313
 
314
314
  In a separate directory, create a new test workspace:
@@ -16,7 +16,7 @@ The `connection` generator wires a <Link path="guides/fastapi">FastAPI</Link> to
16
16
 
17
17
  Before using this generator, ensure you have:
18
18
 
19
- 1. A <Link path="guides/fastapi">`py#fast-api`</Link> project
19
+ 1. A FastAPI project (generated with `py#api --framework=fastapi`), see the <Link path="guides/fastapi">`py#api`</Link> guide
20
20
  2. A <Link path="guides/py-dynamodb">`py#dynamodb`</Link> project
21
21
 
22
22
  ## Usage
@@ -18,7 +18,7 @@ The `connection` generator wires a <Link path="guides/fastapi">FastAPI</Link> to
18
18
 
19
19
  Before using this generator, ensure you have:
20
20
 
21
- 1. A <Link path="guides/fastapi">`py#fast-api`</Link> project
21
+ 1. A FastAPI project (generated with `py#api --framework=fastapi`), see the <Link path="guides/fastapi">`py#api`</Link> guide
22
22
  2. A <Link path="guides/py-rdb">`py#rdb`</Link> project
23
23
 
24
24
  ## Usage
@@ -195,7 +195,7 @@ The user identity module automatically adds the necessary <Link path="guides/rea
195
195
  </Infrastructure>
196
196
 
197
197
  :::caution[Remove localhost callback URLs for production]
198
- The generated User Pool client allows your CloudFront distribution URL as an OAuth callback/logout URL, plus `http://localhost:4200` and `http://localhost:4300` for local development against the deployed pool.
198
+ The generated User Pool client allows your CloudFront distribution URL (and any custom domain names configured on it) as OAuth callback/logout URLs, plus `http://localhost:4200` and `http://localhost:4300` for local development against the deployed pool.
199
199
 
200
200
  It is recommended to **remove the `http://localhost` callback/logout URLs for production stages**, keeping the allowlist limited to your real application origins.
201
201
 
@@ -447,7 +447,7 @@ This sets up:
447
447
  5. Automatic deployment of website files and runtime configuration
448
448
  </Fragment>
449
449
  <Fragment slot="terraform">
450
- To deploy your website, we recommend using the <Link path="guides/terraform-infrastructure">`terraform#project` generator</Link> to create a Terraform project.
450
+ To deploy your website, we recommend using the <Link path="/guides/terraform-project">`terraform#project` generator</Link> to create a Terraform project.
451
451
 
452
452
  You can use the Terraform module generated for you in `packages/common/terraform` to deploy your website.
453
453
 
@@ -28,7 +28,7 @@ MCP clients (such as Claude Code, Kiro CLI or the MCP Inspector) expect to authe
28
28
 
29
29
  ## Generator Output
30
30
 
31
- The generator creates a standalone <Link path="/guides/typescript-project">TypeScript project</Link> containing the Lambda handlers, and infrastructure to deploy them based on your selected `iacProvider`.
31
+ The generator creates a standalone <Link path="/guides/typescript-project">TypeScript project</Link> containing the Lambda handlers, and infrastructure to deploy them based on your selected `iac`.
32
32
 
33
33
  <FileTree>
34
34
 
@@ -79,40 +79,57 @@ If you selected `none` for `infra`, no CDK constructs or Terraform modules are g
79
79
 
80
80
  ### Adding Tools
81
81
 
82
- Tools are functions that the AI assistant can call to perform actions. You can add new tools in the `server.ts` file:
83
-
84
- ```typescript
85
- server.registerTool("toolName", {
86
- description: "tool description",
87
- inputSchema: { param1: z.string(), param2: z.number() } // Input schema using Zod
88
- },
89
- async ({ param1, param2 }) => {
90
- // Tool implementation
91
- return {
92
- content: [{ type: "text", text: "Result" }]
93
- };
94
- }
95
- );
82
+ Tools are functions that the AI assistant can call to perform actions. Each tool lives in its own file under `tools/` that exports a `register<Name>Tool` function, which you then call from `server.ts`. For example, add `tools/my-tool.ts`:
83
+
84
+ ```typescript title="tools/my-tool.ts"
85
+ import { McpServer } from '@modelcontextprotocol/sdk/server/mcp.js';
86
+ import { z } from 'zod';
87
+
88
+ export const registerMyTool = (server: McpServer) => {
89
+ server.registerTool("toolName", {
90
+ description: "tool description",
91
+ inputSchema: { param1: z.string(), param2: z.number() } // Input schema using Zod
92
+ },
93
+ async ({ param1, param2 }) => {
94
+ // Tool implementation
95
+ return {
96
+ content: [{ type: "text", text: "Result" }]
97
+ };
98
+ }
99
+ );
100
+ };
101
+ ```
102
+
103
+ Then register it in `server.ts`:
104
+
105
+ ```typescript title="server.ts"
106
+ import { registerMyTool } from './tools/my-tool.js';
107
+
108
+ registerMyTool(server);
96
109
  ```
97
110
 
98
111
  ### Adding Resources
99
112
 
100
- Resources provide context to the AI assistant. You can add static resources from files or dynamic resources:
113
+ Resources provide context to the AI assistant. Like tools, each resource lives in its own file under `resources/` that exports a `register<Name>Resource` function called from `server.ts`. You can add static resources from files or dynamic resources:
114
+
115
+ ```typescript title="resources/my-resource.ts"
116
+ import { McpServer } from '@modelcontextprotocol/sdk/server/mcp.js';
101
117
 
102
- ```typescript
103
- const exampleContext = 'some context to return';
118
+ export const registerMyResource = (server: McpServer) => {
119
+ const exampleContext = 'some context to return';
104
120
 
105
- server.registerResource('resource-name', 'example://resource', {}, async (uri) => ({
106
- contents: [{ uri: uri.href, text: exampleContext }],
107
- }));
121
+ server.registerResource('resource-name', 'example://resource', {}, async (uri) => ({
122
+ contents: [{ uri: uri.href, text: exampleContext }],
123
+ }));
108
124
 
109
- // Dynamic resource
110
- server.registerResource('dynamic-resource', 'dynamic://resource', {}, async (uri) => {
111
- const data = await fetchSomeData();
112
- return {
113
- contents: [{ uri: uri.href, text: data }],
114
- };
115
- });
125
+ // Dynamic resource
126
+ server.registerResource('dynamic-resource', 'dynamic://resource', {}, async (uri) => {
127
+ const data = await fetchSomeData();
128
+ return {
129
+ contents: [{ uri: uri.href, text: data }],
130
+ };
131
+ });
132
+ };
116
133
  ```
117
134
 
118
135
  ## Configuring with AI Assistants
@@ -55,14 +55,14 @@ The generator will create the following project structure:
55
55
 
56
56
  ### Adding Generators
57
57
 
58
- Once you have your plugin project, you can add generators using the <Link path="/guides/ts-nx-generator">`ts#nx-generator`</Link> generator:
58
+ Once you have your plugin project, you can add generators using the <Link path="/guides/nx-generator">`ts#nx-generator`</Link> generator:
59
59
 
60
60
  <RunGenerator generator="ts#nx-generator" requiredParameters={{ pluginProject: 'your-plugin' }} />
61
61
 
62
62
  This will add a new generator to your plugin.
63
63
 
64
64
  :::tip[Generator Documentation]
65
- Read the <Link path="/guides/ts-nx-generator">`ts#nx-generator` guide</Link> for details about how to implement generators.
65
+ Read the <Link path="/guides/nx-generator">`ts#nx-generator` guide</Link> for details about how to implement generators.
66
66
  :::
67
67
 
68
68
  Make sure to write a detailed `README.md` for your generator, since this is used by the MCP Server's `generator-guide` tool.
@@ -102,10 +102,11 @@ The `env` property tells CDK which AWS account and region to deploy to. `CDK_DEF
102
102
  If you generated with `stageConfig`, the `main.ts` reads account and region from a centralized config file instead, falling back to environment variables when no config is set:
103
103
 
104
104
  ```ts title="src/main.ts (with stageConfig)"
105
- import stagesConfig from ':my-scope/common-infra-config';
105
+ import { resolveStage } from ':my-scope/common-infra-config';
106
106
 
107
- const projectStages = stagesConfig.projects?.['packages/infra']?.stages ?? {};
108
- const sandboxConfig = projectStages['my-app-sandbox'];
107
+ // Looks up the stage under this project (packages/infra), falling back to
108
+ // shared stages. Returns undefined when no config exists for the stage.
109
+ const sandboxConfig = resolveStage('packages/infra', 'my-app-sandbox');
109
110
 
110
111
  new ApplicationStage(app, 'my-app-sandbox', {
111
112
  env: {
@@ -242,7 +243,7 @@ Each stage config includes a required `region` and an optional `account`:
242
243
  The generated `main.ts` reads these values from the config so that CDK synthesis and deployment use the same environment settings:
243
244
 
244
245
  ```ts title="src/main.ts"
245
- const sandboxConfig = projectStages['my-app-sandbox'];
246
+ const sandboxConfig = resolveStage('packages/infra', 'my-app-sandbox');
246
247
  new ApplicationStage(app, 'my-app-sandbox', {
247
248
  env: {
248
249
  account: sandboxConfig?.account ?? process.env.CDK_DEFAULT_ACCOUNT,
package/generators.json CHANGED
@@ -7,7 +7,7 @@
7
7
  "factory": "./src/init/generator",
8
8
  "schema": "./src/init/schema.json",
9
9
  "description": "Configure an existing Nx workspace to use the @aws/nx-plugin",
10
- "metric": "g57",
10
+ "metric": "g66",
11
11
  "guidePages": ["existing-project"]
12
12
  },
13
13
  "agentcore-gateway": {
@@ -27,7 +27,7 @@
27
27
  "factory": "./src/agentcore-gateway/gateway-connection/generator",
28
28
  "schema": "./src/agentcore-gateway/gateway-connection/schema.json",
29
29
  "description": "Connect an AgentCore Gateway to another AgentCore Gateway",
30
- "metric": "g52",
30
+ "metric": "g65",
31
31
  "hidden": true
32
32
  },
33
33
  "connection": {
@@ -215,7 +215,7 @@
215
215
  "factory": "./src/ts/dcr-proxy/generator",
216
216
  "schema": "./src/ts/dcr-proxy/schema.json",
217
217
  "description": "Generate an OAuth Dynamic Client Registration (DCR) proxy construct for Cognito-authenticated MCP servers",
218
- "metric": "g56"
218
+ "metric": "g67"
219
219
  },
220
220
  "ts#mcp-server": {
221
221
  "factory": "./src/ts/mcp-server/generator",
@@ -248,7 +248,7 @@
248
248
  "factory": "./src/ts/website/app/generator",
249
249
  "schema": "./src/ts/website/app/schema.json",
250
250
  "description": "Generates a website application",
251
- "metric": "g43",
251
+ "metric": "g60",
252
252
  "guidePages": ["website", "react-website"]
253
253
  },
254
254
  "ts#website#auth": {
@@ -405,27 +405,27 @@
405
405
  "factory": "./src/ts/dynamodb/generator",
406
406
  "schema": "./src/ts/dynamodb/schema.json",
407
407
  "description": "Create a TypeScript DynamoDB project",
408
- "metric": "g43"
408
+ "metric": "g61"
409
409
  },
410
410
  "ts#dynamodb#trpc-connection": {
411
411
  "factory": "./src/ts/dynamodb/trpc-connection/generator",
412
412
  "schema": "./src/ts/dynamodb/trpc-connection/schema.json",
413
413
  "description": "Connect a ts#trpc-api project to a ts#dynamodb project",
414
- "metric": "g44",
414
+ "metric": "g62",
415
415
  "hidden": true
416
416
  },
417
417
  "ts#dynamodb#smithy-connection": {
418
418
  "factory": "./src/ts/dynamodb/smithy-connection/generator",
419
419
  "schema": "./src/ts/dynamodb/smithy-connection/schema.json",
420
420
  "description": "Connect a Smithy backend to a ts#dynamodb project",
421
- "metric": "g45",
421
+ "metric": "g63",
422
422
  "hidden": true
423
423
  },
424
424
  "ts#dynamodb#agent-connection": {
425
425
  "factory": "./src/ts/dynamodb/agent-connection/generator",
426
426
  "schema": "./src/ts/dynamodb/agent-connection/schema.json",
427
427
  "description": "Connect a ts#agent to a ts#dynamodb project",
428
- "metric": "g46",
428
+ "metric": "g64",
429
429
  "hidden": true
430
430
  },
431
431
  "ts#dynamodb#mcp-server-connection": {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@aws/nx-plugin-mcp",
3
- "version": "1.0.0-rc.45",
3
+ "version": "1.0.0-rc.46",
4
4
  "repository": {
5
5
  "type": "git",
6
6
  "url": "https://github.com/awslabs/nx-plugin-for-aws.git",