[Chore]Fixes client startup errors (#27)

This commit is contained in:
ivin
2025-07-15 13:58:44 +08:00
committed by GitHub
parent 6d3c128f54
commit 9bb5b17199

View File

@@ -323,7 +323,7 @@ class DorisUnifiedClient:
async with streamablehttp_client( async with streamablehttp_client(
self.config.server_url, self.config.server_url,
timeout=timedelta(seconds=self.config.timeout) timeout=timedelta(seconds=self.config.timeout)
) as (read, write): ) as (read, write, _):
async with ClientSession(read, write) as session: async with ClientSession(read, write) as session:
self.session = session self.session = session
self._init_sub_clients() self._init_sub_clients()
@@ -463,7 +463,7 @@ async def create_http_client(server_url: str, timeout: int = 60) -> DorisUnified
# Example usage # Example usage
async def example_stdio(): async def example_stdio():
"""stdio mode example""" """stdio mode example"""
client = await create_stdio_client("python", ["doris_mcp_server/main.py"]) client = await create_stdio_client("python", ["-m", "doris_mcp_server.main", "--transport", "stdio"])
async def test_client(client: DorisUnifiedClient): async def test_client(client: DorisUnifiedClient):
# Get server capabilities # Get server capabilities
@@ -506,4 +506,4 @@ if __name__ == "__main__":
asyncio.run(example_stdio()) asyncio.run(example_stdio())
# Run HTTP example # Run HTTP example
# asyncio.run(example_http()) # asyncio.run(example_http())