@aws/nx-plugin-mcp 1.0.0-rc.30 → 1.0.0-rc.32
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 +2 -2
- package/docs/guides/agentcore-gateway.mdx +1 -1
- package/docs/guides/connection/react-fastapi.mdx +36 -0
- package/docs/guides/ts-mcp-server.mdx +0 -1
- package/docs/guides/ts-nx-plugin.mdx +1 -1
- package/docs/snippets/agent/architecture.mdx +1 -1
- package/docs/snippets/connection/rdb-api-infrastructure.mdx +1 -0
- package/docs/snippets/mcp/architecture.mdx +1 -1
- package/package.json +1 -1
package/bin/aws-nx-mcp.js
CHANGED
|
@@ -20322,7 +20322,7 @@ const addCreateWorkspaceCommandTool = (server) => {
|
|
|
20322
20322
|
text: `Run the following command to create a workspace:
|
|
20323
20323
|
|
|
20324
20324
|
\`\`\`bash
|
|
20325
|
-
${buildCreateNxWorkspaceCommand(packageManager, "<workspace-name>"
|
|
20325
|
+
${buildCreateNxWorkspaceCommand(packageManager, "<workspace-name>")} --no-interactive
|
|
20326
20326
|
\`\`\`
|
|
20327
20327
|
|
|
20328
20328
|
This will create a new workspace within the \`<workspace-name>\` directory.
|
|
@@ -20330,7 +20330,7 @@ This will create a new workspace within the \`<workspace-name>\` directory.
|
|
|
20330
20330
|
If you are already inside an empty directory intended for this project, you can pass \`.\` as the workspace name to create the workspace in the current directory:
|
|
20331
20331
|
|
|
20332
20332
|
\`\`\`bash
|
|
20333
|
-
${buildCreateNxWorkspaceCommand(packageManager, "."
|
|
20333
|
+
${buildCreateNxWorkspaceCommand(packageManager, ".")} --no-interactive
|
|
20334
20334
|
\`\`\`
|
|
20335
20335
|
|
|
20336
20336
|
Note that this will prompt for an Infrastructure as Code provider (${IAC_PROVIDERS.join(", ")}).
|
|
@@ -97,7 +97,7 @@ waf: WAF {
|
|
|
97
97
|
|
|
98
98
|
gateway: AgentCore Gateway\n(MCP, IAM auth) {
|
|
99
99
|
shape: image
|
|
100
|
-
icon: /nx-plugin-for-aws/icons/aws/bedrock-agentcore.svg
|
|
100
|
+
icon: /nx-plugin-for-aws/icons/aws/bedrock-agentcore-gateway.svg
|
|
101
101
|
}
|
|
102
102
|
|
|
103
103
|
targets: Downstream MCP Servers\n(Gateway targets) {
|
|
@@ -312,6 +312,42 @@ function CreateItemForm() {
|
|
|
312
312
|
```
|
|
313
313
|
</Drawer>
|
|
314
314
|
|
|
315
|
+
### File Uploads
|
|
316
|
+
|
|
317
|
+
For endpoints that accept a file upload, the generated client sends the request as `FormData`. Define an operation with a `multipart/form-data` body in your FastAPI, for example using `UploadFile`:
|
|
318
|
+
|
|
319
|
+
```python
|
|
320
|
+
from fastapi import UploadFile
|
|
321
|
+
|
|
322
|
+
@app.post("/files")
|
|
323
|
+
async def upload_file(file: UploadFile, description: str = "") -> FileMetadata:
|
|
324
|
+
contents = await file.read()
|
|
325
|
+
...
|
|
326
|
+
```
|
|
327
|
+
|
|
328
|
+
Binary fields are typed as `Blob` on the generated client, and other fields (such as `description` above) keep their modelled types. Pass a `Blob` or `File` — for example one obtained from an `<input type="file">`:
|
|
329
|
+
|
|
330
|
+
```tsx {9-12}
|
|
331
|
+
import { useMutation } from '@tanstack/react-query';
|
|
332
|
+
import { useMyApi } from './hooks/useMyApi';
|
|
333
|
+
|
|
334
|
+
function UploadForm() {
|
|
335
|
+
const api = useMyApi();
|
|
336
|
+
const uploadFile = useMutation(api.uploadFile.mutationOptions());
|
|
337
|
+
|
|
338
|
+
const handleChange = (e: React.ChangeEvent<HTMLInputElement>) => {
|
|
339
|
+
const file = e.target.files?.[0];
|
|
340
|
+
if (file) {
|
|
341
|
+
uploadFile.mutate({ file, description: file.name });
|
|
342
|
+
}
|
|
343
|
+
};
|
|
344
|
+
|
|
345
|
+
return <input type="file" onChange={handleChange} />;
|
|
346
|
+
}
|
|
347
|
+
```
|
|
348
|
+
|
|
349
|
+
The client builds a `FormData` body and lets `fetch` set the `Content-Type` (including the multipart boundary) automatically.
|
|
350
|
+
|
|
315
351
|
### Pagination with Infinite Queries
|
|
316
352
|
|
|
317
353
|
For endpoints that accept a `cursor` parameter as input, the generated hooks provide support for infinite queries using TanStack Query's `useInfiniteQuery` hook. This makes it easy to implement "load more" or infinite scrolling functionality.
|
|
@@ -56,7 +56,6 @@ The generator will add the following files to your existing TypeScript project:
|
|
|
56
56
|
- resources/
|
|
57
57
|
- sample-guidance.ts Sample resource
|
|
58
58
|
- Dockerfile Entry point for hosting your MCP server (excluded when `infra` is set to `None`)
|
|
59
|
-
- package.json Updated with bin entry and MCP dependencies
|
|
60
59
|
- project.json Updated with MCP server serve target
|
|
61
60
|
</FileTree>
|
|
62
61
|
|
|
@@ -46,7 +46,7 @@ The generator will create the following project structure:
|
|
|
46
46
|
- generator-guide.ts Tool for detailed generator information
|
|
47
47
|
- utils.ts Utility functions for the MCP server
|
|
48
48
|
- generators.json Nx generator configuration (initially empty)
|
|
49
|
-
- package.json Plugin package configuration
|
|
49
|
+
- package.json Plugin package configuration
|
|
50
50
|
- tsconfig.json TypeScript configuration (CommonJS for Nx compatibility)
|
|
51
51
|
- project.json Nx project configuration with build and package targets
|
|
52
52
|
</FileTree>
|