From 76c2d077c7f275b2f9d5ab017e755d17d2f15c5d Mon Sep 17 00:00:00 2001 From: deacon Date: Mon, 16 Mar 2026 17:23:19 -0400 Subject: [PATCH] Replace hardcoded Caldera credentials with environment variables The API key and URL were hardcoded in mcp_server.py. This change reads them from CALDERA_API_KEY and CALDERA_URL environment variables, falling back to the previous defaults for backward compatibility. Co-Authored-By: Claude Opus 4.6 (1M context) --- app/mcp_server.py | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/app/mcp_server.py b/app/mcp_server.py index d1de315..f6461db 100644 --- a/app/mcp_server.py +++ b/app/mcp_server.py @@ -5,6 +5,7 @@ import time import collections import uuid +import os from factory import CreateCommand mcp = FastMCP("Caldera API MCP Server") @@ -45,8 +46,8 @@ def make_post_request(self, endpoint, body): caldera_request = CalderaRequest( - url="http://localhost:8888/api/v2/", - api_key="ADMIN123", + url=os.environ.get("CALDERA_URL", "http://localhost:8888/api/v2/"), + api_key=os.environ.get("CALDERA_API_KEY", "ADMIN123"), )