1616
1717import logging
1818import sys
19- from typing import Any
20- from typing import AsyncIterator
2119from typing import Callable
2220from typing import Dict
2321from typing import List
@@ -73,7 +71,7 @@ class McpToolset(BaseToolset):
7371
7472 Usage::
7573
76- toolset = MCPToolset (
74+ toolset = McpToolset (
7775 connection_params=StdioServerParameters(
7876 command='npx',
7977 args=["-y", "@modelcontextprotocol/server-filesystem"],
@@ -113,7 +111,7 @@ def __init__(
113111 Callable [[ReadonlyContext ], Dict [str , str ]]
114112 ] = None ,
115113 ):
116- """Initializes the MCPToolset .
114+ """Initializes the McpToolset .
117115
118116 Args:
119117 connection_params: The connection parameters to the MCP server. Can be:
@@ -141,7 +139,7 @@ def __init__(
141139 super ().__init__ (tool_filter = tool_filter , tool_name_prefix = tool_name_prefix )
142140
143141 if not connection_params :
144- raise ValueError ("Missing connection params in MCPToolset ." )
142+ raise ValueError ("Missing connection params in McpToolset ." )
145143
146144 self ._connection_params = connection_params
147145 self ._errlog = errlog
@@ -208,14 +206,14 @@ async def close(self) -> None:
208206 await self ._mcp_session_manager .close ()
209207 except Exception as e :
210208 # Log the error but don't re-raise to avoid blocking shutdown
211- print (f"Warning: Error during MCPToolset cleanup: { e } " , file = self ._errlog )
209+ print (f"Warning: Error during McpToolset cleanup: { e } " , file = self ._errlog )
212210
213211 @override
214212 @classmethod
215213 def from_config (
216- cls : type [MCPToolset ], config : ToolArgsConfig , config_abs_path : str
217- ) -> MCPToolset :
218- """Creates an MCPToolset from a configuration object."""
214+ cls : type [McpToolset ], config : ToolArgsConfig , config_abs_path : str
215+ ) -> McpToolset :
216+ """Creates an McpToolset from a configuration object."""
219217 mcp_toolset_config = McpToolsetConfig .model_validate (config .model_dump ())
220218
221219 if mcp_toolset_config .stdio_server_params :
@@ -227,7 +225,7 @@ def from_config(
227225 elif mcp_toolset_config .streamable_http_connection_params :
228226 connection_params = mcp_toolset_config .streamable_http_connection_params
229227 else :
230- raise ValueError ("No connection params found in MCPToolsetConfig ." )
228+ raise ValueError ("No connection params found in McpToolsetConfig ." )
231229
232230 return cls (
233231 connection_params = connection_params ,
@@ -251,7 +249,7 @@ def __init__(self, *args, **kwargs):
251249
252250
253251class McpToolsetConfig (BaseToolConfig ):
254- """The config for MCPToolset ."""
252+ """The config for McpToolset ."""
255253
256254 stdio_server_params : Optional [StdioServerParameters ] = None
257255
0 commit comments