Skip to content

Commit b78b968

Browse files
authored
refactor: bind to 127.0.0.1:8080 by default (#43)
when deployed, the container will be accessed via kube-rbac-proxies Signed-off-by: Xavier Coulon <xcoulon@redhat.com>
1 parent 777aaec commit b78b968

3 files changed

Lines changed: 4 additions & 4 deletions

File tree

Containerfile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,7 @@ ENV ARGOCD_URL=https://argocd-server
3232
ENV ARGOCD_TOKEN=secure-token
3333
ENV ARGOCD_MCP_SERVER_INSECURE=false
3434
ENV ARGOCD_MCP_SERVER_DEBUG=false
35-
ENV ARGOCD_MCP_SERVER_LISTEN_HOST=0.0.0.0
35+
ENV ARGOCD_MCP_SERVER_LISTEN_HOST=127.0.0.1
3636
ENV ARGOCD_MCP_SERVER_LISTEN_PORT=8080
3737

3838
# Run as non-root user

cmd/start_server.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -59,7 +59,7 @@ var startServerCmd = &cobra.Command{
5959
logger := slog.New(slog.NewTextHandler(cmd.ErrOrStderr(), &slog.HandlerOptions{
6060
Level: lvl,
6161
}))
62-
logger.Info("starting the Argo CD MCP server", "transport", transport, "argocd-url", argocdURL, "insecure", argocdInsecure, "debug", debug)
62+
logger.Info("starting the Argo CD MCP server", "transport", transport, "listen", listen, "argocd-url", argocdURL, "insecure", argocdInsecure, "debug", debug)
6363
if debug {
6464
lvl.Set(slog.LevelDebug)
6565
logger.Debug("debug mode enabled")

compose.yaml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@ services:
2626
- ARGOCD_TOKEN=secure-token
2727
- ARGOCD_MCP_SERVER_INSECURE=true
2828
- ARGOCD_MCP_SERVER_DEBUG=true
29-
- ARGOCD_MCP_SERVER_LISTEN_HOST=0.0.0.0
29+
- 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
3030
- ARGOCD_MCP_SERVER_LISTEN_PORT=8080
3131
argocd-mcp-server-unreachable:
3232
# instance of the Argo CD MCP server with an invalid URL for the Argo CD server
@@ -38,5 +38,5 @@ services:
3838
- ARGOCD_TOKEN=secure-token
3939
- ARGOCD_MCP_SERVER_INSECURE=true
4040
- ARGOCD_MCP_SERVER_DEBUG=true
41-
- ARGOCD_MCP_SERVER_LISTEN_HOST=0.0.0.0
41+
- 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
4242
- ARGOCD_MCP_SERVER_LISTEN_PORT=8080

0 commit comments

Comments
 (0)