From 23e70e46d004227022540674f78a91bddd57ff97 Mon Sep 17 00:00:00 2001 From: Jacob Magar Date: Sat, 14 Mar 2026 14:17:14 -0400 Subject: [PATCH] refactor(creds): remove per-tool elicitation from unraid_users --- unraid_mcp/tools/users.py | 21 +-------------------- 1 file changed, 1 insertion(+), 20 deletions(-) diff --git a/unraid_mcp/tools/users.py b/unraid_mcp/tools/users.py index b94973c..13a3090 100644 --- a/unraid_mcp/tools/users.py +++ b/unraid_mcp/tools/users.py @@ -6,21 +6,11 @@ Note: Unraid GraphQL API does not support user management operations (list, add, from typing import Any, Literal -from fastmcp import Context as _Context from fastmcp import FastMCP from ..config.logging import logger from ..core.client import make_graphql_request -from ..core.exceptions import CredentialsNotConfiguredError as _CredErr from ..core.exceptions import ToolError, tool_error_handler -from ..core.setup import elicit_and_configure as _elicit - - -# Re-export at module scope so tests can patch "unraid_mcp.tools.users.elicit_and_configure" -# and "unraid_mcp.tools.users.CredentialsNotConfiguredError" -elicit_and_configure = _elicit -CredentialsNotConfiguredError = _CredErr -Context = _Context QUERIES: dict[str, str] = { @@ -42,7 +32,6 @@ def register_users_tool(mcp: FastMCP) -> None: @mcp.tool() async def unraid_users( action: USER_ACTIONS = "me", - ctx: Context | None = None, ) -> dict[str, Any]: """Query current authenticated user. @@ -56,15 +45,7 @@ def register_users_tool(mcp: FastMCP) -> None: with tool_error_handler("users", action, logger): logger.info("Executing unraid_users action=me") - try: - data = await make_graphql_request(QUERIES["me"]) - except CredentialsNotConfiguredError: - configured = await elicit_and_configure(ctx) - if not configured: - raise ToolError( - "Credentials required. Run `unraid_health action=setup` to configure." - ) - data = await make_graphql_request(QUERIES["me"]) + data = await make_graphql_request(QUERIES["me"]) return data.get("me") or {} logger.info("Users tool registered successfully")