# caveauDbnAgent — n8n starter workflow A clonable n8n agent that drives the Do Better Norge legal tools over MCP. One **MCP Client Tool** node connects to the DBN bridge and enumerates the **whole** catalog automatically (currently **23** `dbn.*` tools) — the catalog is dynamic (`includes/DbnMcpRuntime.php::tools()`), so new tools appear without editing this workflow. ## What's in `caveauDbnAgent.json` ``` When chat message received ─▶ DBN Agent (AI Agent) ├─ ai_languageModel ◀─ Chat Model (placeholder) └─ ai_tool ◀─ DBN MCP Tools ``` - **DBN Agent** — system prompt steers the default chain `dbn.search_legal → dbn.legal_analysis → dbn.korrespond` and enforces the process-and-forget privacy rule (never auto-saves; suggests `dbn.redact`). - **DBN MCP Tools** — MCP Client Tool node, `httpStreamable` transport, `https://mcp.dobetternorge.no/mcp`, Bearer auth, `include: all`. - **Chat Model** — a placeholder `lmChatOpenAi` node. **No cloud spend is wired by the template** — you attach your own credential. ## Import + wire it up (Dave's step — no n8n API access from here) 1. **n8n → Workflows → Import from File** → pick `caveauDbnAgent.json`. 2. **Mint a DBN MCP token**: log in at , create a user token (looks like `dbn_user_mcp_...`). Copy it once. 3. **DBN MCP Tools node → Credential → Bearer Auth**: paste the token as the bearer value. (The node sends `Authorization: Bearer dbn_user_mcp_...`.) 4. **Chat Model node → Credential**: attach your existing OpenAI-compatible credential — e.g. the colin LiteLLM proxy (`http://10.0.1.10:4000`, base-URL override on an OpenAI cred) or Azure OpenAI. Set the model to one your key can serve (e.g. `gpt-4o`). 5. **Open the chat** (the trigger node's built-in chat) and ask, e.g.: *"Min sønn ble akuttplassert av barnevernet. Hva er fristene og hvilke rettigheter har jeg?"* The agent should call `dbn.search_legal` / `dbn.legal_analysis` and answer with cited sources. ## Notes - The DBN tools require an active DBN member session behind the token; the token carries the user/tenant + scopes. Keep the token secret (vault it; don't commit). - If the MCP node lists zero tools, re-check the bearer token and that the bridge (`mcp.dobetternorge.no`, caveau-mcp container `dobetternorge-mcp:3002` on colin) is up. - This starter matches the live catalog as of 2026-06-21. Re-export from n8n if you customize it so the repo copy stays current.