File tree Expand file tree Collapse file tree 2 files changed +19
-3
lines changed
Expand file tree Collapse file tree 2 files changed +19
-3
lines changed Original file line number Diff line number Diff line change 1111from .service import MCPService
1212
1313
14- class NexusTransport :
14+ class WorkflowNexusTransport :
15+ """
16+ Nexus MCP Transport for use in Temporal workflows.
17+
18+ This class provides a transport that proxies MCP requests to a Temporal Nexus service. It can be
19+ used to make MCP calls via `mcp.ClientSession` from Temporal workflow code.
20+
21+ Example:
22+ ```python
23+ async with WorkflowNexusTransport("my-endpoint") as (read_stream, write_stream):
24+ async with ClientSession(read_stream, write_stream) as session:
25+ await session.initialize()
26+ await session.list_tools()
27+ await session.call_tool("my-service/my-operation", {"arg": "value"})
28+ ```
29+ """
30+
1531 def __init__ (
1632 self ,
1733 endpoint : str ,
Original file line number Diff line number Diff line change 1010from temporalio .testing import WorkflowEnvironment
1111from temporalio .worker import Worker
1212
13- from nexusmcp .nexus_transport import NexusTransport
13+ from nexusmcp .nexus_transport import WorkflowNexusTransport
1414
1515from .service import TestServiceHandler , mcp_service
1616
@@ -24,7 +24,7 @@ class MCPCallerWorkflowInput:
2424class MCPCallerWorkflow :
2525 @workflow .run
2626 async def run (self , input : MCPCallerWorkflowInput ) -> None :
27- transport = NexusTransport (input .endpoint )
27+ transport = WorkflowNexusTransport (input .endpoint )
2828 async with transport .connect () as (read_stream , write_stream ):
2929 async with ClientSession (read_stream , write_stream ) as session :
3030 await session .initialize ()
You can’t perform that action at this time.
0 commit comments