Skip to content

Commit 08b14dd

Browse files
Fix inputSchema attribute usage
Signed-off-by: Anuradha Karuppiah <[email protected]>
1 parent b12150f commit 08b14dd

File tree

2 files changed

+7
-9
lines changed

2 files changed

+7
-9
lines changed

src/aiq/cli/commands/info/list_mcp.py

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -150,9 +150,6 @@ def list_mcp(ctx, direct, url, client_type, command, args, env, tool, detail, js
150150
if not command:
151151
click.echo("[ERROR] --command is required when using stdio client type", err=True)
152152
return
153-
if url:
154-
click.echo("[ERROR] --url is not allowed when using stdio client type", err=True)
155-
return
156153

157154
if client_type == 'sse':
158155
if not url:

src/aiq/tool/mcp/mcp_client.py

Lines changed: 7 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,8 @@
1818
import logging
1919
from abc import ABC
2020
from abc import abstractmethod
21-
from contextlib import AsyncContextManager
21+
from collections.abc import Callable
22+
from contextlib import AbstractAsyncContextManager
2223
from contextlib import asynccontextmanager
2324
from enum import Enum
2425
from typing import Any
@@ -101,7 +102,7 @@ def __init__(self, client_type: str = 'sse'):
101102

102103
@abstractmethod
103104
@asynccontextmanager
104-
async def connect_to_server(self) -> AsyncContextManager[ClientSession]:
105+
async def connect_to_server(self):
105106
"""
106107
Establish a session with an MCP server within an async context
107108
"""
@@ -119,7 +120,7 @@ async def get_tools(self):
119120
MCPToolClient(connect_fn=self.connect_to_server,
120121
tool_name=tool.name,
121122
tool_description=tool.description,
122-
tool_input_schema=tool.input_schema)
123+
tool_input_schema=tool.inputSchema)
123124
for tool in response.tools
124125
}
125126

@@ -164,7 +165,7 @@ def __init__(self, url: str, client_type: str = 'sse'):
164165
self._url = url
165166

166167
@asynccontextmanager
167-
async def connect_to_server(self) -> AsyncContextManager[ClientSession]:
168+
async def connect_to_server(self):
168169
"""
169170
Establish a session with an MCP SSE server within an async context
170171
"""
@@ -215,7 +216,7 @@ async def stop_persistent_session(self):
215216
self._session_cm = None
216217

217218
@asynccontextmanager
218-
async def connect_to_server(self) -> AsyncContextManager[ClientSession]:
219+
async def connect_to_server(self):
219220
"""
220221
Establish a session with an MCP server via stdio within an async context
221222
"""
@@ -241,7 +242,7 @@ class MCPToolClient:
241242
"""
242243

243244
def __init__(self,
244-
connect_fn: callable[[], AsyncContextManager[ClientSession]],
245+
connect_fn: Callable[[], AbstractAsyncContextManager[ClientSession]],
245246
tool_name: str,
246247
tool_description: str | None,
247248
tool_input_schema: dict | None = None):

0 commit comments

Comments
 (0)