From 7a16a260f198497bea03dc435061559d5636ed93 Mon Sep 17 00:00:00 2001 From: airano Date: Thu, 19 Feb 2026 04:45:53 +0330 Subject: [PATCH] fix: use find_dotenv(usecwd=True) for PyPI .env loading load_dotenv() without usecwd=True fails for mcphub.exe because find_dotenv() walks the call stack and searches from site-packages/ instead of the user's working directory. Bump to v3.0.4. Co-Authored-By: Claude Opus 4.6 --- pyproject.toml | 2 +- server.py | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/pyproject.toml b/pyproject.toml index 2e0ffde..eb4c0d2 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -1,6 +1,6 @@ [project] name = "mcphub-server" -version = "3.0.3" +version = "3.0.4" description = "AI-native management hub for WordPress, WooCommerce, and self-hosted services via Model Context Protocol (MCP)" authors = [ {name = "MCP Hub", email = "contact@mcphub.dev"} diff --git a/server.py b/server.py index 0a6f805..53d2db6 100644 --- a/server.py +++ b/server.py @@ -27,9 +27,9 @@ import warnings from datetime import UTC, datetime from typing import Optional -from dotenv import load_dotenv +from dotenv import find_dotenv, load_dotenv -load_dotenv() # Load .env from current working directory +load_dotenv(find_dotenv(usecwd=True)) # Always search from CWD (needed for PyPI mcphub.exe) # Suppress noisy deprecation warning from websockets (transitive dependency) warnings.filterwarnings("ignore", category=DeprecationWarning, module="websockets")