mcp/client.py gelöscht

This commit is contained in:
2026-07-05 09:38:32 +00:00
parent 7facf327e8
commit 188217108f
-26
View File
@@ -1,26 +0,0 @@
from mcp import ClientSession
from mcp.client.streamable_http import streamable_http_client
class MCPClient:
def __init__(self, url: str):
self.url = url
self.session = None
self._client = None
async def connect(self):
self._client = streamable_http_client(self.url)
read, write = await self._client.__aenter__()
self.session = ClientSession(read, write)
await self.session.initialize()
async def list_tools(self):
return await self.session.list_tools()
async def call_tool(self, name, args):
return await self.session.call_tool(name, args)
async def close(self):
if self._client:
await self._client.__aexit__(None, None, None)