@aws/nx-plugin-mcp 1.0.0-rc.22 → 1.0.0-rc.24
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 +17 -17
- package/docs/guides/agentcore-gateway.mdx +4 -4
- package/docs/guides/connection/agentcore-gateway-gateway.mdx +4 -4
- package/docs/guides/connection/agentcore-gateway-mcp.mdx +5 -5
- package/docs/guides/connection/py-agent-a2a.mdx +5 -5
- package/docs/guides/connection/py-agent-dynamodb.mdx +1 -1
- package/docs/guides/connection/py-agent-gateway.mdx +7 -7
- package/docs/guides/connection/py-agent-mcp.mdx +4 -4
- package/docs/guides/connection/py-fast-api-dynamodb.mdx +1 -1
- package/docs/guides/connection/py-mcp-server-dynamodb.mdx +1 -1
- package/docs/guides/connection/react-agui.mdx +4 -4
- package/docs/guides/connection/react-fastapi.mdx +2 -2
- package/docs/guides/connection/react-py-agent.mdx +3 -3
- package/docs/guides/connection/react-smithy.mdx +2 -2
- package/docs/guides/connection/react-ts-agent.mdx +5 -5
- package/docs/guides/connection/smithy-dynamodb.mdx +1 -1
- package/docs/guides/connection/smithy-rdb.mdx +3 -3
- package/docs/guides/connection/trpc-dynamodb.mdx +1 -1
- package/docs/guides/connection/trpc-rdb.mdx +3 -3
- package/docs/guides/connection/ts-agent-a2a.mdx +5 -5
- package/docs/guides/connection/ts-agent-dynamodb.mdx +1 -1
- package/docs/guides/connection/ts-agent-gateway.mdx +6 -6
- package/docs/guides/connection/ts-agent-mcp.mdx +4 -4
- package/docs/guides/connection/ts-agent-rdb.mdx +3 -3
- package/docs/guides/connection/ts-mcp-server-dynamodb.mdx +1 -1
- package/docs/guides/connection/ts-mcp-server-rdb.mdx +3 -3
- package/docs/guides/connection.mdx +1 -1
- package/docs/guides/fastapi.mdx +6 -0
- package/docs/guides/local-development.mdx +20 -9
- package/docs/guides/nx-generator.mdx +2 -2
- package/docs/guides/py-agent.mdx +9 -5
- package/docs/guides/py-dynamodb.mdx +4 -4
- package/docs/guides/py-mcp-server.mdx +11 -1
- package/docs/guides/react-website-auth.mdx +36 -0
- package/docs/guides/react-website.mdx +22 -14
- package/docs/guides/trpc.mdx +6 -0
- package/docs/guides/ts-agent.mdx +9 -5
- package/docs/guides/ts-dynamodb.mdx +4 -4
- package/docs/guides/ts-mcp-server.mdx +11 -1
- package/docs/guides/ts-rdb.mdx +5 -4
- package/docs/guides/ts-smithy-api.mdx +4 -0
- package/docs/guides/typescript-infrastructure.mdx +1 -1
- package/docs/snippets/api/access-logging.mdx +33 -0
- package/docs/snippets/connection/dynamodb-local-development.mdx +2 -2
- package/docs/snippets/connection/py-dynamodb-local-development.mdx +2 -2
- package/docs/snippets/dynamodb/gsi-config.mdx +1 -1
- package/docs/snippets/dynamodb/local-dev-start.mdx +13 -0
- package/docs/snippets/dynamodb/local-dev-windows.mdx +15 -0
- package/package.json +1 -1
- package/src/preset/schema.json +0 -5
- package/src/ts/react-website/app/schema.json +6 -6
- package/src/ts/website/app/schema.json +6 -6
- package/docs/snippets/dynamodb/serve-local-start.mdx +0 -13
- package/docs/snippets/dynamodb/serve-local-windows.mdx +0 -15
package/bin/aws-nx-mcp.js
CHANGED
|
@@ -35,12 +35,12 @@ var __toESM$1 = (mod, isNodeMode, target) => (target = mod != null ? __create$1(
|
|
|
35
35
|
let node_process = require("node:process");
|
|
36
36
|
node_process = __toESM$1(node_process, 1);
|
|
37
37
|
let path = require("path");
|
|
38
|
+
let path$3 = __toESM$1(path, 1);
|
|
38
39
|
path = __toESM$1(path);
|
|
39
40
|
let fs = require("fs");
|
|
40
|
-
fs = __toESM$1(fs);
|
|
41
|
+
fs = __toESM$1(fs, 1);
|
|
41
42
|
let node_path = require("node:path");
|
|
42
|
-
|
|
43
|
-
node_path = __toESM$1(node_path);
|
|
43
|
+
node_path = __toESM$1(node_path, 1);
|
|
44
44
|
let node_url = require("node:url");
|
|
45
45
|
//#region ../../node_modules/.pnpm/zod@4.4.3/node_modules/zod/v4/core/core.js
|
|
46
46
|
var _a$1;
|
|
@@ -20203,8 +20203,8 @@ var generators$1 = {
|
|
|
20203
20203
|
const buildGeneratorInfoList = (baseDir) => Object.entries(generators$1).map(([id, info]) => ({
|
|
20204
20204
|
id,
|
|
20205
20205
|
metric: info.metric,
|
|
20206
|
-
resolvedFactoryPath: path.resolve(baseDir, info.factory),
|
|
20207
|
-
resolvedSchemaPath: path.resolve(baseDir, info.schema),
|
|
20206
|
+
resolvedFactoryPath: path$3.resolve(baseDir, info.factory),
|
|
20207
|
+
resolvedSchemaPath: path$3.resolve(baseDir, info.schema),
|
|
20208
20208
|
description: info.description,
|
|
20209
20209
|
..."hidden" in info && info.hidden ? { hidden: info.hidden } : {},
|
|
20210
20210
|
..."guidePages" in info && info.guidePages ? { guidePages: info.guidePages } : {}
|
|
@@ -21338,7 +21338,7 @@ var require_lodash_deburr = /* @__PURE__ */ __commonJSMin$1(((exports, module) =
|
|
|
21338
21338
|
module.exports = deburr;
|
|
21339
21339
|
}));
|
|
21340
21340
|
require_lodash_camelcase();
|
|
21341
|
-
var import_lodash_deburr = /* @__PURE__ */ __toESM$1(require_lodash_deburr());
|
|
21341
|
+
var import_lodash_deburr = /* @__PURE__ */ __toESM$1(require_lodash_deburr(), 1);
|
|
21342
21342
|
const kebabCase = (str) => {
|
|
21343
21343
|
return (0, import_lodash_deburr.default)(str).replace(/[^a-zA-Z0-9]+/g, "-").replace(/([a-z0-9])([A-Z])/g, "$1-$2").toLowerCase().replace(/^-+|-+$/g, "");
|
|
21344
21344
|
};
|
|
@@ -24471,7 +24471,7 @@ var init_minurl = __esmMin((() => {
|
|
|
24471
24471
|
* Nothing.
|
|
24472
24472
|
*/
|
|
24473
24473
|
function assertPart(part, name) {
|
|
24474
|
-
if (part && part.includes(node_path
|
|
24474
|
+
if (part && part.includes(node_path.default.sep)) throw new Error("`" + name + "` cannot be a path: did not expect `" + node_path.default.sep + "`");
|
|
24475
24475
|
}
|
|
24476
24476
|
/**
|
|
24477
24477
|
* Assert that `part` is not empty.
|
|
@@ -24631,7 +24631,7 @@ var init_lib$23 = __esmMin((() => {
|
|
|
24631
24631
|
* Basename.
|
|
24632
24632
|
*/
|
|
24633
24633
|
get basename() {
|
|
24634
|
-
return typeof this.path === "string" ? node_path
|
|
24634
|
+
return typeof this.path === "string" ? node_path.default.basename(this.path) : void 0;
|
|
24635
24635
|
}
|
|
24636
24636
|
/**
|
|
24637
24637
|
* Set basename (including extname) (`'index.min.js'`).
|
|
@@ -24648,7 +24648,7 @@ var init_lib$23 = __esmMin((() => {
|
|
|
24648
24648
|
set basename(basename) {
|
|
24649
24649
|
assertNonEmpty(basename, "basename");
|
|
24650
24650
|
assertPart(basename, "basename");
|
|
24651
|
-
this.path = node_path
|
|
24651
|
+
this.path = node_path.default.join(this.dirname || "", basename);
|
|
24652
24652
|
}
|
|
24653
24653
|
/**
|
|
24654
24654
|
* Get the parent path (example: `'~'`).
|
|
@@ -24657,7 +24657,7 @@ var init_lib$23 = __esmMin((() => {
|
|
|
24657
24657
|
* Dirname.
|
|
24658
24658
|
*/
|
|
24659
24659
|
get dirname() {
|
|
24660
|
-
return typeof this.path === "string" ? node_path
|
|
24660
|
+
return typeof this.path === "string" ? node_path.default.dirname(this.path) : void 0;
|
|
24661
24661
|
}
|
|
24662
24662
|
/**
|
|
24663
24663
|
* Set the parent path (example: `'~'`).
|
|
@@ -24671,7 +24671,7 @@ var init_lib$23 = __esmMin((() => {
|
|
|
24671
24671
|
*/
|
|
24672
24672
|
set dirname(dirname) {
|
|
24673
24673
|
assertPath(this.basename, "dirname");
|
|
24674
|
-
this.path = node_path
|
|
24674
|
+
this.path = node_path.default.join(dirname || "", this.basename);
|
|
24675
24675
|
}
|
|
24676
24676
|
/**
|
|
24677
24677
|
* Get the extname (including dot) (example: `'.js'`).
|
|
@@ -24680,7 +24680,7 @@ var init_lib$23 = __esmMin((() => {
|
|
|
24680
24680
|
* Extname.
|
|
24681
24681
|
*/
|
|
24682
24682
|
get extname() {
|
|
24683
|
-
return typeof this.path === "string" ? node_path
|
|
24683
|
+
return typeof this.path === "string" ? node_path.default.extname(this.path) : void 0;
|
|
24684
24684
|
}
|
|
24685
24685
|
/**
|
|
24686
24686
|
* Set the extname (including dot) (example: `'.js'`).
|
|
@@ -24701,7 +24701,7 @@ var init_lib$23 = __esmMin((() => {
|
|
|
24701
24701
|
if (extname.codePointAt(0) !== 46) throw new Error("`extname` must start with `.`");
|
|
24702
24702
|
if (extname.includes(".", 1)) throw new Error("`extname` cannot contain multiple dots");
|
|
24703
24703
|
}
|
|
24704
|
-
this.path = node_path
|
|
24704
|
+
this.path = node_path.default.join(this.dirname, this.stem + (extname || ""));
|
|
24705
24705
|
}
|
|
24706
24706
|
/**
|
|
24707
24707
|
* Get the full path (example: `'~/index.min.js'`).
|
|
@@ -24736,7 +24736,7 @@ var init_lib$23 = __esmMin((() => {
|
|
|
24736
24736
|
* Stem.
|
|
24737
24737
|
*/
|
|
24738
24738
|
get stem() {
|
|
24739
|
-
return typeof this.path === "string" ? node_path
|
|
24739
|
+
return typeof this.path === "string" ? node_path.default.basename(this.path, this.extname) : void 0;
|
|
24740
24740
|
}
|
|
24741
24741
|
/**
|
|
24742
24742
|
* Set the stem (basename w/o extname) (example: `'index.min'`).
|
|
@@ -24753,7 +24753,7 @@ var init_lib$23 = __esmMin((() => {
|
|
|
24753
24753
|
set stem(stem) {
|
|
24754
24754
|
assertNonEmpty(stem, "stem");
|
|
24755
24755
|
assertPart(stem, "stem");
|
|
24756
|
-
this.path = node_path
|
|
24756
|
+
this.path = node_path.default.join(this.dirname || "", stem + (this.extname || ""));
|
|
24757
24757
|
}
|
|
24758
24758
|
/**
|
|
24759
24759
|
* Create a fatal message for `reason` associated with the file.
|
|
@@ -53912,7 +53912,7 @@ const GUIDES_RELATIVE_PROBES = [
|
|
|
53912
53912
|
];
|
|
53913
53913
|
const fetchLocalGuide = (guide) => {
|
|
53914
53914
|
for (const rel of GUIDES_RELATIVE_PROBES) {
|
|
53915
|
-
const candidate = path.default.resolve(__dirname, rel, `${guide}.mdx`);
|
|
53915
|
+
const candidate = path$3.default.resolve(__dirname, rel, `${guide}.mdx`);
|
|
53916
53916
|
try {
|
|
53917
53917
|
if (fs.default.existsSync(candidate)) return fs.default.readFileSync(candidate, "utf-8");
|
|
53918
53918
|
} catch {}
|
|
@@ -53935,7 +53935,7 @@ const SNIPPETS_RELATIVE_PROBES = [
|
|
|
53935
53935
|
*/
|
|
53936
53936
|
const fetchSnippet = async (snippetName) => {
|
|
53937
53937
|
for (const rel of SNIPPETS_RELATIVE_PROBES) {
|
|
53938
|
-
const candidate = path.default.resolve(__dirname, rel, `${snippetName}.mdx`);
|
|
53938
|
+
const candidate = path$3.default.resolve(__dirname, rel, `${snippetName}.mdx`);
|
|
53939
53939
|
try {
|
|
53940
53940
|
if (fs.default.existsSync(candidate)) return fs.default.readFileSync(candidate, "utf-8");
|
|
53941
53941
|
} catch {}
|
|
@@ -36,8 +36,8 @@ The generator creates a new project at `packages/<name>/`, plus a CDK construct
|
|
|
36
36
|
- policies/ Cedar policy source files (omitted when `cedarPolicy: false`)
|
|
37
37
|
- permit-all.cedar Default Cedar policy that permits authenticated callers from within the same AWS account
|
|
38
38
|
- README.md Reference for writing Cedar policies
|
|
39
|
-
-
|
|
40
|
-
- project.json Adds the
|
|
39
|
+
- local-dev.ts Local gateway aggregating attached MCP servers for local development
|
|
40
|
+
- project.json Adds the `serve` and `dev` targets
|
|
41
41
|
</FileTree>
|
|
42
42
|
|
|
43
43
|
### Infrastructure
|
|
@@ -228,9 +228,9 @@ This denies the Python agent role from calling `ts-mcp___divide` while leaving t
|
|
|
228
228
|
|
|
229
229
|
## Local Development
|
|
230
230
|
|
|
231
|
-
The generator adds a
|
|
231
|
+
The generator adds a `dev` target to the Gateway project, which runs `local-dev.ts`: a local gateway exposing a single MCP endpoint that aggregates every attached MCP server (connected via the <Link path="guides/connection/agentcore-gateway-mcp">`agentcore-gateway#mcp-connection` generator</Link>), with tools prefixed `<target>___<tool>` to match the deployed Gateway. Running it starts the local gateway and all attached MCP servers together:
|
|
232
232
|
|
|
233
|
-
<NxCommands commands={["<name
|
|
233
|
+
<NxCommands commands={["dev <name>"]} />
|
|
234
234
|
|
|
235
235
|
See the connection guide for the full local development story.
|
|
236
236
|
|
|
@@ -43,12 +43,12 @@ The generator wires existing projects together rather than emitting new source f
|
|
|
43
43
|
<FileTree>
|
|
44
44
|
|
|
45
45
|
- packages/\<source-gateway>
|
|
46
|
-
- project.json
|
|
47
|
-
-
|
|
46
|
+
- project.json the source Gateway's `dev` target gains a dependency on the target gateway's `dev` target
|
|
47
|
+
- local-dev.ts `ATTACHED_MCP_SERVERS` updated so the local gateway aggregates the target gateway
|
|
48
48
|
|
|
49
49
|
</FileTree>
|
|
50
50
|
|
|
51
|
-
The source Gateway project's
|
|
51
|
+
The source Gateway project's `dev` target gains a dependency on the target Gateway's `dev` target, so running the source Gateway locally also starts the target gateway (and, transitively, every MCP server attached to it). The target gateway is also registered in the source Gateway project's `local-dev.ts` so the local gateway aggregates its tools.
|
|
52
52
|
|
|
53
53
|
## Adding the gateway target to your stack
|
|
54
54
|
|
|
@@ -145,7 +145,7 @@ This means a tool call through a gateway chain must be permitted at every hop. T
|
|
|
145
145
|
|
|
146
146
|
Running the source Gateway locally with:
|
|
147
147
|
|
|
148
|
-
<NxCommands commands={["<source-gateway-name
|
|
148
|
+
<NxCommands commands={["dev <source-gateway-name>"]} />
|
|
149
149
|
|
|
150
150
|
starts the local source gateway, the local target gateway, and every MCP server attached to either, each on its assigned local port. Tool names are prefixed at each hop exactly as deployed (`<gateway-target-name>___<target-name>___<tool-name>`), so agent prompts and Cedar action names remain consistent across local and deployed runs.
|
|
151
151
|
|
|
@@ -46,12 +46,12 @@ The generator wires existing projects together rather than emitting new source f
|
|
|
46
46
|
<FileTree>
|
|
47
47
|
|
|
48
48
|
- packages/\<gateway>
|
|
49
|
-
- project.json
|
|
50
|
-
-
|
|
49
|
+
- project.json the Gateway's `dev` target gains a dependency on the MCP server's `<mcp>-dev`
|
|
50
|
+
- local-dev.ts `ATTACHED_MCP_SERVERS` updated so the local gateway aggregates the MCP server
|
|
51
51
|
|
|
52
52
|
</FileTree>
|
|
53
53
|
|
|
54
|
-
The Gateway project's
|
|
54
|
+
The Gateway project's `dev` target gains a dependency on the MCP server's `<mcp>-dev` target, so running the Gateway locally also starts the MCP server. The MCP server is also registered in the Gateway project's `local-dev.ts` so the local gateway aggregates its tools.
|
|
55
55
|
|
|
56
56
|
## Adding the MCP server target to your stack
|
|
57
57
|
|
|
@@ -123,9 +123,9 @@ The target `name` (`my-mcp-server` above) is used as the prefix for Cedar action
|
|
|
123
123
|
|
|
124
124
|
Running the Gateway locally with:
|
|
125
125
|
|
|
126
|
-
<NxCommands commands={["<gateway-name
|
|
126
|
+
<NxCommands commands={["dev <gateway-name>"]} />
|
|
127
127
|
|
|
128
|
-
starts a local gateway plus every attached MCP server on its assigned local port. The local gateway exposes a single MCP endpoint that aggregates the attached servers' tools. Agents connected to the Gateway via the <Link path="guides/connection/ts-agent-gateway">TypeScript</Link> or <Link path="guides/connection/py-agent-gateway">Python</Link> gateway-connection generators point at it when running with `
|
|
128
|
+
starts a local gateway plus every attached MCP server on its assigned local port. The local gateway exposes a single MCP endpoint that aggregates the attached servers' tools. Agents connected to the Gateway via the <Link path="guides/connection/ts-agent-gateway">TypeScript</Link> or <Link path="guides/connection/py-agent-gateway">Python</Link> gateway-connection generators point at it when running with `LOCAL_DEV=true`.
|
|
129
129
|
|
|
130
130
|
:::caution[Local fidelity]
|
|
131
131
|
Local development uses a **local stand-in gateway** — a lightweight MCP aggregator started by the Gateway project, not the AgentCore Gateway service. As a consequence, **Cedar policies are not evaluated locally**. Every agent sees every tool on every attached MCP server. To exercise Cedar policies, run the agent's `serve` target instead (see the <Link path="guides/connection/ts-agent-gateway">TypeScript</Link> / <Link path="guides/connection/py-agent-gateway">Python</Link> agent-connection guides) so the locally-running agent calls the deployed Gateway.
|
|
@@ -62,7 +62,7 @@ The client suffix matches your agent's framework (`_strands` or `_langchain`). B
|
|
|
62
62
|
Additionally, the generator:
|
|
63
63
|
- Transforms your agent's `agent.py` to register the remote A2A agent as a tool using `@tool`
|
|
64
64
|
- Adds the `agent_connection` project as a workspace dependency of your agent project
|
|
65
|
-
- Updates the agent's `
|
|
65
|
+
- Updates the agent's `dev` target to depend on the target agent's `dev` target
|
|
66
66
|
|
|
67
67
|
## Using the Connected A2A Agent
|
|
68
68
|
|
|
@@ -116,7 +116,7 @@ def get_agent():
|
|
|
116
116
|
</TabItem>
|
|
117
117
|
</Tabs>
|
|
118
118
|
|
|
119
|
-
Both clients are directly callable, returning the remote agent's reply, and wrap an `httpx.AsyncClient` that signs requests with SigV4 when deployed to AWS and uses a plain `http://localhost:<port>/` endpoint when `
|
|
119
|
+
Both clients are directly callable, returning the remote agent's reply, and wrap an `httpx.AsyncClient` that signs requests with SigV4 when deployed to AWS and uses a plain `http://localhost:<port>/` endpoint when `LOCAL_DEV=true`. The Strands client wraps a Strands `A2AAgent`; the LangChain client drives the a2a SDK directly.
|
|
120
120
|
|
|
121
121
|
The AgentCore session ID is propagated to the remote agent automatically via the `X-Amzn-Bedrock-AgentCore-Runtime-Session-Id` header, regardless of framework: the agent server binds the inbound request's session into an async context, and the connection client's signed `httpx.Auth` stamps it on every outbound call — ensuring consistency for [Bedrock AgentCore Observability](https://docs.aws.amazon.com/bedrock-agentcore/latest/devguide/observability.html).
|
|
122
122
|
|
|
@@ -126,12 +126,12 @@ The AgentCore session ID is propagated to the remote agent automatically via the
|
|
|
126
126
|
|
|
127
127
|
## Local Development
|
|
128
128
|
|
|
129
|
-
The generator configures the host agent's `
|
|
129
|
+
The generator configures the host agent's `dev` target to:
|
|
130
130
|
1. Start the connected A2A agent(s) automatically
|
|
131
|
-
2. Set `
|
|
131
|
+
2. Set `LOCAL_DEV=true` so the generated client connects directly to `http://localhost:<port>/` instead of AgentCore
|
|
132
132
|
|
|
133
133
|
Run the agent locally with:
|
|
134
134
|
|
|
135
|
-
<NxCommands commands={["<agent-name>-
|
|
135
|
+
<NxCommands commands={["<agent-name>-dev <project-name>"]} />
|
|
136
136
|
|
|
137
137
|
This will start both the host agent and all connected A2A agents, with the host agent calling the remote agents over plain HTTP on their assigned local ports.
|
|
@@ -34,7 +34,7 @@ Select your Agent project as the source and your DynamoDB project as the target.
|
|
|
34
34
|
|
|
35
35
|
## Generator Output
|
|
36
36
|
|
|
37
|
-
The generator updates the agent's `<agent-name>-
|
|
37
|
+
The generator updates the agent's `<agent-name>-dev` target in `project.json` to depend on the DynamoDB project's `dev` target, and adds the DynamoDB package as a workspace dependency. No source files are modified.
|
|
38
38
|
|
|
39
39
|
## Using DynamoDB in Agents
|
|
40
40
|
|
|
@@ -60,7 +60,7 @@ Additionally, the generator:
|
|
|
60
60
|
|
|
61
61
|
- Modifies your agent's `agent.py` to import the Gateway client and register its tools in `tools`
|
|
62
62
|
- Adds `agent_connection` as a workspace dependency of the agent
|
|
63
|
-
- Wires the agent's `<agent>-
|
|
63
|
+
- Wires the agent's `<agent>-dev` target to depend on the Gateway's `dev` target
|
|
64
64
|
|
|
65
65
|
## Using the connected Gateway
|
|
66
66
|
|
|
@@ -110,8 +110,8 @@ def get_agent():
|
|
|
110
110
|
|
|
111
111
|
In both cases the client behaves the same way per mode:
|
|
112
112
|
|
|
113
|
-
- **Deployed mode** (`
|
|
114
|
-
- **Local mode** (`
|
|
113
|
+
- **Deployed mode** (`LOCAL_DEV` unset): tools pointed at the Gateway's MCP endpoint, SigV4-signed.
|
|
114
|
+
- **Local mode** (`LOCAL_DEV=true`): plain-HTTP tools pointed at the local gateway started by the Gateway project's `dev` target.
|
|
115
115
|
|
|
116
116
|
The session ID is propagated to downstream MCP servers automatically via the `X-Amzn-Bedrock-AgentCore-Runtime-Session-Id` header.
|
|
117
117
|
|
|
@@ -166,16 +166,16 @@ The Gateway URL is automatically registered in the `agentcore.gateways.<ClassNam
|
|
|
166
166
|
|
|
167
167
|
## Local Development
|
|
168
168
|
|
|
169
|
-
The generator configures the agent's `
|
|
169
|
+
The generator configures the agent's `dev` target to:
|
|
170
170
|
|
|
171
171
|
1. Start the connected Gateway's local gateway and every attached MCP server
|
|
172
|
-
2. Set `
|
|
172
|
+
2. Set `LOCAL_DEV=true` so the generated client points at the local gateway instead of the deployed Gateway
|
|
173
173
|
|
|
174
174
|
Run the agent locally with:
|
|
175
175
|
|
|
176
|
-
<NxCommands commands={["<agent-name>-
|
|
176
|
+
<NxCommands commands={["<agent-name>-dev <project-name>"]} />
|
|
177
177
|
|
|
178
|
-
To run the agent locally **against the deployed Gateway** instead (for example, to exercise Cedar policies), use the agent's `serve` target. Without `
|
|
178
|
+
To run the agent locally **against the deployed Gateway** instead (for example, to exercise Cedar policies), use the agent's `serve` target. Without `LOCAL_DEV` set, the client resolves the deployed Gateway URL from runtime configuration and SigV4-signs requests with your local AWS credentials:
|
|
179
179
|
|
|
180
180
|
<NxCommands commands={["<agent-name>-serve <project-name>"]} />
|
|
181
181
|
|
|
@@ -62,7 +62,7 @@ The client suffix matches your agent's framework (`_strands` or `_langchain`).
|
|
|
62
62
|
Additionally, the generator:
|
|
63
63
|
- Transforms your agent's `agent.py` to import and use the MCP server's tools via a class-based client
|
|
64
64
|
- Adds the `agent_connection` project as a workspace dependency of your agent project
|
|
65
|
-
- Updates the agent's `
|
|
65
|
+
- Updates the agent's `dev` target to depend on the MCP server's serve target
|
|
66
66
|
|
|
67
67
|
## Using the Connected MCP Server
|
|
68
68
|
|
|
@@ -165,12 +165,12 @@ The MCP server's AgentCore runtime ARN is automatically registered in the `agent
|
|
|
165
165
|
|
|
166
166
|
## Local Development
|
|
167
167
|
|
|
168
|
-
The generator configures the agent's `
|
|
168
|
+
The generator configures the agent's `dev` target to:
|
|
169
169
|
1. Start the connected MCP server(s) automatically
|
|
170
|
-
2. Set `
|
|
170
|
+
2. Set `LOCAL_DEV=true` so the generated client uses direct HTTP transport instead of AgentCore
|
|
171
171
|
|
|
172
172
|
Run the agent locally with:
|
|
173
173
|
|
|
174
|
-
<NxCommands commands={["<agent-name>-
|
|
174
|
+
<NxCommands commands={["<agent-name>-dev <project-name>"]} />
|
|
175
175
|
|
|
176
176
|
This will start both the agent and all connected MCP servers, with the agent connecting to the MCP servers directly via HTTP on their assigned local ports.
|
|
@@ -33,7 +33,7 @@ Select your FastAPI project as the source and your DynamoDB project as the targe
|
|
|
33
33
|
|
|
34
34
|
## Generator Output
|
|
35
35
|
|
|
36
|
-
The generator updates the FastAPI's `project.json` to add a dependency from its `
|
|
36
|
+
The generator updates the FastAPI's `project.json` to add a dependency from its `dev` target to the DynamoDB project's `dev` target, and adds the DynamoDB package as a workspace dependency. No source files are modified.
|
|
37
37
|
|
|
38
38
|
## Using DynamoDB in Route Handlers
|
|
39
39
|
|
|
@@ -34,7 +34,7 @@ Select your MCP server project as the source and your DynamoDB project as the ta
|
|
|
34
34
|
|
|
35
35
|
## Generator Output
|
|
36
36
|
|
|
37
|
-
The generator updates the MCP server's `<mcp-server-name>-
|
|
37
|
+
The generator updates the MCP server's `<mcp-server-name>-dev` target in `project.json` to depend on the DynamoDB project's `dev` target, and adds the DynamoDB package as a workspace dependency. No source files are modified.
|
|
38
38
|
|
|
39
39
|
## Using DynamoDB in Tools
|
|
40
40
|
|
|
@@ -71,7 +71,7 @@ The following dependencies are added to the root `package.json`:
|
|
|
71
71
|
Each `useAgui<AgentName>` hook reads its agent's runtime value from <Link path="guides/runtime-config">Runtime Configuration</Link> and instantiates an `@ag-ui/client` `HttpAgent`:
|
|
72
72
|
|
|
73
73
|
- **Deployed**: the runtime value is a Bedrock AgentCore Runtime ARN, which is converted to the AgentCore HTTPS endpoint: `https://bedrock-agentcore.<region>.amazonaws.com/runtimes/<encoded-arn>/invocations?qualifier=DEFAULT`
|
|
74
|
-
- **Local development**: `
|
|
74
|
+
- **Local development**: `dev` overrides the value to the agent's local URL (e.g. `http://localhost:8081`)
|
|
75
75
|
|
|
76
76
|
The shared `AguiProvider` calls every generated hook and spreads each one into `selfManagedAgents` on a single `CopilotKitProvider`, which exposes them all to CopilotKit components.
|
|
77
77
|
|
|
@@ -218,13 +218,13 @@ Deeper overrides follow the same shape — e.g. replace just the copy button on
|
|
|
218
218
|
|
|
219
219
|
## Local Development
|
|
220
220
|
|
|
221
|
-
The connection generator automatically configures `
|
|
221
|
+
The connection generator automatically configures `dev` integration:
|
|
222
222
|
|
|
223
|
-
1. Running `nx
|
|
223
|
+
1. Running `nx dev <website>` will also start the agent's local server
|
|
224
224
|
2. The runtime config is overridden to point to the local AG-UI URL (e.g. `http://localhost:8081`)
|
|
225
225
|
3. Both the website and the agent hot-reload together
|
|
226
226
|
|
|
227
|
-
<NxCommands commands={['
|
|
227
|
+
<NxCommands commands={['dev <WebsiteProject>']} />
|
|
228
228
|
|
|
229
229
|
:::tip[Hot Reloading]
|
|
230
230
|
The website and connected agent hot-reload together, enabling you to quickly iterate on both sides without deploying to AWS.
|
|
@@ -115,9 +115,9 @@ Whenever you make changes to your FastAPI, you need to rebuild your project in o
|
|
|
115
115
|
:::
|
|
116
116
|
|
|
117
117
|
:::tip[Auto-Regeneration]
|
|
118
|
-
If you're actively working on both your React application and FastAPI together, use the React application's `
|
|
118
|
+
If you're actively working on both your React application and FastAPI together, use the React application's `dev` target which will automatically regenerate the client whenever your API changes, as well as hot-reloading your website and local FastAPI server:
|
|
119
119
|
|
|
120
|
-
<NxCommands commands={['
|
|
120
|
+
<NxCommands commands={['dev <WebsiteProject>']} />
|
|
121
121
|
|
|
122
122
|
For more fine-grained control, you can use the `watch-generate:<ApiName>-client` target for your React application to regenerate the client every time you make API changes:
|
|
123
123
|
|
|
@@ -177,13 +177,13 @@ function ChatComponent() {
|
|
|
177
177
|
|
|
178
178
|
## Local Development
|
|
179
179
|
|
|
180
|
-
The connection generator automatically configures `
|
|
180
|
+
The connection generator automatically configures `dev` integration:
|
|
181
181
|
|
|
182
|
-
1. Running `nx
|
|
182
|
+
1. Running `nx dev <website>` will also start the agent's local FastAPI server
|
|
183
183
|
2. The runtime config is overridden to point to the local HTTP URL (e.g., `http://localhost:8081/`)
|
|
184
184
|
3. The TypeScript client is automatically regenerated when the agent's API changes
|
|
185
185
|
|
|
186
|
-
<NxCommands commands={['
|
|
186
|
+
<NxCommands commands={['dev <WebsiteProject>']} />
|
|
187
187
|
|
|
188
188
|
:::tip[Hot Reloading]
|
|
189
189
|
The website and connected agent will hot-reload, enabling you to quickly iterate on both together without deploying to AWS.
|
|
@@ -116,9 +116,9 @@ Whenever you make changes to your Smithy API model, you need to rebuild your pro
|
|
|
116
116
|
:::
|
|
117
117
|
|
|
118
118
|
:::tip[Auto-Regeneration]
|
|
119
|
-
If you're actively working on both your React application and Smithy API together, use the React application's `
|
|
119
|
+
If you're actively working on both your React application and Smithy API together, use the React application's `dev` target which will automatically regenerate the client whenever your API changes, as well as hot-reloading your website and local Smithy API server:
|
|
120
120
|
|
|
121
|
-
<NxCommands commands={['
|
|
121
|
+
<NxCommands commands={['dev <WebsiteProject>']} />
|
|
122
122
|
|
|
123
123
|
For more fine-grained control, you can use the `watch-generate:<ApiName>-client` target for your React application to regenerate the client every time you make API changes:
|
|
124
124
|
|
|
@@ -64,13 +64,13 @@ Additionally, it installs the required dependencies:
|
|
|
64
64
|
The generated client connects to your Agent via tRPC over WebSocket. The agent exposes a tRPC router (including the `invoke` subscription for streaming agent responses) over a WebSocket endpoint.
|
|
65
65
|
|
|
66
66
|
- **Deployed**: The agent runtime ARN is loaded from <Link path="guides/runtime-config">Runtime Configuration</Link>. Running this connection generator also patches the agent's generated CDK/Terraform construct to publish its ARN to the website's `runtime-config.json` (under the `connection` namespace), so only agents you explicitly connect are exposed to the frontend. The ARN is converted to a WebSocket URL following the Bedrock AgentCore Runtime WebSocket protocol: `wss://bedrock-agentcore.<region>.amazonaws.com/runtimes/<encoded-arn>/ws`
|
|
67
|
-
- **Local development**: When running with `
|
|
67
|
+
- **Local development**: When running with `dev`, the runtime config override sets the value to a local `ws://` URL (e.g., `ws://localhost:8081/ws`), and the client connects directly
|
|
68
68
|
|
|
69
69
|
### Authentication
|
|
70
70
|
|
|
71
71
|
The generated code handles authentication depending on your agent's configuration:
|
|
72
72
|
|
|
73
|
-
- **IAM** (default): Uses AWS SigV4 presigned URLs to authenticate the WebSocket connection. Credentials are obtained from the Cognito Identity Pool configured with your website's auth. In `
|
|
73
|
+
- **IAM** (default): Uses AWS SigV4 presigned URLs to authenticate the WebSocket connection. Credentials are obtained from the Cognito Identity Pool configured with your website's auth. In `dev` mode, signing is automatically skipped when <Link path="guides/react-website#runtime-configuration">`runtime-config.json`</Link> is not present
|
|
74
74
|
- **Cognito**: Embeds the JWT access token in the `Sec-WebSocket-Protocol` header as a base64url-encoded bearer token, following the [AgentCore WebSocket auth protocol](https://docs.aws.amazon.com/bedrock-agentcore/latest/devguide/runtime-get-started-websocket.html)
|
|
75
75
|
|
|
76
76
|
|
|
@@ -174,11 +174,11 @@ For more details on the vanilla tRPC client, see the [tRPC Vanilla Client docume
|
|
|
174
174
|
|
|
175
175
|
## Local Development
|
|
176
176
|
|
|
177
|
-
The connection generator automatically configures `
|
|
177
|
+
The connection generator automatically configures `dev` integration for your react website:
|
|
178
178
|
|
|
179
|
-
1. Running `nx
|
|
179
|
+
1. Running `nx dev <website>` will also start the agent's local server
|
|
180
180
|
2. The runtime config is overridden to point to the local WebSocket URL (e.g., `ws://localhost:8081/ws`)
|
|
181
|
-
3. Like with connected APIs, authentication is skipped in `
|
|
181
|
+
3. Like with connected APIs, authentication is skipped in `dev` mode when <Link path="guides/react-website#runtime-configuration">`runtime-config.json`</Link> is not present
|
|
182
182
|
|
|
183
183
|
:::tip[Hot Reloading]
|
|
184
184
|
The website and connected agent will hot-reload, enabling you to quickly iterate on both together without deploying to AWS.
|
|
@@ -35,7 +35,7 @@ Select your Smithy API backend project as the source and your DynamoDB project a
|
|
|
35
35
|
|
|
36
36
|
## Generator Output
|
|
37
37
|
|
|
38
|
-
The generator updates your Smithy API's `project.json` to add a dependency from its `
|
|
38
|
+
The generator updates your Smithy API's `project.json` to add a dependency from its `dev` target to the DynamoDB project's `dev` target. No source files are modified.
|
|
39
39
|
|
|
40
40
|
## Using DynamoDB in Operations
|
|
41
41
|
|
|
@@ -46,7 +46,7 @@ The generator modifies three existing files in your Smithy API backend:
|
|
|
46
46
|
|
|
47
47
|
</FileTree>
|
|
48
48
|
|
|
49
|
-
Additionally, it updates the API's `
|
|
49
|
+
Additionally, it updates the API's `dev` target to start the database automatically.
|
|
50
50
|
|
|
51
51
|
## How It Works
|
|
52
52
|
|
|
@@ -156,6 +156,6 @@ const server = createServer(async function (req, res) {
|
|
|
156
156
|
});
|
|
157
157
|
```
|
|
158
158
|
|
|
159
|
-
<NxCommands commands={["
|
|
159
|
+
<NxCommands commands={["dev <api-project-name>"]} />
|
|
160
160
|
|
|
161
|
-
This starts both the API and the local database. The `
|
|
161
|
+
This starts both the API and the local database. The `LOCAL_DEV=true` environment variable is set automatically, so the Prisma client connects to the local Docker database instead of Aurora.
|
|
@@ -35,7 +35,7 @@ Select your tRPC API project as the source and your DynamoDB project as the targ
|
|
|
35
35
|
|
|
36
36
|
## Generator Output
|
|
37
37
|
|
|
38
|
-
The generator updates your tRPC API's `project.json` to add a dependency from its `
|
|
38
|
+
The generator updates your tRPC API's `project.json` to add a dependency from its `dev` target to the DynamoDB project's `dev` target. No source files are modified.
|
|
39
39
|
|
|
40
40
|
## Using DynamoDB in Procedures
|
|
41
41
|
|
|
@@ -45,7 +45,7 @@ The generator creates a middleware file in your tRPC API project:
|
|
|
45
45
|
|
|
46
46
|
</FileTree>
|
|
47
47
|
|
|
48
|
-
Additionally, it updates your tRPC API's `
|
|
48
|
+
Additionally, it updates your tRPC API's `dev` target to start the database automatically when running locally.
|
|
49
49
|
|
|
50
50
|
## Using the Middleware
|
|
51
51
|
|
|
@@ -120,8 +120,8 @@ export const dbProcedure = t.procedure
|
|
|
120
120
|
|
|
121
121
|
## Local Development
|
|
122
122
|
|
|
123
|
-
The generator configures your tRPC API's `
|
|
123
|
+
The generator configures your tRPC API's `dev` target to depend on the database's `dev` target, so running:
|
|
124
124
|
|
|
125
|
-
<NxCommands commands={["
|
|
125
|
+
<NxCommands commands={["dev <api-project-name>"]} />
|
|
126
126
|
|
|
127
127
|
will automatically start the local database alongside your API.
|
|
@@ -61,7 +61,7 @@ The generator creates a shared `agent-connection` package and modifies your agen
|
|
|
61
61
|
|
|
62
62
|
Additionally, it:
|
|
63
63
|
- Transforms your agent's `agent.ts` to register the remote A2A agent as a Strands `tool`
|
|
64
|
-
- Updates the agent's `
|
|
64
|
+
- Updates the agent's `dev` target to depend on the target agent's `dev` target
|
|
65
65
|
- Installs required dependencies
|
|
66
66
|
|
|
67
67
|
## Using the Connected A2A Agent
|
|
@@ -90,7 +90,7 @@ export const getAgent = async (sessionId: string) => {
|
|
|
90
90
|
|
|
91
91
|
The `sessionId` parameter is plumbed through from the caller, ensuring consistency for [Bedrock AgentCore Observability](https://docs.aws.amazon.com/bedrock-agentcore/latest/devguide/observability.html).
|
|
92
92
|
|
|
93
|
-
Under the hood, `RemoteAgentClientStrands.create(sessionId)` returns a Strands `A2AAgent` configured with a SigV4-signing `clientFactory` when deployed to AWS, and a plain `http://localhost:<port>/` endpoint when `
|
|
93
|
+
Under the hood, `RemoteAgentClientStrands.create(sessionId)` returns a Strands `A2AAgent` configured with a SigV4-signing `clientFactory` when deployed to AWS, and a plain `http://localhost:<port>/` endpoint when `LOCAL_DEV=true`. The signing and endpoint resolution live in the framework-agnostic `agentcore-a2a-client-config.ts`; only the thin `agentcore-a2a-client-strands.ts` depends on Strands.
|
|
94
94
|
|
|
95
95
|
## Infrastructure
|
|
96
96
|
|
|
@@ -98,12 +98,12 @@ Under the hood, `RemoteAgentClientStrands.create(sessionId)` returns a Strands `
|
|
|
98
98
|
|
|
99
99
|
## Local Development
|
|
100
100
|
|
|
101
|
-
The generator configures the host agent's `
|
|
101
|
+
The generator configures the host agent's `dev` target to:
|
|
102
102
|
1. Start the connected A2A agent(s) automatically
|
|
103
|
-
2. Set `
|
|
103
|
+
2. Set `LOCAL_DEV=true` so the generated client connects directly to `http://localhost:<port>/` instead of AgentCore
|
|
104
104
|
|
|
105
105
|
Run the agent locally with:
|
|
106
106
|
|
|
107
|
-
<NxCommands commands={["<agent-name>-
|
|
107
|
+
<NxCommands commands={["<agent-name>-dev <project-name>"]} />
|
|
108
108
|
|
|
109
109
|
This will start both the host agent and all connected A2A agents, with the host agent calling the remote agents over plain HTTP on their assigned local ports.
|
|
@@ -35,7 +35,7 @@ Select your Agent project as the source and your DynamoDB project as the target.
|
|
|
35
35
|
|
|
36
36
|
## Generator Output
|
|
37
37
|
|
|
38
|
-
The generator updates the agent's `<agent-name>-
|
|
38
|
+
The generator updates the agent's `<agent-name>-dev` target in `project.json` to depend on the DynamoDB project's `dev` target. No source files are modified.
|
|
39
39
|
|
|
40
40
|
## Using DynamoDB in Agents
|
|
41
41
|
|
|
@@ -56,7 +56,7 @@ The generator emits shared core client files into your `agent-connection` packag
|
|
|
56
56
|
Additionally, the generator:
|
|
57
57
|
|
|
58
58
|
- Modifies your agent's `agent.ts` to import the Gateway client class, call `<Gateway>ClientStrands.create()`, and register the returned client in the `tools` array
|
|
59
|
-
- Wires the agent's `<agent>-
|
|
59
|
+
- Wires the agent's `<agent>-dev` target to depend on the Gateway's `dev` target
|
|
60
60
|
- Installs the required SigV4 / MCP dependencies
|
|
61
61
|
|
|
62
62
|
## Using the connected Gateway
|
|
@@ -76,7 +76,7 @@ export const getAgent = async () => {
|
|
|
76
76
|
};
|
|
77
77
|
```
|
|
78
78
|
|
|
79
|
-
When deployed (`
|
|
79
|
+
When deployed (`LOCAL_DEV` unset), the client points at the Gateway's MCP endpoint and authenticates with SigV4. When `LOCAL_DEV=true`, it points at the local gateway started by the Gateway project's `dev` target, so the same `agent.ts` works uniformly in both modes.
|
|
80
80
|
|
|
81
81
|
The session ID is propagated to downstream MCP servers automatically via the `X-Amzn-Bedrock-AgentCore-Runtime-Session-Id` header.
|
|
82
82
|
|
|
@@ -131,16 +131,16 @@ The Gateway URL is automatically registered in the `agentcore.gateways.<ClassNam
|
|
|
131
131
|
|
|
132
132
|
## Local Development
|
|
133
133
|
|
|
134
|
-
The generator configures the agent's `
|
|
134
|
+
The generator configures the agent's `dev` target to:
|
|
135
135
|
|
|
136
136
|
1. Start the connected Gateway's local gateway and every attached MCP server
|
|
137
|
-
2. Set `
|
|
137
|
+
2. Set `LOCAL_DEV=true` so the generated client points at the local gateway instead of the deployed Gateway
|
|
138
138
|
|
|
139
139
|
Run the agent locally with:
|
|
140
140
|
|
|
141
|
-
<NxCommands commands={["<agent-name>-
|
|
141
|
+
<NxCommands commands={["<agent-name>-dev <project-name>"]} />
|
|
142
142
|
|
|
143
|
-
To run the agent locally **against the deployed Gateway** instead (for example, to exercise Cedar policies), use the agent's `serve` target. Without `
|
|
143
|
+
To run the agent locally **against the deployed Gateway** instead (for example, to exercise Cedar policies), use the agent's `serve` target. Without `LOCAL_DEV` set, the client resolves the deployed Gateway URL from runtime configuration and SigV4-signs requests with your local AWS credentials:
|
|
144
144
|
|
|
145
145
|
<NxCommands commands={["<agent-name>-serve <project-name>"]} />
|
|
146
146
|
|
|
@@ -61,7 +61,7 @@ The generator creates a shared `agent-connection` package and modifies your agen
|
|
|
61
61
|
|
|
62
62
|
Additionally, it:
|
|
63
63
|
- Transforms your agent's `agent.ts` to import and use the MCP server's tools
|
|
64
|
-
- Updates the agent's `
|
|
64
|
+
- Updates the agent's `dev` target to depend on the MCP server's serve target
|
|
65
65
|
- Installs required dependencies
|
|
66
66
|
|
|
67
67
|
## Using the Connected MCP Server
|
|
@@ -136,12 +136,12 @@ The MCP server's AgentCore runtime ARN is automatically registered in the `agent
|
|
|
136
136
|
|
|
137
137
|
## Local Development
|
|
138
138
|
|
|
139
|
-
The generator configures the agent's `
|
|
139
|
+
The generator configures the agent's `dev` target to:
|
|
140
140
|
1. Start the connected MCP server(s) automatically
|
|
141
|
-
2. Set `
|
|
141
|
+
2. Set `LOCAL_DEV=true` so the generated client uses direct HTTP transport instead of AgentCore
|
|
142
142
|
|
|
143
143
|
Run the agent locally with:
|
|
144
144
|
|
|
145
|
-
<NxCommands commands={["<agent-name>-
|
|
145
|
+
<NxCommands commands={["<agent-name>-dev <project-name>"]} />
|
|
146
146
|
|
|
147
147
|
This will start both the agent and all connected MCP servers, with the agent connecting to the MCP servers directly via HTTP on their assigned local ports.
|