test: Setup interactive browser test

This commit is contained in:
Chris Coutinho
2025-10-14 01:23:30 +02:00
parent 4d7e4b9a4b
commit 33b962a7fc
9 changed files with 162 additions and 63 deletions
+11 -9
View File
@@ -274,18 +274,20 @@ def get_app(transport: str = "sse", enabled_apps: list[str] | None = None):
# Determine authentication mode
oauth_enabled = is_oauth_mode()
# WARNING: This is a synchronous function but OAuth setup requires async
# For now, OAuth configuration will be handled differently
# We'll need to restructure this or use a factory pattern
if oauth_enabled:
logger.info("Configuring MCP server for OAuth mode")
logger.warning(
"OAuth mode requires async initialization - use factory pattern or separate setup"
# Asynchronously get the OAuth configuration
import asyncio
nextcloud_host, token_verifier, auth_settings = asyncio.run(
setup_oauth_config()
)
mcp = FastMCP(
"Nextcloud MCP",
lifespan=app_lifespan_oauth,
token_verifier=token_verifier,
auth=auth_settings,
)
# For now, fall back to a simplified OAuth setup
# TODO: This needs to be restructured to support async initialization
mcp = FastMCP("Nextcloud MCP", lifespan=app_lifespan_oauth)
else:
logger.info("Configuring MCP server for BasicAuth mode")
mcp = FastMCP("Nextcloud MCP", lifespan=app_lifespan_basic)