File tree Expand file tree Collapse file tree 2 files changed +7
-1
lines changed
Expand file tree Collapse file tree 2 files changed +7
-1
lines changed Original file line number Diff line number Diff line change 44
55import anyio
66import mcp .types as types
7+ from anyio .streams .memory import MemoryObjectReceiveStream , MemoryObjectSendStream
78from mcp .shared .message import SessionMessage
89
910from mcp_examples .common .mcp_server_nexus_service import (
@@ -128,7 +129,9 @@ async def _route_to_nexus(
128129 return SessionMessage (types .JSONRPCMessage (root = response ))
129130
130131
131- class AsyncioQueueStream :
132+ class AsyncioQueueStream (
133+ MemoryObjectSendStream [SessionMessage ], MemoryObjectReceiveStream [SessionMessage ]
134+ ):
132135 def __init__ (self , queue : asyncio .Queue ):
133136 self .queue = queue
134137 self ._closed = False
Original file line number Diff line number Diff line change @@ -43,10 +43,12 @@ async def create_client_session_and_call_tool_using_nexus_transport(
4343@workflow .defn
4444class CallToolWorkflow :
4545 def __init__ (self ):
46+ print ("Creating nexus client in workflow..." )
4647 self .nexus_client = workflow .create_nexus_client (
4748 service = MCPServerNexusService ,
4849 endpoint = "mcp-sequential-thinking-nexus-endpoint" ,
4950 )
51+ print ("Nexus client created" )
5052
5153 @workflow .run
5254 async def run (self ):
@@ -93,6 +95,7 @@ async def _call_tool(session: ClientSession):
9395
9496
9597if __name__ == "__main__" :
98+ print ("Starting app..." )
9699 if "WITHOUT_WORKFLOW" in os .environ :
97100 asyncio .run (create_client_session_and_call_tool_using_standard_transport ())
98101 else :
You can’t perform that action at this time.
0 commit comments