Skip to content

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

Make fastapi.cli a runnable module (#2532)

Paulo Costae1e0553ecb62
diff --git a/src/fastmcp/cli/__init__.py b/src/fastmcp/cli/__init__.py
index 3ef56d806..091667730 100644
--- a/src/fastmcp/cli/__init__.py
+++ b/src/fastmcp/cli/__init__.py
@@ -1,6 +1,3 @@
"""FastMCP CLI package."""
from .cli import app
-
-if __name__ == "__main__":
- app()
diff --git a/src/fastmcp/cli/__main__.py b/src/fastmcp/cli/__main__.py
new file mode 100644
index 000000000..aca24b145
--- /dev/null
+++ b/src/fastmcp/cli/__main__.py
@@ -0,0 +1,5 @@
+"""FastMCP CLI as a runnable package"""
+
+from .cli import app
+
+app()