Prompt: a cluster behind nginx
Paste everything below the line into your agent.Deploy the UniFi MCP server as a cluster with the Ansible playbook in
deploy/ansible/ of https://github.com/enuno/unifi-mcp-server: MCP replicas
and workers on two or more hosts, Redis and Postgres on a data host, and
nginx in front. Read deploy/ansible/README.md, MULTI_CONTROLLER.md (how
sessions stick to a replica) and the least-privilege and retention parts of
SECURITY.md first, and follow them.
Rules:
- Ask me for anything you need that you cannot find out yourself. Never guess addresses or credentials.
- Secrets go only in
inventories/cluster/group_vars/all/vault.yml, encrypted withansible-vault. Never print a secret, put one on a command line, or commit one. Generate every token, password and key yourself with the commands invault.yml.example, and tell me where they are, not what they are. Tell me to back up the vault and its password. - Before you run the playbook, show me the inventory,
group_vars/all/main.ymland the firewall rules you propose, and wait for my approval. - If a step fails, stop and tell me what failed and what you suggest. Do not disable TLS verification, the bearer token, least privilege, or any safety setting to get past an error.
- Ask me for: each host’s SSH address, its private address and its role
(
lb,mcp, data); the UniFi API type, controller address and port, whether its certificate is self-signed, and the API key; replicas and workers permcphost (default 2 and 1); the TLS certificate and key paths on thelbhost, or whether I want you to get one (ask how); audit retention days (default 365); and a SIEM target if any. - Check the private network: every
mcphost must reach the data host on 5432 and 6379, and thelbhost must reach eachmcphost’s replica ports. Nothing else should. Propose firewall rules that allow only that (I approve them before you apply them). If the private network is not trusted, stop and tell me: Redis and Postgres traffic is not encrypted by this playbook. - Install
ansible-core2.15 or later if needed and the collections inrequirements.ymlintodeploy/ansible/collections. Check SSH and sudo withansible -i inventories/cluster/hosts.yml all -m ping -b. - Edit
inventories/cluster/hosts.ymlandgroup_vars/all/main.yml. - Create and encrypt the vault with every value in
vault.yml.example. - Run
ansible-playbook ... --syntax-check, show me the plan, and after my approval run the playbook. - Verify:
- through nginx:
curl -fsS https://<lb>/healthzreturns{"status":"ok"}, and theinitializerequest from the README, with the bearer token from the vault (read into a variable, never echoed), returns aserverInfoand anmcp-session-idheader; - the same session works for a second request (
tools/listwith thatmcp-session-id), which shows nginx keeps a client on one replica; - on each
mcphost,docker psshows every replica healthy and the workers running; - the servers connect as
unifi_mcp_runtime, and the retention cron job exists on the firstmcphost only.
- through nginx:
- Tell me the client URL and header, how to read the token with
ansible-vault view, how to issue per-person tokens (python -m src.fleet.cli tokens create, run in any replica), and how to scale (changeunifi_mcp_replicasand rerun).
