class StrandsPlugin(SimplePlugin): (source)
Constructor: StrandsPlugin(models, mcp_clients, mcp_connection_idle_timeout)
Temporal Worker plugin for the Strands Agents SDK.
When models is supplied, registers a single pair of model invocation activities; each call carries the chosen model_name in its input and the worker resolves it against the factories. Factories are called lazily on first use, then cached for the worker's lifetime. Use the same name in TemporalAgent(model=...) inside the workflow.
When mcp_clients is supplied, registers a per-server {server}-call-tool activity for each entry and, at worker startup, connects to each MCP server to cache its tool list. Workflow-side TemporalMCPClient(server="...").load_tools() reads from the cache.
mcp_connection_idle_timeout controls how long a worker-process MCP connection is kept open between call-tool activities before it is disconnected; the timer resets on every reuse. Defaults to 5 minutes.
| Method | __init__ |
Build the plugin from optional model and MCP transport factories. |
Inherited from SimplePlugin:
| Method | configure |
See base class. |
| Method | configure |
See base class. |
| Method | configure |
See base class. |
| Async Method | connect |
See base class. |
| Method | name |
See base class. |
| Async Method | run |
See base class. |
| Async Method | run |
See base class. |
| Instance Variable | activities |
Undocumented |
| Instance Variable | data |
Undocumented |
| Instance Variable | interceptors |
Undocumented |
| Instance Variable | nexus |
Undocumented |
| Instance Variable | run |
Undocumented |
| Instance Variable | workflow |
Undocumented |
| Instance Variable | workflow |
Undocumented |
| Instance Variable | workflows |
Undocumented |
| Instance Variable | _name |
Undocumented |
dict[ str, Callable[ [], Model]] | None = None, mcp_clients: dict[ str, Callable[ [], MCPClient]] | None = None, mcp_connection_idle_timeout: timedelta | None = None):
(source)
ΒΆ
temporalio.plugin.SimplePlugin.__init__Build the plugin from optional model and MCP transport factories.
If models is omitted, registers a single BedrockModel() factory under the name "bedrock", matching Strands' own implicit default.