-
Notifications
You must be signed in to change notification settings - Fork 2.5k
Closed
Description
original code
async def connect_to_server(self,server_script_path:str):
is_python = server_script_path.endswith('.py')
if not is_python:
raise ValueError('must python')
command = "python"
server_paramss = StdioServerParameters(
command=command,
args=[server_script_path],
env=None
)
stdio_transport = await self.exit_stack.enter_async_context(stdio_client(server_paramss))
self.stdio, self.write = stdio_transport
self.session = await self.exit_stack.enter_async_context(ClientSession(self.stdio,self.write))
await self.session.initialize()
response = await self.session.list_tools()
tools = response.tools
print("\n server tools :", [tool.name for tool in tools])
sigmaSd, merlinarer, yadgire7, andrewkenreich and maxisbey
Metadata
Metadata
Assignees
Labels
No labels