INNER CODE UNIT · Python
__getattr__
RekklesNA/ProxmoxMCP-Plus · src/proxmox_mcp/server.py:334
def __getattr__(self, name: str) -> Any:
if name in _LEGACY_SINGLE_TARGET_ATTRS:
raise AttributeError(
f"'{name}' is only available in single-target (legacy) mode; use target_registry/target_tools in multi-target mode"
)
raise AttributeError(name)
async def _run_streamable_http_async(self, *, sse: bool = False) -> None:
"""Run Streamable HTTP with SDK OAuth or legacy Bearer authentication."""
import uvicorn
if self.oauth_provider is not None and sse:
raise ValueError("MCP OAuth mode supports STREAMABLE HTTP only")
app: Any = self.mcp.sse_app() if sse else self.mcp.streamable_http_app()
if self.oauth_provider is not None:
app = self.oauth_provider.bind_http_lifespan(app)
api_key = os.getenv("MCP_API_KEY")