From f14f7783dfb1e6be1d14bc0e3dac6d0f36fd3767 Mon Sep 17 00:00:00 2001 From: dgenio Date: Sat, 28 Feb 2026 11:34:44 +0000 Subject: [PATCH] Skip load_server() in inspector when --module is active --- src/fastmcp/cli/cli.py | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/src/fastmcp/cli/cli.py b/src/fastmcp/cli/cli.py index 1605f567b..777f067f5 100644 --- a/src/fastmcp/cli/cli.py +++ b/src/fastmcp/cli/cli.py @@ -261,7 +261,11 @@ async def inspector( logger.error("No configuration available") sys.exit(1) assert config is not None # For type checker - await config.source.load_server() + + # Skip server-object validation in module mode — the module + # manages its own startup and may not expose an importable server. + if not module: + await config.source.load_server() env_vars = {} if ui_port: