diff --git a/server.py b/server.py index 1f86579..1598202 100644 --- a/server.py +++ b/server.py @@ -234,3 +234,20 @@ if __name__ == "__main__": except BaseException as e: logging.critical(f"Server crashed: {e}", exc_info=True) raise + +# Expose as ASGI app for uvicorn to pick up if run directly (uvicorn server:app) +# This bypasses the Typer CLI entirely. +app = mcp._sse_app if hasattr(mcp, "_sse_app") else None +if app is None: + # Fallback if _sse_app isn't pre-initialized or private + try: + from starlette.applications import Starlette + from mcp.server.sse import SseServerTransport + + # We need to construct the app manually if FastMCP hides it + # But FastMCP typically creates it on demand. + # Let's try to find it or create a wrapper. + pass + except ImportError: + pass +