diff --git a/pyproject.toml b/pyproject.toml index f367299..3850c00 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -4,7 +4,7 @@ build-backend = "hatchling.build" [project] name = "mcphub" -version = "0.1.10" +version = "0.1.11" description = "A Python package for managing and integrating Model Context Protocol (MCP) servers with AI frameworks like OpenAI Agents, LangChain, and Autogen" readme = "README.md" authors = [ diff --git a/src/mcphub/mcp_servers/params.py b/src/mcphub/mcp_servers/params.py index 663e98a..5783fb4 100644 --- a/src/mcphub/mcp_servers/params.py +++ b/src/mcphub/mcp_servers/params.py @@ -47,7 +47,7 @@ def _load_user_config(self) -> Dict: """Load user configuration from JSON file.""" # If no config path is provided, return empty dict if not self.config_path: - return {} + raise ServerConfigNotFoundError("No configuration file path provided") try: with open(self.config_path, "r") as f: @@ -188,8 +188,15 @@ def _load_servers_params(self) -> Dict[str, MCPServerConfig]: ) # Get command and args with defaults - command = server_config.get("command", "npx") - args = server_config.get("args", ["-y", package_name]) + command = server_config.get("command", None) + args = server_config.get("args", None) + + # Skip if command or args is None + if command is None or args is None: + raise ValueError( + f"Invalid server '{mcp_name}' configuration: command or args is None. " + f"Command: {command}, Args: {args}" + ) servers[mcp_name] = MCPServerConfig( package_name=package_name,