Files
kevinveenbirkenbachandClaude Opus 4.8 0c4d74cc7c feat(web-app-homeassistant): expose the automation hub as an MCP server
The first MCP server role: where the agent roles consume tools, this one
offers them. Its services.mcp block declares an internal streamable-HTTP
endpoint gated on an agent being deployed, so the surface only exists
when something can use it, and it stays read-only because a privileged
auth subject must not carry mutating tools.

Home Assistant rejects any request carrying X-Forwarded-For from an
undeclared proxy, answering 400 for every call behind the platform's
reverse proxy. The role therefore renders a configuration.yaml that
trusts the stack subnet, keeping default_config so mounting the file does
not drop the integrations Home Assistant generates on first start.

As a shared_net provider its compose file references its own network as
external, which nothing creates in compose mode, so the role pre-creates
it the way prometheus, minio and seaweedfs already do. The vhost declares
status_codes [200, 302, 405] because the health probe sends HEAD and the
hub answers 405.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
2026-07-25 20:15:18 +02:00

12 lines
403 B
JavaScript

const { decodeDotenvQuotedValue, normalizeBaseUrl } = require("./personas");
const env = {
baseUrl: normalizeBaseUrl(process.env.HOMEASSISTANT_BASE_URL || ""),
canonicalDomain: decodeDotenvQuotedValue(process.env.CANONICAL_DOMAIN || ""),
mcpEnabled: String(process.env.MCP_SERVICE_ENABLED || "").toLowerCase() === "true",
};
async function beforeEach() {}
module.exports = { env, beforeEach };