@aws/nx-plugin-mcp 1.0.0-rc.0 → 1.0.0-rc.2
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 +22 -17
- package/docs/guides/connection/py-agent-a2a.mdx +1 -1
- package/docs/guides/connection/py-agent-mcp.mdx +1 -1
- package/docs/guides/connection/react-agui.mdx +1 -1
- package/docs/guides/connection/react-py-agent.mdx +1 -1
- package/docs/guides/connection/react-trpc.mdx +1 -1
- package/docs/guides/connection/react-ts-agent.mdx +1 -1
- package/docs/guides/connection/ts-agent-a2a.mdx +1 -1
- package/docs/guides/connection/ts-agent-mcp.mdx +1 -1
- package/docs/guides/fastapi.mdx +8 -8
- package/docs/guides/py-agent.mdx +18 -18
- package/docs/guides/py-mcp-server.mdx +5 -5
- package/docs/guides/python-lambda-function.mdx +4 -4
- package/docs/guides/react-website.mdx +2 -2
- package/docs/guides/trpc.mdx +16 -15
- package/docs/guides/ts-agent.mdx +18 -18
- package/docs/guides/ts-lambda-function.mdx +4 -4
- package/docs/guides/ts-mcp-server.mdx +5 -5
- package/docs/guides/ts-rdb.mdx +3 -3
- package/docs/guides/ts-smithy-api.mdx +6 -5
- package/docs/guides/workspace.mdx +2 -2
- package/docs/snippets/agent/architecture.mdx +4 -4
- package/docs/snippets/agent/bedrock-deployment.mdx +1 -1
- package/docs/snippets/api/api-architecture.mdx +2 -2
- package/docs/snippets/api/type-safe-api-integrations.mdx +2 -2
- package/docs/snippets/lambda-function/deploying-your-function.mdx +2 -2
- package/docs/snippets/mcp/architecture.mdx +4 -4
- package/docs/snippets/mcp/bedrock-deployment.mdx +1 -1
- package/generators.json +10 -5
- package/package.json +1 -1
- package/src/infra/app/schema.json +1 -1
- package/src/preset/schema.json +4 -4
- package/src/py/agent/schema.json +18 -18
- package/src/py/api/schema.json +15 -15
- package/src/py/fast-api/schema.json +15 -15
- package/src/py/lambda-function/schema.json +15 -7
- package/src/py/mcp-server/schema.json +15 -15
- package/src/py/project/schema.json +2 -2
- package/src/smithy/ts/api/schema.json +15 -15
- package/src/trpc/backend/schema.json +15 -15
- package/src/ts/agent/schema.json +18 -18
- package/src/ts/api/schema.json +15 -15
- package/src/ts/lambda-function/schema.json +15 -7
- package/src/ts/mcp-server/schema.json +15 -15
- package/src/ts/rdb/schema.json +13 -13
- package/src/ts/react-website/app/schema.json +13 -13
- package/src/ts/react-website/cognito-auth/schema.json +4 -4
- package/src/ts/website/app/schema.json +21 -13
- package/src/ts/website/auth/schema.json +4 -4
package/bin/aws-nx-mcp.js
CHANGED
|
@@ -19105,7 +19105,8 @@ var generators$1 = {
|
|
|
19105
19105
|
"factory": "./src/py/mcp-server/generator",
|
|
19106
19106
|
"schema": "./src/py/mcp-server/schema.json",
|
|
19107
19107
|
"description": "Generate a Python Model Context Protocol (MCP) server for providing context to Large Language Models",
|
|
19108
|
-
"metric": "g24"
|
|
19108
|
+
"metric": "g24",
|
|
19109
|
+
"guidePages": ["py-mcp-server"]
|
|
19109
19110
|
},
|
|
19110
19111
|
"py#project": {
|
|
19111
19112
|
"factory": "./src/py/project/generator",
|
|
@@ -19118,7 +19119,8 @@ var generators$1 = {
|
|
|
19118
19119
|
"factory": "./src/py/agent/generator",
|
|
19119
19120
|
"schema": "./src/py/agent/schema.json",
|
|
19120
19121
|
"description": "Add an AI Agent to a Python project",
|
|
19121
|
-
"metric": "g25"
|
|
19122
|
+
"metric": "g25",
|
|
19123
|
+
"guidePages": ["py-agent"]
|
|
19122
19124
|
},
|
|
19123
19125
|
"py#agent#mcp-connection": {
|
|
19124
19126
|
"factory": "./src/py/agent/mcp-connection/generator",
|
|
@@ -19187,7 +19189,8 @@ var generators$1 = {
|
|
|
19187
19189
|
"factory": "./src/ts/mcp-server/generator",
|
|
19188
19190
|
"schema": "./src/ts/mcp-server/schema.json",
|
|
19189
19191
|
"description": "Generate a TypeScript Model Context Protocol (MCP) server for providing context to Large Language Models",
|
|
19190
|
-
"metric": "g18"
|
|
19192
|
+
"metric": "g18",
|
|
19193
|
+
"guidePages": ["ts-mcp-server"]
|
|
19191
19194
|
},
|
|
19192
19195
|
"ts#nx-generator": {
|
|
19193
19196
|
"factory": "./src/ts/nx-generator/generator",
|
|
@@ -19257,7 +19260,8 @@ var generators$1 = {
|
|
|
19257
19260
|
"factory": "./src/ts/agent/generator",
|
|
19258
19261
|
"schema": "./src/ts/agent/schema.json",
|
|
19259
19262
|
"description": "Add an AI Agent to a TypeScript project",
|
|
19260
|
-
"metric": "g30"
|
|
19263
|
+
"metric": "g30",
|
|
19264
|
+
"guidePages": ["ts-agent"]
|
|
19261
19265
|
},
|
|
19262
19266
|
"ts#agent#mcp-connection": {
|
|
19263
19267
|
"factory": "./src/ts/agent/mcp-connection/generator",
|
|
@@ -19324,7 +19328,8 @@ var generators$1 = {
|
|
|
19324
19328
|
"factory": "./src/ts/rdb/generator",
|
|
19325
19329
|
"schema": "./src/ts/rdb/schema.json",
|
|
19326
19330
|
"description": "Create a relational database project",
|
|
19327
|
-
"metric": "g38"
|
|
19331
|
+
"metric": "g38",
|
|
19332
|
+
"guidePages": ["ts-rdb"]
|
|
19328
19333
|
},
|
|
19329
19334
|
"ts#rdb#smithy-connection": {
|
|
19330
19335
|
"factory": "./src/ts/rdb/smithy-connection/generator",
|
|
@@ -19392,7 +19397,7 @@ const PackageManagerSchema = _enum(PACKAGE_MANAGERS);
|
|
|
19392
19397
|
* Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
|
|
19393
19398
|
* SPDX-License-Identifier: Apache-2.0
|
|
19394
19399
|
*/
|
|
19395
|
-
const IAC_PROVIDERS = ["
|
|
19400
|
+
const IAC_PROVIDERS = ["cdk", "terraform"];
|
|
19396
19401
|
//#endregion
|
|
19397
19402
|
//#region ../nx-plugin/src/utils/commands.ts
|
|
19398
19403
|
const PACKAGE_MANAGER_COMMANDS = {
|
|
@@ -19453,13 +19458,13 @@ const buildInstallCommand = (pm, pkg, dev) => {
|
|
|
19453
19458
|
* The package manager is auto-detected by @aws/create-nx-workspace from the
|
|
19454
19459
|
* invoking command, so --pm is not needed.
|
|
19455
19460
|
*/
|
|
19456
|
-
const buildCreateNxWorkspaceCommand = (pm, workspace,
|
|
19461
|
+
const buildCreateNxWorkspaceCommand = (pm, workspace, iac, tag) => {
|
|
19457
19462
|
return [
|
|
19458
19463
|
PACKAGE_MANAGER_COMMANDS[pm]?.create ?? `${pm} create`,
|
|
19459
19464
|
tag ? `@aws/nx-workspace@${tag}` : "@aws/nx-workspace",
|
|
19460
19465
|
...pm === "npm" ? ["--"] : [],
|
|
19461
19466
|
workspace,
|
|
19462
|
-
...
|
|
19467
|
+
...iac ? [`--iac=${iac}`] : []
|
|
19463
19468
|
].join(" ");
|
|
19464
19469
|
};
|
|
19465
19470
|
//#endregion
|
|
@@ -19488,7 +19493,7 @@ ${buildCreateNxWorkspaceCommand(packageManager, ".")} --no-interactive
|
|
|
19488
19493
|
\`\`\`
|
|
19489
19494
|
|
|
19490
19495
|
Note that this will prompt for an Infrastructure as Code provider (${IAC_PROVIDERS.join(", ")}).
|
|
19491
|
-
If you know the preferred option, pass ${IAC_PROVIDERS.map((iac) => `\`--
|
|
19496
|
+
If you know the preferred option, pass ${IAC_PROVIDERS.map((iac) => `\`--iac=${iac}\``).join(" or ")} to the above command to skip the prompt.
|
|
19492
19497
|
|
|
19493
19498
|
Additional options:
|
|
19494
19499
|
- \`--no-gitSecrets\`: Opt out of the default git-secrets pre-commit hook (prevents committing AWS credentials)
|
|
@@ -52285,7 +52290,7 @@ const inlineSnippets = async (tree, opts, deps) => {
|
|
|
52285
52290
|
}
|
|
52286
52291
|
};
|
|
52287
52292
|
const applyFilterTransforms = (tree, options) => {
|
|
52288
|
-
const
|
|
52293
|
+
const iac = options?.iac;
|
|
52289
52294
|
const transform = (parent) => {
|
|
52290
52295
|
const children = parent.children;
|
|
52291
52296
|
for (let i = 0; i < children.length; i++) {
|
|
@@ -52304,12 +52309,12 @@ const applyFilterTransforms = (tree, options) => {
|
|
|
52304
52309
|
continue;
|
|
52305
52310
|
}
|
|
52306
52311
|
if (child.name === "Infrastructure") {
|
|
52307
|
-
if (
|
|
52312
|
+
if (iac === "cdk" || iac === "terraform") {
|
|
52308
52313
|
const pseudo = {
|
|
52309
52314
|
type: "mdxJsxFlowElement",
|
|
52310
52315
|
name: "tmp",
|
|
52311
52316
|
attributes: [],
|
|
52312
|
-
children: selectInfrastructureSlot(child,
|
|
52317
|
+
children: selectInfrastructureSlot(child, iac)
|
|
52313
52318
|
};
|
|
52314
52319
|
transform(pseudo);
|
|
52315
52320
|
children.splice(i, 1, ...pseudo.children);
|
|
@@ -52340,8 +52345,8 @@ const applyFilterTransforms = (tree, options) => {
|
|
|
52340
52345
|
};
|
|
52341
52346
|
transform(tree);
|
|
52342
52347
|
};
|
|
52343
|
-
const selectInfrastructureSlot = (node,
|
|
52344
|
-
const slotName =
|
|
52348
|
+
const selectInfrastructureSlot = (node, iac) => {
|
|
52349
|
+
const slotName = iac.toLowerCase();
|
|
52345
52350
|
return node.children.find((c) => isJsxElement(c) && c.name === "Fragment" && readStringAttr(c, "slot") === slotName)?.children ?? [];
|
|
52346
52351
|
};
|
|
52347
52352
|
/**
|
|
@@ -52455,7 +52460,7 @@ const renderComponent = (node, opts, pm, deps) => {
|
|
|
52455
52460
|
case "CreateNxWorkspaceCommand": {
|
|
52456
52461
|
const workspace = readStringAttr(node, "workspace");
|
|
52457
52462
|
if (!workspace) return void 0;
|
|
52458
|
-
return [codeBlock(buildCreateNxWorkspaceCommand(pm, workspace, readStringAttr(node, "
|
|
52463
|
+
return [codeBlock(buildCreateNxWorkspaceCommand(pm, workspace, readStringAttr(node, "iac")))];
|
|
52459
52464
|
}
|
|
52460
52465
|
case "InstallCommand": {
|
|
52461
52466
|
const pkg = readStringAttr(node, "pkg") ?? readExpressionAttr(node, "pkg");
|
|
@@ -52852,11 +52857,11 @@ const addListGeneratorsTool = (server, generators) => {
|
|
|
52852
52857
|
*/
|
|
52853
52858
|
const addGeneratorGuideTool = (server, generators) => {
|
|
52854
52859
|
server.registerTool("generator-guide", {
|
|
52855
|
-
description: "Tool to retrieve detailed information about a specific generator. Pass `options` with the values you intend to use for any filterable option (e.g.
|
|
52860
|
+
description: "Tool to retrieve detailed information about a specific generator. Pass `options` with the values you intend to use for any filterable option (e.g. infra, iac, auth, ux, protocol, sourceType, targetType) to receive only the guide content relevant to those choices — this cuts noise and avoids suggesting configuration from a different branch. The filterable keys and their valid values for each generator are listed by the `list-generators` tool; call it first if you are not sure which keys to pass. When the combination you pick is not supported by the generator (e.g. connection from ts#trpc-api to smithy), the tool returns an \"Unsupported combination\" warning with the list of supported pairs. When `options` is omitted, every conditional section is included and prefixed with a `> [!NOTE] Only when …` marker so you can see the branching condition.",
|
|
52856
52861
|
inputSchema: {
|
|
52857
52862
|
packageManager: PackageManagerSchema,
|
|
52858
52863
|
generator: _enum(generators.map((g) => g.id)),
|
|
52859
|
-
options: record(string$2(), string$2()).optional().describe("Optional map of generator option values (e.g. {
|
|
52864
|
+
options: record(string$2(), string$2()).optional().describe("Optional map of generator option values (e.g. { infra: \"rest-lambda\", iac: \"cdk\" }) used to filter the guide to content that applies to those choices.")
|
|
52860
52865
|
}
|
|
52861
52866
|
}, async ({ packageManager, generator: generatorId, options }) => {
|
|
52862
52867
|
const generator = generators.find((g) => g.id === generatorId);
|
|
@@ -24,7 +24,7 @@ Before using this generator, ensure you have:
|
|
|
24
24
|
|
|
25
25
|
1. A Python project with a <Link path="guides/py-agent">Strands Agent</Link> component (any protocol)
|
|
26
26
|
2. A project with an Agent component generated with `--protocol=A2A` and `--auth=IAM` (either <Link path="guides/ts-agent">`ts#agent`</Link> or <Link path="guides/py-agent">`py#agent`</Link>)
|
|
27
|
-
3. Both components created with `
|
|
27
|
+
3. Both components created with `infra: agentcore`
|
|
28
28
|
|
|
29
29
|
## Usage
|
|
30
30
|
|
|
@@ -24,7 +24,7 @@ Before using this generator, ensure you have:
|
|
|
24
24
|
|
|
25
25
|
1. A Python project with a <Link path="guides/py-agent">Strands Agent</Link> component
|
|
26
26
|
2. A project with an MCP server component (either <Link path="guides/ts-mcp-server">`ts#mcp-server`</Link> or <Link path="guides/py-mcp-server">`py#mcp-server`</Link>)
|
|
27
|
-
3. Both components created with `
|
|
27
|
+
3. Both components created with `infra: agentcore`
|
|
28
28
|
|
|
29
29
|
## Usage
|
|
30
30
|
|
|
@@ -170,7 +170,7 @@ function MyComponent() {
|
|
|
170
170
|
### Subscriptions (Streaming)
|
|
171
171
|
|
|
172
172
|
:::caution[Subscriptions Compute Type]
|
|
173
|
-
Subscriptions are only supported when the tRPC API uses `
|
|
173
|
+
Subscriptions are only supported when the tRPC API uses `rest-lambda` (REST API) as the compute type. API Gateway HTTP APIs do not support response streaming.
|
|
174
174
|
:::
|
|
175
175
|
|
|
176
176
|
When connecting to a REST API tRPC backend, the generated client is automatically configured with a `splitLink` that routes subscription operations through `httpSubscriptionLink` (using SSE) and regular queries/mutations through `httpLink`. This means subscriptions work out of the box with no additional configuration.
|
|
@@ -24,7 +24,7 @@ Before using this generator, ensure you have:
|
|
|
24
24
|
|
|
25
25
|
1. A TypeScript project with a <Link path="guides/ts-agent">Strands Agent</Link> component (any protocol)
|
|
26
26
|
2. A project with an Agent component generated with `--protocol=A2A` and `--auth=IAM` (either <Link path="guides/ts-agent">`ts#agent`</Link> or <Link path="guides/py-agent">`py#agent`</Link>)
|
|
27
|
-
3. Both components created with `
|
|
27
|
+
3. Both components created with `infra: agentcore`
|
|
28
28
|
|
|
29
29
|
## Usage
|
|
30
30
|
|
|
@@ -24,7 +24,7 @@ Before using this generator, ensure you have:
|
|
|
24
24
|
|
|
25
25
|
1. A TypeScript project with a <Link path="guides/ts-agent">Strands Agent</Link> component
|
|
26
26
|
2. A project with an MCP server component (either <Link path="guides/ts-mcp-server">`ts#mcp-server`</Link> or <Link path="guides/py-mcp-server">`py#mcp-server`</Link>)
|
|
27
|
-
3. Both components created with `
|
|
27
|
+
3. Both components created with `infra: agentcore`
|
|
28
28
|
|
|
29
29
|
## Usage
|
|
30
30
|
|
package/docs/guides/fastapi.mdx
CHANGED
|
@@ -35,7 +35,7 @@ You can generate a new FastAPI in two ways:
|
|
|
35
35
|
<Snippet name="api/api-choice-note" />
|
|
36
36
|
|
|
37
37
|
:::tip[API Type]
|
|
38
|
-
Select `
|
|
38
|
+
Select `rest-lambda` (default) as your `infra` if you intend to build any streaming operations.
|
|
39
39
|
:::
|
|
40
40
|
|
|
41
41
|
:::tip[Integration Pattern]
|
|
@@ -185,7 +185,7 @@ Unhandled exceptions are caught by the middleware and:
|
|
|
185
185
|
It's recommended to specify response models for your API operations for better code generation if using the `connection` generator. <Link path="guides/connection/react-fastapi#errors">See here for more details</Link>.
|
|
186
186
|
:::
|
|
187
187
|
|
|
188
|
-
<OptionFilter when={{
|
|
188
|
+
<OptionFilter when={{ infra: 'rest-lambda' }} description="Streaming — REST API only">
|
|
189
189
|
### Streaming
|
|
190
190
|
|
|
191
191
|
The generated FastAPI supports streaming responses out of the box when using a REST API. The infrastructure is configured to use the [AWS Lambda Web Adapter](https://github.com/awslabs/aws-lambda-web-adapter) to run your FastAPI via uvicorn inside Lambda, with `ResponseTransferMode.STREAM` in API Gateway for all REST API operations, which enables streaming to work alongside non-streaming operations.
|
|
@@ -256,7 +256,7 @@ This sets up:
|
|
|
256
256
|
|
|
257
257
|
<Snippet name="api/cors-configuration-cdk-note" />
|
|
258
258
|
|
|
259
|
-
<OptionFilter when={{ auth: '
|
|
259
|
+
<OptionFilter when={{ auth: 'cognito' }} description="Cognito identity construct wiring">
|
|
260
260
|
:::note[Cognito Authentication]
|
|
261
261
|
If you selected to use `Cognito` authentication, you will need to supply the `identity` property to the API construct:
|
|
262
262
|
|
|
@@ -279,7 +279,7 @@ The `UserIdentity` construct can be generated using the <Link path="/guides/reac
|
|
|
279
279
|
:::
|
|
280
280
|
</OptionFilter>
|
|
281
281
|
|
|
282
|
-
<OptionFilter when={{ auth: '
|
|
282
|
+
<OptionFilter when={{ auth: 'custom' }} description="Custom Lambda Authorizer CDK usage">
|
|
283
283
|
:::caution[Custom Lambda Authorizer]
|
|
284
284
|
When using `Custom` auth, the construct creates a Lambda Authorizer internally from the generated `authorizer.py` file, which **denies all requests by default**. You must implement your authorization logic in that file before your API will accept any traffic.
|
|
285
285
|
:::
|
|
@@ -326,7 +326,7 @@ This sets up:
|
|
|
326
326
|
|
|
327
327
|
<Snippet name="api/cors-configuration-terraform-note" />
|
|
328
328
|
|
|
329
|
-
<OptionFilter when={{ auth: '
|
|
329
|
+
<OptionFilter when={{ auth: 'cognito' }} description="Cognito module wiring">
|
|
330
330
|
:::note[Cognito Authentication]
|
|
331
331
|
If you selected to use `Cognito` authentication, you will need to supply the Cognito configuration:
|
|
332
332
|
|
|
@@ -392,7 +392,7 @@ module "my_api" {
|
|
|
392
392
|
}
|
|
393
393
|
```
|
|
394
394
|
|
|
395
|
-
<OptionFilter when={{ auth: '
|
|
395
|
+
<OptionFilter when={{ auth: 'custom' }} description="Custom Lambda Authorizer usage with Terraform">
|
|
396
396
|
:::caution[Custom Lambda Authorizer]
|
|
397
397
|
When using `Custom` auth, your API is protected by a Lambda Authorizer that **denies all requests by default**. You must implement your authorization logic in the generated `authorizer.py` file before your API will accept any traffic.
|
|
398
398
|
:::
|
|
@@ -400,7 +400,7 @@ When using `Custom` auth, your API is protected by a Lambda Authorizer that **de
|
|
|
400
400
|
</Fragment>
|
|
401
401
|
</Infrastructure>
|
|
402
402
|
|
|
403
|
-
<OptionFilter when={{
|
|
403
|
+
<OptionFilter when={{ infra: 'rest-lambda' }} description="WAF — REST APIs get a WAF Web ACL by default">
|
|
404
404
|
### WAF
|
|
405
405
|
|
|
406
406
|
<Snippet name="api/waf-configuration" parentHeading="WAF" />
|
|
@@ -442,7 +442,7 @@ We do not support type-safe integrations for Terraform, and therefore no code ge
|
|
|
442
442
|
</Fragment>
|
|
443
443
|
</Infrastructure>
|
|
444
444
|
|
|
445
|
-
<OptionFilter when={{ auth: '
|
|
445
|
+
<OptionFilter when={{ auth: 'iam' }} description="IAM-authenticated APIs only">
|
|
446
446
|
### Granting Access (IAM Only)
|
|
447
447
|
|
|
448
448
|
If you selected to use `IAM` authentication, you can use the `grantInvokeAccess` method to grant access to your API:
|
package/docs/guides/py-agent.mdx
CHANGED
|
@@ -47,7 +47,7 @@ First use the <Link path="/guides/python-project">`py#project`</Link> generator
|
|
|
47
47
|
|
|
48
48
|
The generator will add the following files to your existing Python project. The files generated depend on the chosen `protocol`:
|
|
49
49
|
|
|
50
|
-
<OptionFilter when={{ protocol: '
|
|
50
|
+
<OptionFilter when={{ protocol: 'http' }} description="FastAPI HTTP server layout">
|
|
51
51
|
### HTTP Protocol (default)
|
|
52
52
|
|
|
53
53
|
<FileTree>
|
|
@@ -58,13 +58,13 @@ The generator will add the following files to your existing Python project. The
|
|
|
58
58
|
- init.py FastAPI application setup with CORS and error handling middleware
|
|
59
59
|
- agent.py Main agent definition with sample tools
|
|
60
60
|
- main.py FastAPI entry point for Bedrock AgentCore Runtime
|
|
61
|
-
- Dockerfile Entry point for hosting your agent (excluded when `
|
|
61
|
+
- Dockerfile Entry point for hosting your agent (excluded when `infra` is set to `None`)
|
|
62
62
|
- pyproject.toml Updated with Strands dependencies
|
|
63
63
|
- project.json Updated with agent serve targets
|
|
64
64
|
</FileTree>
|
|
65
65
|
</OptionFilter>
|
|
66
66
|
|
|
67
|
-
<OptionFilter when={{ protocol: '
|
|
67
|
+
<OptionFilter when={{ protocol: 'a2a' }} description="Strands A2A server layout">
|
|
68
68
|
### A2A Protocol
|
|
69
69
|
|
|
70
70
|
The entry point uses the [Strands A2A Server](https://strandsagents.com/docs/user-guide/concepts/multi-agent/agent-to-agent) instead of FastAPI:
|
|
@@ -76,13 +76,13 @@ The entry point uses the [Strands A2A Server](https://strandsagents.com/docs/use
|
|
|
76
76
|
- \_\_init\_\_.py Python package initialization
|
|
77
77
|
- agent.py Main agent definition with sample tools
|
|
78
78
|
- main.py A2A server entry point
|
|
79
|
-
- Dockerfile Entry point for hosting your agent (excluded when `
|
|
79
|
+
- Dockerfile Entry point for hosting your agent (excluded when `infra` is set to `None`)
|
|
80
80
|
- pyproject.toml Updated with Strands dependencies
|
|
81
81
|
- project.json Updated with agent serve targets
|
|
82
82
|
</FileTree>
|
|
83
83
|
</OptionFilter>
|
|
84
84
|
|
|
85
|
-
<OptionFilter when={{ protocol: '
|
|
85
|
+
<OptionFilter when={{ protocol: 'ag-ui' }} description="AG-UI / CopilotKit server layout">
|
|
86
86
|
### AG-UI Protocol
|
|
87
87
|
|
|
88
88
|
The entry point uses the [ag-ui-strands](https://docs.ag-ui.com/) integration, which exposes your agent via the AG-UI protocol for direct frontend integration with [CopilotKit](https://docs.copilotkit.ai/aws-strands):
|
|
@@ -94,7 +94,7 @@ The entry point uses the [ag-ui-strands](https://docs.ag-ui.com/) integration, w
|
|
|
94
94
|
- \_\_init\_\_.py Python package initialization
|
|
95
95
|
- agent.py Main agent definition with sample tools
|
|
96
96
|
- main.py AG-UI server entry point using ag-ui-strands
|
|
97
|
-
- Dockerfile Entry point for hosting your agent (excluded when `
|
|
97
|
+
- Dockerfile Entry point for hosting your agent (excluded when `infra` is set to `None`)
|
|
98
98
|
- pyproject.toml Updated with Strands and AG-UI dependencies
|
|
99
99
|
- project.json Updated with agent serve targets
|
|
100
100
|
</FileTree>
|
|
@@ -106,7 +106,7 @@ AG-UI agents can be connected to a React frontend using the <Link path="/guides/
|
|
|
106
106
|
|
|
107
107
|
### Infrastructure
|
|
108
108
|
|
|
109
|
-
<OptionFilter when={{
|
|
109
|
+
<OptionFilter when={{ infra: 'agentcore' }} description="Bedrock AgentCore Runtime deployment">
|
|
110
110
|
<Snippet name="shared-constructs" />
|
|
111
111
|
|
|
112
112
|
For deploying your Agent, the following files are generated:
|
|
@@ -136,8 +136,8 @@ For deploying your Agent, the following files are generated:
|
|
|
136
136
|
</Infrastructure>
|
|
137
137
|
</OptionFilter>
|
|
138
138
|
|
|
139
|
-
<OptionFilter when={{
|
|
140
|
-
If you selected `
|
|
139
|
+
<OptionFilter when={{ infra: 'none' }} description="No infrastructure is vended for infra=none">
|
|
140
|
+
If you selected `none` for `infra`, no CDK constructs or Terraform modules are generated — the Agent can only be run locally. The `auth` option is ignored in this mode since there is no hosted endpoint to authenticate.
|
|
141
141
|
</OptionFilter>
|
|
142
142
|
|
|
143
143
|
#### Architecture
|
|
@@ -235,7 +235,7 @@ Your agent's server protocol determines how it communicates. All options are ser
|
|
|
235
235
|
|
|
236
236
|
All protocols expose `/ping` for the AgentCore runtime health check contract. A2A agents listen on port `9000`; HTTP and AG-UI agents listen on port `8080`. The generated Dockerfile and infrastructure are configured for you.
|
|
237
237
|
|
|
238
|
-
<OptionFilter when={{ protocol: '
|
|
238
|
+
<OptionFilter when={{ protocol: 'http' }} description="FastAPI HTTP server details">
|
|
239
239
|
## FastAPI Server (HTTP protocol)
|
|
240
240
|
|
|
241
241
|
The generated HTTP server includes:
|
|
@@ -319,7 +319,7 @@ You can find more details about the SDK's capabilities in the [documentation her
|
|
|
319
319
|
Since the generator vends CDK or Terraform infrastructure which manages deploying your agent, you do not need to utilise the `bedrock-agentcore-starter-toolkit` which the docs mention for deploying your agent.
|
|
320
320
|
:::
|
|
321
321
|
|
|
322
|
-
<OptionFilter when={{ protocol: '
|
|
322
|
+
<OptionFilter when={{ protocol: 'a2a' }} description="A2A server details">
|
|
323
323
|
## A2A Server (A2A protocol)
|
|
324
324
|
|
|
325
325
|
The generated `main.py` mounts `A2AServer.to_fastapi_app()` onto a parent FastAPI app that also exposes `/ping`. When deployed to AgentCore, the entry point resolves the runtime's public ARN from AppConfig and advertises it in the agent card.
|
|
@@ -327,7 +327,7 @@ The generated `main.py` mounts `A2AServer.to_fastapi_app()` onto a parent FastAP
|
|
|
327
327
|
Most users will not need to modify this file — edit `agent.py` to change tools or the system prompt. The A2A server populates the agent card (`/.well-known/agent-card.json`) from the `Agent` constructor's `name` and `description`.
|
|
328
328
|
</OptionFilter>
|
|
329
329
|
|
|
330
|
-
<OptionFilter when={{ protocol: '
|
|
330
|
+
<OptionFilter when={{ protocol: 'ag-ui' }} description="AG-UI / CopilotKit server details">
|
|
331
331
|
## AG-UI Server (AG-UI protocol)
|
|
332
332
|
|
|
333
333
|
The generated `main.py` wraps your Strands `Agent` in an `ag_ui_strands.StrandsAgent` and creates a FastAPI app via `create_strands_app()`. The resulting app exposes a single POST endpoint that streams [AG-UI](https://docs.ag-ui.com/) events over Server-Sent Events (SSE), as well as `/ping` for the AgentCore runtime health check.
|
|
@@ -364,7 +364,7 @@ For **HTTP** agents, the generator also emits:
|
|
|
364
364
|
|
|
365
365
|
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
366
|
|
|
367
|
-
<OptionFilter when={{
|
|
367
|
+
<OptionFilter when={{ infra: 'agentcore' }} description="Bedrock AgentCore Runtime deployment details">
|
|
368
368
|
## Deploying Your Agent to Bedrock AgentCore Runtime
|
|
369
369
|
|
|
370
370
|
<Snippet name="agent/bedrock-deployment" parentHeading="Deploying Your Agent to Bedrock AgentCore Runtime" />
|
|
@@ -389,7 +389,7 @@ For more details, refer to the [AgentCore documentation on observability](https:
|
|
|
389
389
|
|
|
390
390
|
## Invoking your Agent
|
|
391
391
|
|
|
392
|
-
<OptionFilter when={{ protocol: '
|
|
392
|
+
<OptionFilter when={{ protocol: 'http' }} description="FastAPI HTTP invocation details">
|
|
393
393
|
### Invoke the Local Server
|
|
394
394
|
|
|
395
395
|
To invoke an Agent running locally via the `<your-agent-name>-serve` target, you can send a simple POST request to `/invocations` on the port your local agent is running on. For example, with `curl`:
|
|
@@ -409,7 +409,7 @@ The `-N` argument given to `curl` disables buffering the output stream, so you c
|
|
|
409
409
|
<Snippet name="agent/runtime-arn" parentHeading="Invoke the Deployed Agent" />
|
|
410
410
|
|
|
411
411
|
<Tabs syncKey="auth">
|
|
412
|
-
<TabItem label="IAM" _filter={{ auth: '
|
|
412
|
+
<TabItem label="IAM" _filter={{ auth: 'iam' }}>
|
|
413
413
|
#### IAM Authentication
|
|
414
414
|
|
|
415
415
|
For IAM Authentication, the request must be signed using AWS Signature Version 4 (SigV4).
|
|
@@ -426,7 +426,7 @@ acurl <region> bedrock-agentcore -N -X POST \
|
|
|
426
426
|
</Drawer>
|
|
427
427
|
</TabItem>
|
|
428
428
|
|
|
429
|
-
<TabItem label="Cognito" _filter={{ auth: '
|
|
429
|
+
<TabItem label="Cognito" _filter={{ auth: 'cognito' }}>
|
|
430
430
|
#### JWT / Cognito Authentication
|
|
431
431
|
|
|
432
432
|
For Cognito Authentication, pass the Cognito Access Token in the `Authorization` header:
|
|
@@ -462,7 +462,7 @@ For invoking your Agent from a React website, you can make use of the <Link path
|
|
|
462
462
|
Refer to the <Link path="/guides/connection/react-py-agent">`connection` generator guide</Link> for details about how the connection is set up.
|
|
463
463
|
</OptionFilter>
|
|
464
464
|
|
|
465
|
-
<OptionFilter when={{ protocol: '
|
|
465
|
+
<OptionFilter when={{ protocol: 'a2a' }} description="A2A delegation details">
|
|
466
466
|
### Invoking an A2A Agent as a Tool
|
|
467
467
|
|
|
468
468
|
To delegate work from this agent to a remote A2A agent (either <Link path="/guides/ts-agent">TypeScript</Link> or <Link path="/guides/py-agent">Python</Link>), use the <Link path="/guides/connection/py-agent-a2a">`connection` generator</Link>. It vends a SigV4-authenticated client for the target agent and AST-transforms this agent's `agent.py` to register the remote A2A agent as a `@tool`-decorated delegate.
|
|
@@ -472,7 +472,7 @@ To delegate work from this agent to a remote A2A agent (either <Link path="/guid
|
|
|
472
472
|
Refer to the <Link path="/guides/connection/py-agent-a2a">`connection` generator guide</Link> for details about how the connection is set up.
|
|
473
473
|
</OptionFilter>
|
|
474
474
|
|
|
475
|
-
<OptionFilter when={{ protocol: '
|
|
475
|
+
<OptionFilter when={{ protocol: 'ag-ui' }} description="AG-UI / React connection details">
|
|
476
476
|
### Invoking an AG-UI Agent
|
|
477
477
|
|
|
478
478
|
To invoke your AG-UI agent from a React website, use the <Link path="/guides/connection/react-agui">`connection` generator</Link>, which wires up a [CopilotKit](https://docs.copilotkit.ai/aws-strands) client configured for your deployed agent with the correct authentication (IAM or Cognito).
|
|
@@ -49,21 +49,21 @@ The generator will add the following files to your existing Python project:
|
|
|
49
49
|
- server.py Main server definition with sample tools and resources
|
|
50
50
|
- stdio.py Entry point for STDIO transport, useful for simple local MCP servers
|
|
51
51
|
- http.py Entry point for Streamable HTTP transport, useful for hosting your MCP server
|
|
52
|
-
- Dockerfile Entry point for hosting your MCP server (excluded when `
|
|
52
|
+
- Dockerfile Entry point for hosting your MCP server (excluded when `infra` is set to `None`)
|
|
53
53
|
- pyproject.toml Updated with MCP dependencies
|
|
54
54
|
- project.json Updated with MCP server serve targets
|
|
55
55
|
</FileTree>
|
|
56
56
|
|
|
57
57
|
### Infrastructure
|
|
58
58
|
|
|
59
|
-
<OptionFilter when={{
|
|
59
|
+
<OptionFilter when={{ infra: 'agentcore' }} description="Bedrock AgentCore Runtime deployment">
|
|
60
60
|
<Snippet name="shared-constructs" />
|
|
61
61
|
|
|
62
62
|
<Snippet name="mcp/shared-constructs" />
|
|
63
63
|
</OptionFilter>
|
|
64
64
|
|
|
65
|
-
<OptionFilter when={{
|
|
66
|
-
If you selected `
|
|
65
|
+
<OptionFilter when={{ infra: 'none' }} description="No infrastructure is vended for infra=none">
|
|
66
|
+
If you selected `none` for `infra`, no CDK constructs or Terraform modules are generated — the MCP server is configured for local STDIO / HTTP use only. The `auth` option is ignored in this mode since there is no hosted endpoint to authenticate.
|
|
67
67
|
</OptionFilter>
|
|
68
68
|
|
|
69
69
|
#### Architecture
|
|
@@ -141,7 +141,7 @@ If you would like to run your MCP server locally using [Streamable HTTP transpor
|
|
|
141
141
|
|
|
142
142
|
This command uses `uv run uvicorn --reload` to run your MCP server with HTTP transport (typically on port `8000`), and automatically restarts when files change.
|
|
143
143
|
|
|
144
|
-
<OptionFilter when={{
|
|
144
|
+
<OptionFilter when={{ infra: 'agentcore' }} description="Bedrock AgentCore Runtime deployment details">
|
|
145
145
|
## Deploying Your MCP Server to Bedrock AgentCore Runtime
|
|
146
146
|
|
|
147
147
|
<Snippet name="mcp/bedrock-deployment" parentHeading="Deploying Your MCP Server to Bedrock AgentCore Runtime" />
|
|
@@ -163,8 +163,8 @@ Default metrics include:
|
|
|
163
163
|
|
|
164
164
|
### Type Safety
|
|
165
165
|
|
|
166
|
-
<OptionFilter not when={{
|
|
167
|
-
If you chose an `
|
|
166
|
+
<OptionFilter not when={{ event: 'Any' }} description="Typed event wires @event_parser with a Pydantic model">
|
|
167
|
+
If you chose an `event` when generating your lambda function, your function is instrumented with [`@event_parser` from AWS Lambda Powertools](https://docs.powertools.aws.dev/lambda/python/latest/utilities/parser/). For example:
|
|
168
168
|
|
|
169
169
|
```python {3}
|
|
170
170
|
@event_parser(model=EventBridgeModel)
|
|
@@ -179,8 +179,8 @@ If you have custom data nested within an event, for example a DynamoDB stream or
|
|
|
179
179
|
:::
|
|
180
180
|
</OptionFilter>
|
|
181
181
|
|
|
182
|
-
<OptionFilter when={{
|
|
183
|
-
If you selected `Any` for your `
|
|
182
|
+
<OptionFilter when={{ event: 'Any' }} description="event=Any — no parser decorator, event is untyped">
|
|
183
|
+
If you selected `Any` for your `event`, the `@event_parser` decorator is not applied and the handler receives an untyped event dict. Regenerate with a specific `event` if you want Pydantic validation and typed field access.
|
|
184
184
|
</OptionFilter>
|
|
185
185
|
|
|
186
186
|
## Bundling
|
|
@@ -130,11 +130,11 @@ cloudfront -> s3
|
|
|
130
130
|
|
|
131
131
|
The [React documentation](https://react.dev/learn) is a good place to start to learn the basics of building with React.
|
|
132
132
|
|
|
133
|
-
<OptionFilter when={{
|
|
133
|
+
<OptionFilter when={{ ux: 'cloudscape' }} description="Cloudscape component docs pointer">
|
|
134
134
|
You can refer to the [Cloudscape documentation](https://cloudscape.design/components/) for details about the available components and how to use them.
|
|
135
135
|
</OptionFilter>
|
|
136
136
|
|
|
137
|
-
<OptionFilter when={{
|
|
137
|
+
<OptionFilter when={{ ux: 'shadcn' }} description="Shadcn component docs pointer">
|
|
138
138
|
You can refer to the [shadcn/ui documentation](https://ui.shadcn.com/docs) for details about the available components and how to use them.
|
|
139
139
|
</OptionFilter>
|
|
140
140
|
|