Skip to content

πŸš€ The fast, Pythonic way to build MCP servers and clients.

Skip load_server() in inspector when --module is active

dgeniof14f7783dfb1
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: