feat(agiliton-account): per-customer LiteLLM MCP server provisioning

At first login, provisionMcpServer() creates a sitebridge-{customer_id}
entry in LiteLLM DB via POST /v1/mcp/server, pointing to the customer's
demux URL. The virtual key is then scoped to ["sitebridge-{customer_id}"]
so LiteLLM routes tool calls only to that customer's WebSocket.

Also adds AGILITON_ACCOUNT_URL config for self-referencing in MCP URLs.

CF-3032

Co-Authored-By: Claude Sonnet 4.6 (1M context) <noreply@anthropic.com>
This commit is contained in:
Christian Gick
2026-04-10 16:18:02 +03:00
parent 21780d3e45
commit 52c2e9eca5
3 changed files with 61 additions and 1 deletions

View File

@@ -31,6 +31,9 @@ export const config = {
litellmUrl: envOptional("LITELLM_URL", "http://litellm:4000"),
litellmMasterKey: env("LITELLM_MASTER_KEY"),
// Self-referencing URL for MCP demux (used in LiteLLM MCP server registration)
agilitonAccountUrl: envOptional("AGILITON_ACCOUNT_URL", "http://agiliton-account:4100"),
// Shared secret used by LiteLLM when calling /mcp/demux/:id/mcp
mcpBridgeSecret: env("MCP_BRIDGE_SECRET"),