Skip to content

Commit 82a315d

Browse files
committed
Fallback to user/pass creds if no auth server is configured
1 parent 2ee5e5d commit 82a315d

File tree

2 files changed

+3
-2
lines changed

2 files changed

+3
-2
lines changed

src/mcp_server_uyuni/config.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@
1616

1717
UYUNI_MCP_HOST = os.environ.get("UYUNI_MCP_HOST", "127.0.0.1")
1818
UYUNI_MCP_PORT = int(os.environ.get("UYUNI_MCP_PORT", "8000"))
19-
UYUNI_AUTH_SERVER = os.environ.get("UYUNI_AUTH_SERVER")
19+
UYUNI_AUTH_SERVER = os.environ.get("UYUNI_AUTH_SERVER", None)
2020

2121
UYUNI_MCP_SSL_VERIFY = (
2222
os.environ.get("UYUNI_MCP_SSL_VERIFY", "true").lower()

src/mcp_server_uyuni/server.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1551,7 +1551,8 @@ def main_cli():
15511551
logger.info("Running Uyuni MCP server.")
15521552

15531553
if CONFIG["UYUNI_MCP_TRANSPORT"] == Transport.HTTP.value:
1554-
mcp.add_middleware(AuthTokenMiddleware())
1554+
if CONFIG["AUTH_SERVER"]:
1555+
mcp.add_middleware(AuthTokenMiddleware())
15551556
mcp.run(transport="streamable-http", host=CONFIG["UYUNI_MCP_HOST"], port=CONFIG["UYUNI_MCP_PORT"])
15561557
elif CONFIG["UYUNI_MCP_TRANSPORT"] == Transport.STDIO.value:
15571558
mcp.run(transport="stdio")

0 commit comments

Comments
 (0)