Config-as-Code

How template-agent and template-ui load configuration at runtime without embedding prompts or branding in code.

template-agent and template-ui separate runtime behavior from application code. Secrets stay in environment variables; operational and presentation settings load from config files at startup (with selective hot-reload on the UI).

template-mcp-server uses environment variables only (Pydantic settings from .env) — no config/agent/ tree. Tool implementations live under template_mcp_server/src/tools/.

Philosophy

Principletemplate-agenttemplate-ui
Agent/UI logic in codedeep_agent/, Fastify routersReact components, proxy translation
Behavior & branding in configconfig/agent/config/ui/settings.yaml
Secrets in env.env / OpenShift Secrets.env / OpenShift Secrets
Stateless deploySwap config without rebuilding for most changesHot-reload branding and agent endpoint

template-agent: config/agent/

config/agent/
├── PROMPT.md               # Orchestrator prompt + frontmatter
├── subagents/*.md          # Subagent definitions
├── skills/*/               # Skill documents (see Agent Skills spec)
├── mcp.json                # MCP server registry
├── runtime/agent.yaml      # Cache, memory, providers, middleware
└── deployment/values.yaml  # GitOps reference values

What lives in frontmatter (markdown)

Orchestrator and subagent files use YAML frontmatter for:

  • model — LLM model name or provider block
  • tools — built-in tool allow list
  • skills — skill documents to load (see Agent Skills specification)
  • mcps — MCP server keys from mcp.json

Skills (config/agent/skills/)

Each skill is a directory with a SKILL.md file following the Agent Skills specification. Skills package domain workflows (prompts, references, scripts) that orchestrators and subagents invoke via frontmatter skills: lists. Evaluations live under config/agent/skills/*/evals/.

What lives in runtime/agent.yaml

  • Agent identity (name)
  • Provider profiles and resolve_strategy
  • Cache and memory consolidation settings
  • Middleware (guardrails, audit, PII)
  • OpenTelemetry and observability toggles

What lives in .env

  • POSTGRES_*, REDIS_URL — infrastructure
  • GOOGLE_APPLICATION_CREDENTIALS_CONTENT — Vertex AI
  • ENABLE_AUTH, SSO_* — authentication
  • LANGFUSE_* — tracing
  • MCP_TOKEN_ENCRYPTION_KEY — OAuth/DCR token storage

Info Info

template-ui: config/ui/settings.yaml

config/ui/
├── settings.yaml           # Runtime config (optional)
├── README.md               # Full schema
└── examples/               # minimal, blue-theme, red-hat-branding, production

Key sections

branding:
  title: "My Agent"
  logo_url: "/logo.svg"
  colors:
    light: { primary: "#0066cc", accent: "#a60000", ... }
    dark: { ... }

features:
  debug_mode_default: false
  auth_enabled: false

agent:
  endpoint: ""
  timeout_ms: 30000
  streaming: true

Environment overrides

Env vars override YAML (examples):

VariableOverrides
BRANDING_TITLEbranding.title
FEATURE_AUTH_ENABLEDfeatures.auth_enabled
AGENT_ENDPOINT / AGENT_HOSTagent.endpoint

Hot-reload

Branding and agent.endpoint reload without restart. Security settings (rate_limit, session, helmet) require a server restart.

Info Info

Full reference: UI Configuration.

template-mcp-server: .env

VariableDefaultPurpose
MCP_HOSTlocalhostBind address
MCP_PORT5001Server port
MCP_TRANSPORT_PROTOCOLhttphttp, sse, or streamable-http
ENABLE_AUTHFalse in .env.exampleOAuth resource server
POSTGRES_*compose defaultsOAuth token storage when auth enabled

See template-mcp-server README and Authentication guide.

Side-by-side comparison

Concerntemplate-agenttemplate-uitemplate-mcp-server
Prompts / routingPROMPT.md, subagents/N/A (proxies agent)N/A
Tools / MCPmcp.json + frontmatter mcpsMCP status UI onlyPython tools in src/tools/
Model selectionFrontmatter modelN/AN/A
BrandingN/Asettings.yaml brandingN/A
AuthENABLE_AUTH, SSO_*AUTH_ENABLED, SSO_*, COOKIE_SIGNENABLE_AUTH, SSO_*, SESSION_SECRET
Agent URLN/A (is the agent)AGENT_HOST / agent.endpointN/A
ComplianceGuardrails, audit middlewareOPA config/compliance/Tool-level validation

GitOps and OpenShift

  • Mount config/agent/ or subsets via ConfigMaps; secrets via Secrets → env vars
  • Mount config/ui/settings.yaml as ConfigMap; SSO and cookie signing as Secrets
  • Reference values: config/agent/deployment/values.yaml in template-agent