diff --git a/pyproject.toml b/pyproject.toml index ad21cd0..9f18ba0 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -1,6 +1,6 @@ [project] name = "npm-mcp" -version = "0.0.5" +version = "0.0.6" description = "MCP server for Nginx Proxy Manager" readme = "README.md" requires-python = ">=3.11" diff --git a/src/npm_mcp/main.py b/src/npm_mcp/main.py index c612870..78532a6 100644 --- a/src/npm_mcp/main.py +++ b/src/npm_mcp/main.py @@ -50,9 +50,9 @@ def main() -> None: else: logger.info(f"Starting MCP server in HTTP mode on {args.host}:{args.port}") - # Always construct the HTTP app using the same FastMCP.streamable_http_app() + # Always construct the HTTP app using the same FastMCP.http_app() # so that its lifespan (StreamableHTTPSessionManager background task) runs correctly. - app = mcp.streamable_http_app() + app = mcp.http_app() # Mount /health directly on the inner router from starlette.responses import PlainTextResponse diff --git a/tests/test_server.py b/tests/test_server.py index 491a233..c4746ec 100644 --- a/tests/test_server.py +++ b/tests/test_server.py @@ -7,3 +7,9 @@ def test_server_imports(): from npm_mcp.server import mcp assert mcp is not None assert mcp.name == "npm-mcp" + +def test_server_http_app(): + """Ensure that the http_app can be retrieved without AttributeError.""" + from npm_mcp.server import mcp + app = mcp.http_app() + assert app is not None