From c56f9c05937ea514333c279909c246bdc16010cd Mon Sep 17 00:00:00 2001 From: Xavier Coulon Date: Thu, 15 Jan 2026 10:39:33 +0100 Subject: [PATCH] refactor: bind to 127.0.0.1:8080 by default when deployed, the container will be accessed via kube-rbac-proxies Signed-off-by: Xavier Coulon --- Containerfile | 2 +- cmd/start_server.go | 2 +- compose.yaml | 4 ++-- 3 files changed, 4 insertions(+), 4 deletions(-) diff --git a/Containerfile b/Containerfile index f1fac27..41e976e 100644 --- a/Containerfile +++ b/Containerfile @@ -30,7 +30,7 @@ ENV ARGOCD_URL=https://argocd-server ENV ARGOCD_TOKEN=secure-token ENV ARGOCD_MCP_SERVER_INSECURE=false ENV ARGOCD_MCP_SERVER_DEBUG=false -ENV ARGOCD_MCP_SERVER_LISTEN_HOST=0.0.0.0 +ENV ARGOCD_MCP_SERVER_LISTEN_HOST=127.0.0.1 ENV ARGOCD_MCP_SERVER_LISTEN_PORT=8080 # Run as non-root user diff --git a/cmd/start_server.go b/cmd/start_server.go index e3c9463..364fa34 100644 --- a/cmd/start_server.go +++ b/cmd/start_server.go @@ -59,7 +59,7 @@ var startServerCmd = &cobra.Command{ logger := slog.New(slog.NewTextHandler(cmd.ErrOrStderr(), &slog.HandlerOptions{ Level: lvl, })) - logger.Info("starting the Argo CD MCP server", "transport", transport, "argocd-url", argocdURL, "insecure", argocdInsecure, "debug", debug) + logger.Info("starting the Argo CD MCP server", "transport", transport, "listen", listen, "argocd-url", argocdURL, "insecure", argocdInsecure, "debug", debug) if debug { lvl.Set(slog.LevelDebug) logger.Debug("debug mode enabled") diff --git a/compose.yaml b/compose.yaml index 1eb0f17..a07bf46 100644 --- a/compose.yaml +++ b/compose.yaml @@ -26,7 +26,7 @@ services: - ARGOCD_TOKEN=secure-token - ARGOCD_MCP_SERVER_INSECURE=true - ARGOCD_MCP_SERVER_DEBUG=true - - ARGOCD_MCP_SERVER_LISTEN_HOST=0.0.0.0 + - ARGOCD_MCP_SERVER_LISTEN_HOST=0.0.0.0 # here we need to bind to 0.0.0.0 to be able to connect to the server from the host machine - ARGOCD_MCP_SERVER_LISTEN_PORT=8080 argocd-mcp-server-unreachable: # instance of the Argo CD MCP server with an invalid URL for the Argo CD server @@ -38,5 +38,5 @@ services: - ARGOCD_TOKEN=secure-token - ARGOCD_MCP_SERVER_INSECURE=true - ARGOCD_MCP_SERVER_DEBUG=true - - ARGOCD_MCP_SERVER_LISTEN_HOST=0.0.0.0 + - ARGOCD_MCP_SERVER_LISTEN_HOST=0.0.0.0 # here we need to bind to 0.0.0.0 to be able to connect to the server from the host machine - ARGOCD_MCP_SERVER_LISTEN_PORT=8080