Skip to content

Commit 5e43c16

Browse files
committed
Rename and add docstring
1 parent 016c50b commit 5e43c16

File tree

2 files changed

+19
-3
lines changed

2 files changed

+19
-3
lines changed

nexusmcp/nexus_transport.py

Lines changed: 17 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,23 @@
1111
from .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,

tests/test_workflow_caller.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@
1010
from temporalio.testing import WorkflowEnvironment
1111
from temporalio.worker import Worker
1212

13-
from nexusmcp.nexus_transport import NexusTransport
13+
from nexusmcp.nexus_transport import WorkflowNexusTransport
1414

1515
from .service import TestServiceHandler, mcp_service
1616

@@ -24,7 +24,7 @@ class MCPCallerWorkflowInput:
2424
class 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()

0 commit comments

Comments
 (0)