This generator is used to connect projects together, such as websites calling APIs. Simply select the source project (for example the project that will call your API) and target project (for example your API project), and this generator will handle integrating the two.
Install the Nx Console VSCode Plugin if you haven't already Open the Nx Console in VSCode Click Generate (UI) in the "Common Nx Commands" section Search for @aws/nx-plugin - connection Fill in the required parameters Click Generate pnpm nx g @aws/nx-plugin:connection
yarn nx g @aws/nx-plugin:connection
npx nx g @aws/nx-plugin:connection
bunx nx g @aws/nx-plugin:connection
You can also perform a dry-run to see what files would be changed pnpm nx g @aws/nx-plugin:connection --dry-run
yarn nx g @aws/nx-plugin:connection --dry-run
npx nx g @aws/nx-plugin:connection --dry-run
bunx nx g @aws/nx-plugin:connection --dry-run
Parameter Type Default Description sourceProject Required string - The source project targetProject Required string - The target project to connect to sourceComponent string - The source component to connect from (component name, path relative to source project root, or generator id). Use '.' to explicitly select the project as the source. targetComponent string - The target component to connect to (component name, path relative to target project root, or generator id). Use '.' to explicitly select the project as the target. preferInstallDependencies boolean true Whether to prefer installing dependencies after the generator runs. Set to false to defer installing when batching multiple generators (an install still runs if needed so subsequent generators can compute the Nx project graph); install once at the end.
The Connection generator supports the following connections:
React to tRPC Call a tRPC API from a React website React to FastAPI Call a Python FastAPI from a React website React to Smithy API Call a Smithy API from a React website React to Python Agent Call a Python Agent from a React website React to TypeScript Agent Call a TypeScript Agent from a React website React to AG-UI Agent Call an Agent exposing the AG-UI protocol from a React website via CopilotKit Python Agent to MCP Connect a Python Agent to an MCP server TypeScript Agent to MCP Connect a TypeScript Agent to an MCP server Python Agent to A2A Agent Connect a Python Agent to a remote A2A agent TypeScript Agent to A2A Agent Connect a TypeScript Agent to a remote A2A agent tRPC API to Relational Database Connect a tRPC API to an Aurora relational database Smithy API to Relational Database Connect a Smithy API to an Aurora relational database TypeScript Agent to Relational Database Connect a TypeScript Agent to an Aurora relational database TypeScript MCP Server to Relational Database Connect a TypeScript MCP Server to an Aurora relational database FastAPI to Python Relational Database Connect a FastAPI to a Python Aurora relational database Python Agent to Python Relational Database Connect a Python Agent to a Python Aurora relational database Python MCP Server to Python Relational Database Connect a Python MCP Server to a Python Aurora relational database tRPC API to TypeScript DynamoDB Connect a tRPC API to a DynamoDB table Smithy API to TypeScript DynamoDB Connect a Smithy API to a DynamoDB table TypeScript Agent to TypeScript DynamoDB Connect a TypeScript Agent to a DynamoDB table MCP Server to TypeScript DynamoDB Connect a TypeScript MCP Server to a DynamoDB table FastAPI to Python DynamoDB Connect a FastAPI to a DynamoDB table Python Agent to Python DynamoDB Connect a Python Agent to a DynamoDB table Python MCP Server to Python DynamoDB Connect a Python MCP Server to a DynamoDB table AgentCore Gateway to MCP Server Aggregate an MCP server behind an AgentCore Gateway AgentCore Gateway to AgentCore Gateway Aggregate an AgentCore Gateway behind another AgentCore Gateway TypeScript Agent to AgentCore Gateway Connect a TypeScript Agent to an AgentCore Gateway Python Agent to AgentCore Gateway Connect a Python Agent to an AgentCore Gateway
Runtime Configuration
The connection generator makes use of Runtime Configuration to pass deploy-time values (such as API URLs, Cognito settings, and agent runtime ARNs) between generated projects and components at runtime so they can discover and connect to one another.