From 725d323b96c5d4e88790b8c88ea790a1133fc2d1 Mon Sep 17 00:00:00 2001 From: i/o agent <273482092+claw-io@users.noreply.github.com> Date: Wed, 12 Aug 2026 13:54:23 -0500 Subject: [PATCH] fix(mcp): resolve AttributeError: FastMCP has no attribute streamable_http_app (#16) * fix(mcp): resolve AttributeError: FastMCP has no attribute streamable_http_app * chore(release): bump version to 0.0.6 --------- Co-authored-by: b3nw <189466+b3nw@users.noreply.github.com> --- pyproject.toml | 2 +- src/npm_mcp/main.py | 4 ++-- tests/test_server.py | 6 ++++++ 3 files changed, 9 insertions(+), 3 deletions(-) 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