From 6fba059e5a2b34473e14887255b6aaccca1f2745 Mon Sep 17 00:00:00 2001 From: Till Immer Date: Sat, 4 Jul 2026 19:37:07 +0000 Subject: [PATCH] Delete directory 'mcp' --- mcp/client.py | 58 ----------------------------------------------- mcp/test_tools.py | 7 ------ 2 files changed, 65 deletions(-) delete mode 100644 mcp/client.py delete mode 100644 mcp/test_tools.py diff --git a/mcp/client.py b/mcp/client.py deleted file mode 100644 index 5e458c6..0000000 --- a/mcp/client.py +++ /dev/null @@ -1,58 +0,0 @@ -import asyncio - -from mcp.client.session import ClientSession -from mcp.client.streamable_http import streamablehttp_client - - -class MCPClient: - - def __init__(self, base_url="http://localhost:8081"): - self.base_url = base_url - - async def _run(self, tool, arguments=None): - - if arguments is None: - arguments = {} - - async with streamablehttp_client(f"{self.base_url}/mcp") as ( - read, - write, - _, - ): - - async with ClientSession(read, write) as session: - - await session.initialize() - - result = await session.call_tool( - tool, - arguments=arguments, - ) - - return result - - def call_tool(self, tool, arguments=None): - - return asyncio.run( - self._run(tool, arguments) - ) - async def _list_tools(self): - - async with streamablehttp_client(f"{self.base_url}/mcp") as ( - read, - write, - _, - ): - - async with ClientSession(read, write) as session: - - await session.initialize() - - return await session.list_tools() - - -def list_tools(self): - - return asyncio.run( - self._list_tools() - ) diff --git a/mcp/test_tools.py b/mcp/test_tools.py deleted file mode 100644 index 56d5388..0000000 --- a/mcp/test_tools.py +++ /dev/null @@ -1,7 +0,0 @@ -from mcp.client import MCPClient - -mcp = MCPClient() - -tools = mcp.list_tools() - -print(tools)