Prompt: a single-server fleet
Paste everything below the line into your agent.Deploy the UniFi MCP server as a single-server fleet with the Ansible playbook in
deploy/ansible/ of https://github.com/enuno/unifi-mcp-server:
the server, one worker, Redis and Postgres, all as containers on one Linux
host. Read deploy/ansible/README.md 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/single/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: losingvault_fleet_credential_keymakes the stored controller keys unreadable. - Before you run the playbook, show me the inventory and
group_vars/all/main.ymland 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: the host’s SSH address and user, the UniFi API type, the controller’s address and port if local, whether its certificate is self-signed, the UniFi API key, how many days of audit records to keep (default 365), and whether to send audit records to a SIEM (then its target URL).
- Install
ansible-core2.15 or later if needed and the collections inrequirements.ymlintodeploy/ansible/collections. Check SSH and sudo withansible -i inventories/single/hosts.yml all -m ping -b. - Edit
inventories/single/hosts.yml(keep themcp,redisandpostgresgroups on the one host) andgroup_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 on the host:
curl -fsS http://127.0.0.1:3000/healthzreturns{"status":"ok"};- the
initializerequest from the README, with the bearer token from the vault (read into a variable, never echoed), returns aserverInfo; docker psshowsunifi-mcp-0,unifi-mcp-worker-0,unifi-mcp-redisandunifi-mcp-postgres, the server healthy;docker logs unifi-mcp-worker-0shows health checks completing;- the server connects as
unifi_mcp_runtime, not the owner:docker exec unifi-mcp-postgres psql -U unifi_mcp -d unifi_mcp -c "select usename from pg_stat_activity where datname='unifi_mcp'"; crontab -las root lists the audit retention job, and/opt/unifi-mcp/audit-retention.shrun once by hand exits 0.
- Tell me how to connect my MCP client (URL through an SSH tunnel or a TLS
proxy, the bearer header, and how to read the token with
ansible-vault view), and how to issue per-person tokens with roles:docker exec unifi-mcp-0 python -m src.fleet.cli tokens create --name <who> --role <role>, with a role ofviewer,operator,adminorfleet-admin(SECURITY.md).
