跳转到内容

连接

该生成器用于将项目连接在一起,例如网站调用 API。只需选择源项目(例如将调用您的 API 的项目)和目标项目(例如您的 API 项目),该生成器将处理两者的集成。

  1. 安装 Nx Console VSCode Plugin 如果您尚未安装
  2. 在VSCode中打开Nx控制台
  3. 点击 Generate (UI) 在"Common Nx Commands"部分
  4. 搜索 @aws/nx-plugin - connection
  5. 填写必需参数
    • 点击 Generate
    参数类型默认值描述
    sourceProject 必需string-源项目
    targetProject 必需string-要连接到的目标项目
    sourceComponent string-要从其连接的源组件(组件名称、相对于源项目根目录的路径或生成器 ID)。使用 '.' 显式选择项目作为源。
    targetComponent string-要连接到的目标组件(组件名称、相对于目标项目根目录的路径或生成器 ID)。使用 '.' 显式选择项目作为目标。
    preferInstallDependencies booleantrue是否在生成器运行后优先安装依赖项。设置为 false 可在批量运行多个生成器时延迟安装(如果后续生成器需要计算 Nx 项目图,仍会运行安装);在最后统一安装一次。

    连接生成器支持以下连接:

    tRPC
    React to tRPC从 React 网站调用 tRPC API
    FastAPI
    React to FastAPI从 React 网站调用 Python FastAPI
    Smithy
    React to Smithy API从 React 网站调用 Smithy API
    Strands AgentsPython
    React to Python Agent从 React 网站调用 Python Agent
    Strands AgentsTypeScript
    React to TypeScript Agent从 React 网站调用 TypeScript Agent
    CopilotKit
    React to AG-UI Agent通过 CopilotKit 从 React 网站调用公开 AG-UI 协议的 Agent
    Strands AgentsPythonModel Context Protocol
    Python Agent to MCP将 Python Agent 连接到 MCP 服务器
    Strands AgentsTypeScriptModel Context Protocol
    TypeScript Agent to MCP将 TypeScript Agent 连接到 MCP 服务器
    Strands AgentsPythonAgent2Agent
    Python Agent to A2A Agent将 Python Agent 连接到远程 A2A agent
    Strands AgentsTypeScriptAgent2Agent
    TypeScript Agent to A2A Agent将 TypeScript Agent 连接到远程 A2A agent
    tRPCAmazon Aurora
    tRPC API to Relational Database将 tRPC API 连接到 Aurora 关系数据库
    SmithyAmazon Aurora
    Smithy API to Relational Database将 Smithy API 连接到 Aurora 关系数据库
    Strands AgentsTypeScriptAmazon Aurora
    TypeScript Agent to Relational Database将 TypeScript Agent 连接到 Aurora 关系数据库
    Model Context ProtocolTypeScriptAmazon Aurora
    TypeScript MCP Server to Relational Database将 TypeScript MCP Server 连接到 Aurora 关系数据库
    FastAPIAmazon AuroraPython
    FastAPI to Python Relational Database将 FastAPI 连接到 Python Aurora 关系数据库
    Strands AgentsPythonAmazon AuroraPython
    Python Agent to Python Relational Database将 Python Agent 连接到 Python Aurora 关系数据库
    Model Context ProtocolPythonAmazon AuroraPython
    Python MCP Server to Python Relational Database将 Python MCP Server 连接到 Python Aurora 关系数据库
    tRPCAmazon DynamoDB
    tRPC API to TypeScript DynamoDB将 tRPC API 连接到 DynamoDB 表
    SmithyAmazon DynamoDB
    Smithy API to TypeScript DynamoDB将 Smithy API 连接到 DynamoDB 表
    Strands AgentsTypeScriptAmazon DynamoDB
    TypeScript Agent to TypeScript DynamoDB将 TypeScript Agent 连接到 DynamoDB 表
    Model Context ProtocolTypeScriptAmazon DynamoDB
    MCP Server to TypeScript DynamoDB将 TypeScript MCP Server 连接到 DynamoDB 表
    FastAPIAmazon DynamoDBPython
    FastAPI to Python DynamoDB将 FastAPI 连接到 DynamoDB 表
    Strands AgentsPythonAmazon DynamoDBPython
    Python Agent to Python DynamoDB将 Python Agent 连接到 DynamoDB 表
    Model Context ProtocolPythonAmazon DynamoDBPython
    Python MCP Server to Python DynamoDB将 Python MCP Server 连接到 DynamoDB 表
    Amazon Bedrock AgentCore GatewayModel Context Protocol
    AgentCore Gateway to MCP Server在 AgentCore Gateway 后聚合 MCP 服务器
    Amazon Bedrock AgentCore GatewayAmazon Bedrock AgentCore Gateway
    AgentCore Gateway to AgentCore Gateway在另一个 AgentCore Gateway 后聚合 AgentCore Gateway
    Strands AgentsTypeScriptAmazon Bedrock AgentCore Gateway
    TypeScript Agent to AgentCore Gateway将 TypeScript Agent 连接到 AgentCore Gateway
    Strands AgentsPythonAmazon Bedrock AgentCore Gateway
    Python Agent to AgentCore Gateway将 Python Agent 连接到 AgentCore Gateway