From ba96bd05d3db00177f20dd276e61d9dba102726d Mon Sep 17 00:00:00 2001 From: mehrdad Date: Tue, 16 Sep 2025 11:44:25 -0700 Subject: [PATCH] fix: replace Tuple type with TypeAlias for server params in MCP client --- src/pipecat/services/mcp_service.py | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/src/pipecat/services/mcp_service.py b/src/pipecat/services/mcp_service.py index 3bbca1f17..70cda3845 100644 --- a/src/pipecat/services/mcp_service.py +++ b/src/pipecat/services/mcp_service.py @@ -7,7 +7,7 @@ """MCP (Model Context Protocol) client for integrating external tools with LLMs.""" import json -from typing import Any, Dict, List, Tuple +from typing import Any, Dict, List, TypeAlias from loguru import logger @@ -28,6 +28,7 @@ except ModuleNotFoundError as e: logger.error("In order to use an MCP client, you need to `pip install pipecat-ai[mcp]`.") raise Exception(f"Missing module: {e}") +ServerParameters: TypeAlias = StdioServerParameters | SseServerParameters | StreamableHttpParameters class MCPClient(BaseObject): """Client for Model Context Protocol (MCP) servers. @@ -42,7 +43,7 @@ class MCPClient(BaseObject): def __init__( self, - server_params: Tuple[StdioServerParameters, SseServerParameters, StreamableHttpParameters], + server_params: ServerParameters, **kwargs, ): """Initialize the MCP client with server parameters.