feat(logging): trace credential source and config path in login tool
All checks were successful
Build and Push Docker Image / build (push) Successful in 39s

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.
This commit is contained in:
2026-04-28 02:52:09 +00:00
parent d28b9d32f6
commit 9f799ee264
2 changed files with 9 additions and 2 deletions

View File

@@ -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")