@aws/nx-plugin-mcp 1.0.0-rc.18 → 1.0.0-rc.19
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/guides/connection/py-agent-a2a.mdx +8 -5
- package/docs/guides/connection/py-agent-gateway.mdx +8 -5
- package/docs/guides/connection/py-agent-mcp.mdx +7 -4
- package/docs/guides/connection/ts-agent-a2a.mdx +8 -5
- package/docs/guides/connection/ts-agent-gateway.mdx +7 -5
- package/docs/guides/connection/ts-agent-mcp.mdx +7 -4
- package/docs/guides/trpc.mdx +1 -1
- package/package.json +1 -1
|
@@ -48,9 +48,12 @@ The generator creates a shared `agent_connection` Python project at `packages/co
|
|
|
48
48
|
- \<scope>\_agent\_connection
|
|
49
49
|
- \_\_init\_\_.py Re-exports per-connection clients
|
|
50
50
|
- core
|
|
51
|
-
- agentcore\
|
|
51
|
+
- agentcore\_endpoints.py Framework-agnostic ARN/URL resolution
|
|
52
|
+
- agentcore\_a2a\_client\_config.py Framework-agnostic A2A client config (signed `ClientConfig`)
|
|
53
|
+
- agentcore\_a2a\_client\_strands.py Strands A2A client wrapping the config
|
|
54
|
+
- auth/ Framework-agnostic SigV4 / session-forwarding `httpx.Auth`
|
|
52
55
|
- app
|
|
53
|
-
- \<target\_agent\_name>\_client.py Per-connection client for each A2A agent
|
|
56
|
+
- \<target\_agent\_name>\_client\_strands.py Per-connection Strands client for each A2A agent
|
|
54
57
|
|
|
55
58
|
</FileTree>
|
|
56
59
|
|
|
@@ -67,11 +70,11 @@ The generator transforms your agent's `agent.py` to wrap the remote A2A agent as
|
|
|
67
70
|
from contextlib import contextmanager
|
|
68
71
|
from strands import Agent, tool
|
|
69
72
|
|
|
70
|
-
from my_scope_agent_connection import
|
|
73
|
+
from my_scope_agent_connection import RemoteAgentClientStrands
|
|
71
74
|
|
|
72
75
|
@contextmanager
|
|
73
76
|
def get_agent(session_id: str):
|
|
74
|
-
remote_agent =
|
|
77
|
+
remote_agent = RemoteAgentClientStrands.create(session_id=session_id)
|
|
75
78
|
|
|
76
79
|
@tool
|
|
77
80
|
def ask_remote_agent(prompt: str) -> str:
|
|
@@ -86,7 +89,7 @@ def get_agent(session_id: str):
|
|
|
86
89
|
|
|
87
90
|
The `session_id` parameter is plumbed through from the caller, ensuring consistency for [Bedrock AgentCore Observability](https://docs.aws.amazon.com/bedrock-agentcore/latest/devguide/observability.html).
|
|
88
91
|
|
|
89
|
-
Under the hood, `
|
|
92
|
+
Under the hood, `RemoteAgentClientStrands.create(session_id=...)` returns a Strands `A2AAgent` configured with an `httpx.AsyncClient` that signs requests with SigV4 when deployed to AWS, and a plain `http://localhost:<port>/` endpoint when `SERVE_LOCAL=true`.
|
|
90
93
|
|
|
91
94
|
## Infrastructure
|
|
92
95
|
|
|
@@ -44,9 +44,12 @@ The generator emits shared core-gateway modules into your `agent_connection` Pyt
|
|
|
44
44
|
- packages/common/agent\_connection
|
|
45
45
|
- \<scope>\_agent\_connection
|
|
46
46
|
- core/
|
|
47
|
-
- agentcore\
|
|
47
|
+
- agentcore\_endpoints.py Framework-agnostic ARN/URL resolution
|
|
48
|
+
- agentcore\_gateway\_mcp\_transport.py Framework-agnostic Gateway MCP transport
|
|
49
|
+
- agentcore\_gateway\_mcp\_client\_strands.py Strands MCP client for the deployed Gateway
|
|
50
|
+
- auth/ Framework-agnostic SigV4 / session-forwarding `httpx.Auth`
|
|
48
51
|
- app/
|
|
49
|
-
- \<gateway\_snake>\_client.py Per-Gateway client wrapper
|
|
52
|
+
- \<gateway\_snake>\_client\_strands.py Per-Gateway Strands client wrapper
|
|
50
53
|
- \_\_init\_\_.py Re-exports the Gateway client
|
|
51
54
|
|
|
52
55
|
</FileTree>
|
|
@@ -65,11 +68,11 @@ The generator transforms your agent's `agent.py` to use the Gateway client:
|
|
|
65
68
|
from contextlib import contextmanager
|
|
66
69
|
from strands import Agent
|
|
67
70
|
|
|
68
|
-
from my_scope_agent_connection import
|
|
71
|
+
from my_scope_agent_connection import MyGatewayClientStrands
|
|
69
72
|
|
|
70
73
|
@contextmanager
|
|
71
74
|
def get_agent():
|
|
72
|
-
my_gateway =
|
|
75
|
+
my_gateway = MyGatewayClientStrands.create()
|
|
73
76
|
with (
|
|
74
77
|
my_gateway,
|
|
75
78
|
):
|
|
@@ -79,7 +82,7 @@ def get_agent():
|
|
|
79
82
|
)
|
|
80
83
|
```
|
|
81
84
|
|
|
82
|
-
`
|
|
85
|
+
`MyGatewayClientStrands.create()` returns a single context-manageable client whose `list_tools_sync()` yields every tool available through the Gateway:
|
|
83
86
|
|
|
84
87
|
- **Deployed mode** (`SERVE_LOCAL` unset): a single `MCPClient` pointed at the Gateway's MCP endpoint, SigV4-signed.
|
|
85
88
|
- **Local mode** (`SERVE_LOCAL=true`): a plain-HTTP `MCPClient` pointed at the local gateway started by the Gateway project's `serve-local` target.
|
|
@@ -48,9 +48,12 @@ The generator creates a shared `agent_connection` Python project at `packages/co
|
|
|
48
48
|
- \<scope>\_agent\_connection
|
|
49
49
|
- \_\_init\_\_.py Re-exports per-connection clients
|
|
50
50
|
- core
|
|
51
|
-
- agentcore\
|
|
51
|
+
- agentcore\_endpoints.py Framework-agnostic ARN/URL resolution
|
|
52
|
+
- agentcore\_mcp\_transport.py Framework-agnostic MCP transport
|
|
53
|
+
- agentcore\_mcp\_client\_strands.py Strands MCP client wrapping the transport
|
|
54
|
+
- auth/ Framework-agnostic SigV4 / session-forwarding `httpx.Auth`
|
|
52
55
|
- app
|
|
53
|
-
- \<mcp\_server\_name>\_client.py Per-connection client for each MCP server
|
|
56
|
+
- \<mcp\_server\_name>\_client\_strands.py Per-connection Strands client for each MCP server
|
|
54
57
|
|
|
55
58
|
</FileTree>
|
|
56
59
|
|
|
@@ -67,11 +70,11 @@ The generator transforms your agent's `agent.py` to use the MCP server's tools:
|
|
|
67
70
|
from contextlib import contextmanager
|
|
68
71
|
from strands import Agent
|
|
69
72
|
|
|
70
|
-
from my_scope_agent_connection import
|
|
73
|
+
from my_scope_agent_connection import MyMcpServerClientStrands
|
|
71
74
|
|
|
72
75
|
@contextmanager
|
|
73
76
|
def get_agent(session_id: str):
|
|
74
|
-
my_mcp_server =
|
|
77
|
+
my_mcp_server = MyMcpServerClientStrands.create(session_id=session_id)
|
|
75
78
|
with (
|
|
76
79
|
my_mcp_server,
|
|
77
80
|
):
|
|
@@ -47,9 +47,12 @@ The generator creates a shared `agent-connection` package and modifies your agen
|
|
|
47
47
|
- packages/common/agent-connection
|
|
48
48
|
- src
|
|
49
49
|
- app
|
|
50
|
-
- \<target-agent-name>-client.ts High-level client for the connected A2A agent
|
|
50
|
+
- \<target-agent-name>-client-strands.ts High-level Strands client for the connected A2A agent
|
|
51
51
|
- core
|
|
52
|
-
- agentcore-
|
|
52
|
+
- agentcore-endpoints.ts Framework-agnostic ARN/URL resolution
|
|
53
|
+
- agentcore-fetch.ts Framework-agnostic SigV4 / JWT / session-forwarding fetch
|
|
54
|
+
- agentcore-a2a-client-config.ts Framework-agnostic A2A client config (signed `clientFactory`)
|
|
55
|
+
- agentcore-a2a-client-strands.ts Strands A2A client wrapping the config
|
|
53
56
|
- index.ts Exports all clients
|
|
54
57
|
- project.json
|
|
55
58
|
- tsconfig.json
|
|
@@ -67,11 +70,11 @@ The generator transforms your agent's `agent.ts` to wrap the remote A2A agent as
|
|
|
67
70
|
|
|
68
71
|
```ts title="packages/example/src/my-agent/agent.ts" {2,5-11,14}
|
|
69
72
|
import { Agent, tool } from '@strands-agents/sdk';
|
|
70
|
-
import {
|
|
73
|
+
import { RemoteAgentClientStrands } from ':my-scope/agent-connection';
|
|
71
74
|
import { z } from 'zod';
|
|
72
75
|
|
|
73
76
|
export const getAgent = async (sessionId: string) => {
|
|
74
|
-
const remoteAgent = await
|
|
77
|
+
const remoteAgent = await RemoteAgentClientStrands.create(sessionId);
|
|
75
78
|
const remoteAgentTool = tool({
|
|
76
79
|
name: 'askRemoteAgent',
|
|
77
80
|
description: 'Delegate a question to the remote RemoteAgent A2A agent and return its reply.',
|
|
@@ -87,7 +90,7 @@ export const getAgent = async (sessionId: string) => {
|
|
|
87
90
|
|
|
88
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).
|
|
89
92
|
|
|
90
|
-
Under the hood, `
|
|
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 `SERVE_LOCAL=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.
|
|
91
94
|
|
|
92
95
|
## Infrastructure
|
|
93
96
|
|
|
@@ -44,16 +44,18 @@ The generator emits shared core client files into your `agent-connection` packag
|
|
|
44
44
|
- packages/common/agent-connection
|
|
45
45
|
- src
|
|
46
46
|
- core/
|
|
47
|
-
- agentcore-
|
|
47
|
+
- agentcore-endpoints.ts Framework-agnostic ARN/URL resolution
|
|
48
|
+
- agentcore-gateway-mcp-transport.ts Framework-agnostic Gateway MCP transport
|
|
49
|
+
- agentcore-gateway-mcp-client-strands.ts Strands MCP client for the deployed Gateway
|
|
48
50
|
- app/
|
|
49
|
-
- \<gateway-kebab>-client.ts Per-Gateway client wrapper
|
|
51
|
+
- \<gateway-kebab>-client-strands.ts Per-Gateway Strands client wrapper
|
|
50
52
|
- index.ts Re-exports the Gateway client
|
|
51
53
|
|
|
52
54
|
</FileTree>
|
|
53
55
|
|
|
54
56
|
Additionally, the generator:
|
|
55
57
|
|
|
56
|
-
- Modifies your agent's `agent.ts` to import the Gateway client class, call `<Gateway>
|
|
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
|
|
57
59
|
- Wires the agent's `<agent>-serve-local` target to depend on the Gateway's `<gateway>-serve-local` aggregator
|
|
58
60
|
- Installs the required SigV4 / MCP dependencies
|
|
59
61
|
|
|
@@ -63,10 +65,10 @@ The generator transforms your agent's `agent.ts` to use the Gateway client:
|
|
|
63
65
|
|
|
64
66
|
```ts title="packages/example/src/my-agent/agent.ts" {2,5,8}
|
|
65
67
|
import { Agent } from '@strands-agents/sdk';
|
|
66
|
-
import {
|
|
68
|
+
import { MyGatewayClientStrands } from ':my-scope/agent-connection';
|
|
67
69
|
|
|
68
70
|
export const getAgent = async () => {
|
|
69
|
-
const myGateway = await
|
|
71
|
+
const myGateway = await MyGatewayClientStrands.create();
|
|
70
72
|
return new Agent({
|
|
71
73
|
systemPrompt: '...',
|
|
72
74
|
tools: [myGateway],
|
|
@@ -47,9 +47,12 @@ The generator creates a shared `agent-connection` package and modifies your agen
|
|
|
47
47
|
- packages/common/agent-connection
|
|
48
48
|
- src
|
|
49
49
|
- app
|
|
50
|
-
- \<mcp-server-name>-client.ts High-level client for the connected MCP server
|
|
50
|
+
- \<mcp-server-name>-client-strands.ts High-level Strands client for the connected MCP server
|
|
51
51
|
- core
|
|
52
|
-
- agentcore-
|
|
52
|
+
- agentcore-endpoints.ts Framework-agnostic ARN/URL resolution
|
|
53
|
+
- agentcore-fetch.ts Framework-agnostic SigV4 / JWT / session-forwarding fetch
|
|
54
|
+
- agentcore-mcp-transport.ts Framework-agnostic MCP transport
|
|
55
|
+
- agentcore-mcp-client-strands.ts Strands MCP client wrapping the transport
|
|
53
56
|
- index.ts Exports all clients
|
|
54
57
|
- project.json
|
|
55
58
|
- tsconfig.json
|
|
@@ -67,10 +70,10 @@ The generator transforms your agent's `agent.ts` to use the MCP server's tools:
|
|
|
67
70
|
|
|
68
71
|
```ts title="packages/example/src/my-agent/agent.ts" {2,5,8}
|
|
69
72
|
import { Agent, tool } from '@strands-agents/sdk';
|
|
70
|
-
import {
|
|
73
|
+
import { MyMcpServerClientStrands } from ':my-scope/agent-connection';
|
|
71
74
|
|
|
72
75
|
export const getAgent = async (sessionId: string) => {
|
|
73
|
-
const myMcpServerClient = await
|
|
76
|
+
const myMcpServerClient = await MyMcpServerClientStrands.create(sessionId);
|
|
74
77
|
return new Agent({
|
|
75
78
|
systemPrompt: '...',
|
|
76
79
|
tools: [myMcpServerClient],
|
package/docs/guides/trpc.mdx
CHANGED
|
@@ -138,7 +138,7 @@ The example `echo` procedure is generated for you in `src/procedures/echo.ts`:
|
|
|
138
138
|
export const echo = publicProcedure
|
|
139
139
|
.input(EchoInputSchema)
|
|
140
140
|
.output(EchoOutputSchema)
|
|
141
|
-
.query((opts) => ({
|
|
141
|
+
.query((opts) => ({ message: opts.input.message }));
|
|
142
142
|
```
|
|
143
143
|
|
|
144
144
|
To break down the above:
|