@aws/nx-plugin-mcp 1.0.0-rc.12 → 1.0.0-rc.13

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.
@@ -351,19 +351,58 @@ This command uses `uv run` to execute your Agent using the [Bedrock AgentCore Py
351
351
 
352
352
  ### Chat with Your Agent
353
353
 
354
- The generator configures a `<your-agent-name>-chat` Nx target that depends on `<your-agent-name>-serve-local`. Running it starts the agent locally and drops you into an interactive terminal chat:
354
+ The generator configures a `<your-agent-name>-chat` Nx target that drops you into an interactive terminal chat with your agent.
355
+
356
+ The chat target runs standalone. By default it connects to your locally running agent, so start `<your-agent-name>-serve-local` first (in a separate terminal):
357
+
358
+ <NxCommands commands={['run your-project:agent-serve-local']} />
359
+
360
+ Then, in another terminal, start the chat:
355
361
 
356
362
  <NxCommands commands={['run your-project:agent-chat']} />
357
363
 
358
- For **HTTP** agents, the generator also emits:
364
+ The generator emits a `scripts/<your-agent-name>/chat.ts` for every protocol. It connects to the local agent by default, or to your deployed agent when `RUNTIME_CONFIG_APP_ID` is set (see [Chat with your deployed agent](#chat-with-your-deployed-agent) below).
365
+
366
+ For **HTTP** agents, the chat script uses a type-safe TypeScript client generated from the agent's OpenAPI spec. The generator also emits:
359
367
 
360
368
  - `scripts/<your-agent-name>_openapi.py` — a small script that exports the agent's OpenAPI spec
361
369
  - An `<your-agent-name>-openapi` Nx target that runs it
362
370
  - An `<your-agent-name>-generate-client` Nx target that produces a type-safe TypeScript client under `scripts/<your-agent-name>/generated/`
363
- - `scripts/<your-agent-name>/chat.ts` — a thin wrapper around the generated client
364
371
 
365
372
  When you customize the agent's input shape (e.g. add new fields to `InvokeInput`), update `chat.ts` to pass the new fields when invoking the agent and the rest works automatically.
366
373
 
374
+ <OptionFilter when={{ infra: 'agentcore' }} description="Deployed agent chat details">
375
+ #### Chat with your deployed agent
376
+
377
+ To chat with your agent deployed to Bedrock AgentCore, set the `RUNTIME_CONFIG_APP_ID` environment variable to the AppConfig application id of the deployment (output as `RuntimeConfigApplicationId` by the deployed stack). The chat script resolves your agent's runtime ARN from runtime configuration and connects to the deployed endpoint:
378
+
379
+ <Tabs syncKey="auth">
380
+ <TabItem label="IAM" _filter={{ auth: 'iam' }}>
381
+ For IAM-authenticated agents, requests are signed with [SigV4](https://docs.aws.amazon.com/IAM/latest/UserGuide/reference_sigv.html) using your default AWS credentials. Ensure the environment has AWS credentials with permission to invoke the runtime:
382
+
383
+ <NxCommands commands={['run your-project:agent-chat']} env={{ RUNTIME_CONFIG_APP_ID: '<app-id>' }} />
384
+ </TabItem>
385
+
386
+ <TabItem label="Cognito" _filter={{ auth: 'cognito' }}>
387
+ For Cognito-authenticated agents, provide a Cognito access token via the `AGENT_ACCESS_TOKEN` environment variable, which is sent as a bearer token:
388
+
389
+ <NxCommands commands={['run your-project:agent-chat']} env={{ RUNTIME_CONFIG_APP_ID: '<app-id>', AGENT_ACCESS_TOKEN: '<access-token>' }} />
390
+
391
+ You can obtain an access token using the AWS CLI's `cognito-idp admin-initiate-auth` command, for example:
392
+
393
+ ```bash
394
+ aws cognito-idp admin-initiate-auth \
395
+ --user-pool-id <user-pool-id> \
396
+ --client-id <user-pool-client-id> \
397
+ --auth-flow ADMIN_NO_SRP_AUTH \
398
+ --auth-parameters USERNAME=<username>,PASSWORD=<password> \
399
+ --query 'AuthenticationResult.AccessToken' \
400
+ --output text
401
+ ```
402
+ </TabItem>
403
+ </Tabs>
404
+ </OptionFilter>
405
+
367
406
  <OptionFilter when={{ infra: 'agentcore' }} description="Bedrock AgentCore Runtime deployment details">
368
407
  ## Deploying Your Agent to Bedrock AgentCore Runtime
369
408
 
@@ -269,11 +269,49 @@ This command uses `tsx --watch` to automatically restart the server when files c
269
269
 
270
270
  ### Chat with Your Agent
271
271
 
272
- The generator configures a `<your-agent-name>-chat` Nx target that depends on `<your-agent-name>-serve-local`. Running it starts the agent locally and drops you into an interactive terminal chat:
272
+ The generator configures a `<your-agent-name>-chat` Nx target that drops you into an interactive terminal chat with your agent.
273
+
274
+ The chat target runs standalone. By default it connects to your locally running agent, so start `<your-agent-name>-serve-local` first (in a separate terminal):
275
+
276
+ <NxCommands commands={['run your-project:agent-serve-local']} />
277
+
278
+ Then, in another terminal, start the chat:
273
279
 
274
280
  <NxCommands commands={['run your-project:agent-chat']} />
275
281
 
276
- For **HTTP** (tRPC over WebSocket) agents, the generator also emits a tiny `scripts/<your-agent-name>/chat.ts` that wraps the generated `<Agent>Client.local({ url })` so you can customize it as you evolve the agent's input shape.
282
+ The generator emits a `scripts/<your-agent-name>/chat.ts` for every protocol. You can customize it as you evolve the agent's input shape. It connects to the local agent by default, or to your deployed agent when `RUNTIME_CONFIG_APP_ID` is set (see [Chat with your deployed agent](#chat-with-your-deployed-agent) below).
283
+
284
+ <OptionFilter when={{ infra: 'agentcore' }} description="Deployed agent chat details">
285
+ #### Chat with your deployed agent
286
+
287
+ To chat with your agent deployed to Bedrock AgentCore, set the `RUNTIME_CONFIG_APP_ID` environment variable to the AppConfig application id of the deployment (output as `RuntimeConfigApplicationId` by the deployed stack). The chat script resolves your agent's runtime ARN from runtime configuration and connects to the deployed endpoint:
288
+
289
+ <Tabs syncKey="auth">
290
+ <TabItem label="IAM" _filter={{ auth: 'iam' }}>
291
+ For IAM-authenticated agents, requests are signed with [SigV4](https://docs.aws.amazon.com/IAM/latest/UserGuide/reference_sigv.html) using your default AWS credentials. Ensure the environment has AWS credentials with permission to invoke the runtime:
292
+
293
+ <NxCommands commands={['run your-project:agent-chat']} env={{ RUNTIME_CONFIG_APP_ID: '<app-id>' }} />
294
+ </TabItem>
295
+
296
+ <TabItem label="Cognito" _filter={{ auth: 'cognito' }}>
297
+ For Cognito-authenticated agents, provide a Cognito access token via the `AGENT_ACCESS_TOKEN` environment variable, which is sent as a bearer token:
298
+
299
+ <NxCommands commands={['run your-project:agent-chat']} env={{ RUNTIME_CONFIG_APP_ID: '<app-id>', AGENT_ACCESS_TOKEN: '<access-token>' }} />
300
+
301
+ You can obtain an access token using the AWS CLI's `cognito-idp admin-initiate-auth` command, for example:
302
+
303
+ ```bash
304
+ aws cognito-idp admin-initiate-auth \
305
+ --user-pool-id <user-pool-id> \
306
+ --client-id <user-pool-client-id> \
307
+ --auth-flow ADMIN_NO_SRP_AUTH \
308
+ --auth-parameters USERNAME=<username>,PASSWORD=<password> \
309
+ --query 'AuthenticationResult.AccessToken' \
310
+ --output text
311
+ ```
312
+ </TabItem>
313
+ </Tabs>
314
+ </OptionFilter>
277
315
 
278
316
  <OptionFilter when={{ infra: 'agentcore' }} description="Bedrock AgentCore Runtime deployment details">
279
317
  ## Deploying Your Agent to Bedrock AgentCore Runtime
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@aws/nx-plugin-mcp",
3
- "version": "1.0.0-rc.12",
3
+ "version": "1.0.0-rc.13",
4
4
  "repository": {
5
5
  "type": "git",
6
6
  "url": "https://github.com/awslabs/nx-plugin-for-aws.git",