From 9f799ee264ca758a103fb7ad76b54fe59da8a047 Mon Sep 17 00:00:00 2001 From: b3nw Date: Tue, 28 Apr 2026 02:52:09 +0000 Subject: [PATCH] feat(logging): trace credential source and config path in login tool Add diagnostic logging to the MCP login tool handler: - Log whether username/password were provided explicitly - If falling back to config, log the resolved config path and whether it exists - This complements upstream scraper v0.6.18 credential diagnostics Bumps version to 0.2.1. --- pyproject.toml | 2 +- server.py | 9 ++++++++- 2 files changed, 9 insertions(+), 2 deletions(-) diff --git a/pyproject.toml b/pyproject.toml index ad9ebdf..1d3ba42 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -1,6 +1,6 @@ [project] name = "schwab-mcp-custom" -version = "0.2.0" +version = "0.2.1" description = "MCP server wrapping schwab-scraper" readme = "README.md" requires-python = ">=3.12" diff --git a/server.py b/server.py index 4d4d558..36a38b7 100644 --- a/server.py +++ b/server.py @@ -265,7 +265,14 @@ async def login( mcp_logger = logging.getLogger("schwab_mcp_custom") mcp_logger.info("=== LOGIN TOOL CALLED ===") - mcp_logger.info(f"debug={debug}, username_provided={bool(username)}") + mcp_logger.info(f"debug={debug}, username_provided={bool(username)}, password_provided={bool(password)}") + + # Diagnostic: if credentials not provided, show what config path would be used + if not username or not password: + from schwab_scraper.core.config import get_config_path + config_path = get_config_path() + config_exists = os.path.exists(config_path) + mcp_logger.info(f"Config fallback: path={config_path}, exists={config_exists}") with capture_logs(level=logging.DEBUG if debug else logging.INFO) as log_buf: mcp_logger.info("capture_logs context entered")