@aws/nx-plugin-mcp 1.12.0 → 1.12.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/docs/get_started/tutorials/dungeon-game/1.mdx +1 -0
- package/docs/guides/agentcore-gateway.mdx +2 -0
- package/docs/guides/local-development.mdx +6 -0
- package/docs/guides/py-mcp-server.mdx +2 -0
- package/docs/guides/react-website-auth-idp.mdx +2 -2
- package/docs/guides/ts-agent.mdx +2 -0
- package/docs/guides/ts-mcp-server.mdx +2 -0
- package/docs/guides/ts-smithy-api.mdx +2 -0
- package/package.json +1 -1
- package/src/ts/react-website/cognito-auth/schema.json +2 -1
- package/src/ts/website/auth/schema.json +2 -1
|
@@ -839,6 +839,7 @@ export class StoryAgent extends Construct implements IGrantable, IConnectable {
|
|
|
839
839
|
},
|
|
840
840
|
...restProps,
|
|
841
841
|
environmentVariables: {
|
|
842
|
+
HOST: '0.0.0.0',
|
|
842
843
|
RUNTIME_CONFIG_APP_ID: rc.appConfigApplicationId,
|
|
843
844
|
...restProps?.environmentVariables,
|
|
844
845
|
},
|
|
@@ -336,6 +336,8 @@ The generator adds a `dev` target to the Gateway project, which runs `local-dev.
|
|
|
336
336
|
|
|
337
337
|
<NxCommands commands={["dev <name>"]} />
|
|
338
338
|
|
|
339
|
+
The local gateway listens on the address in `HOST`, which defaults to `127.0.0.1`, so it accepts connections only from your own machine. See <Link path="guides/local-development#bind-address">Bind address</Link> to reach it from another machine.
|
|
340
|
+
|
|
339
341
|
<OptionFilter when={{ protocol: 'mcp' }} description="MCP aggregator local gateway">
|
|
340
342
|
The local gateway exposes 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.
|
|
341
343
|
</OptionFilter>
|
|
@@ -85,3 +85,9 @@ Your workspace's root `package.json` includes a `dev` script that runs `nx run-m
|
|
|
85
85
|
:::
|
|
86
86
|
|
|
87
87
|
For more detail on each project type's local development server, see the relevant guide — for example the <Link path="guides/react-website#local-development-server">React Website</Link> guide.
|
|
88
|
+
|
|
89
|
+
## Bind address
|
|
90
|
+
|
|
91
|
+
Local HTTP servers for APIs, agents, MCP servers and gateways listen on `127.0.0.1`, so they accept connections only from your own machine. To reach one from another machine, a VM or a container, set `HOST=0.0.0.0` on its `serve` or `dev` target, which makes it reachable, unauthenticated, by anything that can reach your machine. A Python MCP server also needs `--host 0.0.0.0` on its `uvicorn` command, and a server started with `fastapi dev`, such as a Python agent or a Lambda backed FastAPI, takes `--host 0.0.0.0` on that command instead of `HOST`. Deployed runtimes set `HOST=0.0.0.0` for you.
|
|
92
|
+
|
|
93
|
+
With `HOST` unset, a Python MCP server also rejects requests whose `Host` header is not `localhost`, `127.0.0.1` or `[::1]`, which guards it against DNS rebinding. Setting `HOST=0.0.0.0` turns that check off.
|
|
@@ -129,6 +129,8 @@ If you have added multiple components to your project (MCP servers, agents, etc.
|
|
|
129
129
|
|
|
130
130
|
<NxCommands commands={['your-server-name-dev your-project']} />
|
|
131
131
|
|
|
132
|
+
The server listens on `127.0.0.1`, so it accepts connections only from your own machine, and with `HOST` unset it rejects requests whose `Host` header is not `localhost`, `127.0.0.1` or `[::1]`. To reach it from another machine, add `--host 0.0.0.0` to its `uvicorn` command and set `HOST=0.0.0.0` on the target, which turns that check off. The deployed image does both. See <Link path="guides/local-development#bind-address">Bind address</Link> for more.
|
|
133
|
+
|
|
132
134
|
### Inspector
|
|
133
135
|
|
|
134
136
|
The generator configures a target named `<your-server-name>-inspect`, which starts your MCP server locally (via the `<your-server-name>-dev` target, including any connected dependencies such as a local database) and launches the [MCP Inspector](https://github.com/modelcontextprotocol/inspector) pre-configured to connect to it over Streamable HTTP transport.
|
|
@@ -261,10 +261,10 @@ Follow these steps in this order. The generator also prints them when it finishe
|
|
|
261
261
|
|
|
262
262
|
<Infrastructure>
|
|
263
263
|
<Fragment slot="cdk">
|
|
264
|
-
The stack that contains `UserIdentity` has an output whose key starts with `<id>OidcIdentityProvidersIdpRedirectUri`, where `<id>` is the construct ID you gave `UserIdentity`, for example `IdentityOidcIdentityProvidersIdpRedirectUri`.
|
|
264
|
+
The stack that contains `UserIdentity` has an output whose key starts with `<id>OidcIdentityProvidersIdpRedirectUri`, where `<id>` is the construct ID you gave `UserIdentity`, for example `IdentityOidcIdentityProvidersIdpRedirectUri`. To get it before you deploy, put the `Domain` of the `AWS::Cognito::UserPoolDomain` resource in your `cdk synth` output into the URI below. If your app has stages, select one with `cdk synth '<stage>/*'`, or read the template from `cdk.out`.
|
|
265
265
|
|
|
266
266
|
```
|
|
267
|
-
https://<
|
|
267
|
+
https://<Domain>.auth.<region>.amazoncognito.com/oauth2/idpresponse
|
|
268
268
|
```
|
|
269
269
|
</Fragment>
|
|
270
270
|
<Fragment slot="terraform">
|
package/docs/guides/ts-agent.mdx
CHANGED
|
@@ -288,6 +288,8 @@ If you have added multiple components to your project (agents, MCP servers, etc.
|
|
|
288
288
|
|
|
289
289
|
This uses `tsx --watch` to automatically restart the server when files change. The agent will be available at `http://localhost:8081` (or the assigned port if you have multiple agents — read it from `metadata.ports` in the project's `project.json`).
|
|
290
290
|
|
|
291
|
+
The agent listens on the address in `HOST`, which defaults to `127.0.0.1`, so it accepts connections only from your own machine. The deployed image sets `HOST=0.0.0.0`. See <Link path="guides/local-development#bind-address">Bind address</Link> to reach it from another machine.
|
|
292
|
+
|
|
291
293
|
A `<your-agent-name>-serve` target is also generated, which runs the agent against your deployed infrastructure and therefore requires `RUNTIME_CONFIG_APP_ID` to be set. See the <Link path="guides/local-development">Local Development</Link> guide for the difference between `dev` and `serve`.
|
|
292
294
|
|
|
293
295
|
### Chat with Your Agent
|
|
@@ -186,6 +186,8 @@ If you have added multiple components to your project (MCP servers, agents, etc.
|
|
|
186
186
|
|
|
187
187
|
<NxCommands commands={['your-server-name-dev your-project']} />
|
|
188
188
|
|
|
189
|
+
The server listens on the address in `HOST`, which defaults to `127.0.0.1`, so it accepts connections only from your own machine. The deployed image sets `HOST=0.0.0.0`. See <Link path="guides/local-development#bind-address">Bind address</Link> to reach it from another machine.
|
|
190
|
+
|
|
189
191
|
### Inspector
|
|
190
192
|
|
|
191
193
|
The generator configures a target named `<your-server-name>-inspect`, which starts your MCP server locally (via the `<your-server-name>-dev` target, including any connected dependencies such as a local database) and launches the [MCP Inspector](https://github.com/modelcontextprotocol/inspector) pre-configured to connect to it over Streamable HTTP transport.
|
|
@@ -623,6 +623,8 @@ The generator configures a local development server with hot reloading:
|
|
|
623
623
|
|
|
624
624
|
<NxCommands commands={['serve <backend-project>']} />
|
|
625
625
|
|
|
626
|
+
The local server listens on the address in `HOST`, which defaults to `127.0.0.1`, so it accepts connections only from your own machine. See <Link path="guides/local-development#bind-address">Bind address</Link> to reach it from another machine.
|
|
627
|
+
|
|
626
628
|
:::tip[Hot Reloading]
|
|
627
629
|
The local server will not only hot-reload when you make TypeScript changes to your backend code, but will reload when you make changes to your Smithy model project, allowing you to continuously iterate on your Smithy model and server together.
|
|
628
630
|
:::
|
package/package.json
CHANGED
|
@@ -27,8 +27,9 @@
|
|
|
27
27
|
"cognitoDomain": {
|
|
28
28
|
"description": "The cognito domain prefix to use. If omitted, a value is derived from the npm scope and website project name.",
|
|
29
29
|
"type": "string",
|
|
30
|
+
"maxLength": 41,
|
|
30
31
|
"x-priority": "important",
|
|
31
|
-
"x-prompt": "the cognito domain prefix to use
|
|
32
|
+
"x-prompt": "the cognito domain prefix to use, at most 41 characters, e.g. https://{{cognitoDomain}}-123456789012-a1b2c3d4.auth.ap-southeast-2.amazoncognito.com (leave blank to derive from scope and project name)"
|
|
32
33
|
},
|
|
33
34
|
"allowSignup": {
|
|
34
35
|
"description": "Whether to allow self-signup",
|
|
@@ -23,8 +23,9 @@
|
|
|
23
23
|
"cognitoDomain": {
|
|
24
24
|
"description": "The cognito domain prefix to use. If omitted, a value is derived from the npm scope and website project name.",
|
|
25
25
|
"type": "string",
|
|
26
|
+
"maxLength": 41,
|
|
26
27
|
"x-priority": "important",
|
|
27
|
-
"x-prompt": "the cognito domain prefix to use
|
|
28
|
+
"x-prompt": "the cognito domain prefix to use, at most 41 characters, e.g. https://{{cognitoDomain}}-123456789012-a1b2c3d4.auth.ap-southeast-2.amazoncognito.com (leave blank to derive from scope and project name)"
|
|
28
29
|
},
|
|
29
30
|
"allowSignup": {
|
|
30
31
|
"description": "Whether to allow self-signup",
|