unifi-mcp-server: Command for Claude Code

.claude/commands/unifi-mcp-live-test.md

unifi-mcp-live-test is a command for Claude Code from enuno/unifi-mcp-server. It costs 24 tokens per session (3,786 once invoked), scanned A, original, Apache-2.0.

A command for testing the UniFi MCP Server against configured live environments and opening GitHub issues when failures are found. It can then ask an automated Claude workflow to develop, test, and submit fixes.

In plain words
What is it for?
Use it to discover environments from .env, choose which ones to test, sanitize results, create issue reports, and start automated remediation.
Why use it?
It turns failures discovered outside local development into tracked repair work while masking credentials and other sensitive details in reports.

Command for Claude Code

Written for Claude Code: allowed-tools in frontmatter. Also seen: names the AskUserQuestion tool; positional $N argument.

This is enuno/unifi-mcp-server's own configuration. It tells Claude Code how to work on unifi-mcp-server itself, so it is not a mod to install elsewhere. Copy it as a starting point and replace the rules that are about this project. Everything unifi-mcp-server configures →

Reuse

Borrowing it

Nothing to install: this file belongs to enuno/unifi-mcp-server. Take a copy, put it at the same path in your own repository, and replace the rules that are about this project with yours.

Copy the file
curl -O https://raw.githubusercontent.com/enuno/unifi-mcp-server/main/.claude/commands/unifi-mcp-live-test.md
Clone the repo
git clone --depth 1 https://github.com/enuno/unifi-mcp-server

Made for: Claude Code.

Wrote this? Show the measurements

A badge with what this costs and how it scanned, read live from this page, so it follows the numbers instead of freezing them. Markdown for a README, HTML for a documentation site or a project page.

agentmods badge for unifi-mcp-live-test

README.md
[![agentmods](https://agentmods.dev/badge/commands/enuno/unifi-mcp-server/unifi-mcp-live-test/github.svg)](https://agentmods.dev/commands/enuno/unifi-mcp-server/unifi-mcp-live-test)
Your own site
<a href="https://agentmods.dev/commands/enuno/unifi-mcp-server/unifi-mcp-live-test"><img src="https://agentmods.dev/badge/commands/enuno/unifi-mcp-server/unifi-mcp-live-test/github.svg" alt="Measured on agentmods" height="20"></a>

Or the 80×15 button, for a site that already has a row of RSS and ATOM ones. Only the verdict fits; the numbers stay here.

agentmods 80×15 button for unifi-mcp-live-test

Your own site · 80×15
<a href="https://agentmods.dev/commands/enuno/unifi-mcp-server/unifi-mcp-live-test"><img src="https://agentmods.dev/badge/commands/enuno/unifi-mcp-server/unifi-mcp-live-test.svg" alt="Reviewed on agentmods" width="80" height="20"></a>
Per session 24 Only the description is in the session, so the agent can decide to use it. The body loads when it is invoked.
When invoked 3,786 The whole file, excluding the scripts and references it only reads on demand.
Security scan A 1 finding. A grade says what 26 rules found in the file — not that it is safe.
Origin original No closer match found in the catalogue.
Token cost

What it costs to keep this loaded

Counted locally with the o200k_base tokenizer, which is exact for GPT models; Claude uses its own tokenizer and its counts differ. Treat this as one consistent yardstick across the catalogue rather than a bill. Prices are per million input tokens.

ModelPer sessionOnce invoked
Fable 5.1 $0.00024 $0.03786
Opus 5 $0.00012 $0.01893
Sonnet 5 $0.00005 $0.00757
Haiku 4.5 $0.00002 $0.00379

Measured 12d ago against content hash 7028f8f21019, method: parsed. Prices are Anthropic first-party input rates as of 2026-09-11, from the pricing page.

Security

Grade A, and why

unifi-mcp-live-test scanned grade A with 1 finding against 26 rules in 11 categories — prompt injection, anti-refusal, data exfiltration, privilege escalation, supply chain, agent snooping, system-prompt leakage, SSRF and excessive agency — measured 12d ago.

A static scan of the body, not an audit. Every finding is printed with the line that produced it so you can judge whether it matters here. A mod is markdown that instructs an agent; that is exactly why what it instructs is worth reading.

Makes network callslowCapability

Not a fault in itself. Listed so you know the mod talks to something, and to what.

- Bash(curl:*)
.claude/commands/unifi-mcp-live-test.md · 458 lines

How it starts

The opening of the file, as written. The whole thing — 458 lines — stays where its author put it; the contents beside it link to each section on GitHub.

UniFi MCP Server - Live Environment Testing & Automated Remediation

Purpose

Automatically discover UniFi environments from .env, execute comprehensive tests, sanitize results, create GitHub issues for bugs, and automatically instruct the @claude bot to develop and submit fixes via PRs.

Key Features:

  • Portable: No hardcoded IPs/hostnames; auto-discovers from .env.
  • Secure: Masks credentials and sanitizes IP addresses in logs.
  • Interactive: Prompts user to select which discovered environments to test.
  • Automated Remediation: Creates GitHub issues, waits for Triage Bot, and assigns @claude to fix, test, and PR.

Phase 1: Pre-Flight Checks and Environment Discovery

1.1 Verify Prerequisites

echo "╔════════════════════════════════════════════════════╗"
echo "║   UNIFI MCP LIVE TEST & REMEDIATION - STARTING     ║"
echo "╚════════════════════════════════════════════════════╝"
echo ""

# Check Node.js
if command -v node &> /dev/null; then
  echo "✅ Node.js: $(node --version)"
else
  echo "❌ Node.js not installed"
  exit 1
fi

# Check Python/UV
if command -v python3 &> /dev/null; then
  echo "✅ Python: $(python3 --version | head -1)"
else
  echo "❌ Python3 not installed"
  exit 1
fi

# Check GitHub CLI (Critical for Phase 4 & 5)
if command -v gh &> /dev/null; then
  echo "✅ GitHub CLI: $(gh --version | head -1)"
  gh auth status &> /dev/null || { echo "❌ GitHub CLI not authenticated. Run 'gh auth login' first."; exit 1; }
else
  echo "❌ GitHub CLI not installed - required for automated remediation"
  exit 1
fi

# Check MCP server exists
if [ -f src/main.py ]; then
  echo "✅ MCP server found (src/main.py)"
else
  echo "❌ src/main.py not found"
  exit 1
fi

echo ""

1.2 Discover Test Environments from .env

echo "Discovering test environments from .env..."

if [ ! -f .env ]; then
  echo "❌ .env file not found. Please create one based on .env.example."
  exit 1
fi

# Initialize discovery variables
HAS_CLOUD=false
HAS_LOCAL=false
HAS_AUTH=false

# Check Cloud
if grep -q "^UNIFI_HOST=" .env; then
  CLOUD_HOST=$(grep "^UNIFI_HOST=" .env | cut -d= -f2 | tr -d '"' | tr -d "'")
  if [ ! -z "${CLOUD_HOST}" ] && [ "${CLOUD_HOST}" != "your-host-here" ]; then
    echo "✅ Found Cloud API configuration: ${CLOUD_HOST}"
    HAS_CLOUD=true
  fi
fi

# Check Local
if grep -q "^UNIFI_LOCAL_HOST=" .env; then
  LOCAL_HOST=$(grep "^UNIFI_LOCAL_HOST=" .env | cut -d= -f2 | tr -d '"' | tr -d "'")
  if [ ! -z "${LOCAL_HOST}" ] && [ "${LOCAL_HOST}" != "your-host-here" ]; then
    # Get SSL setting
    LOCAL_SSL="false"
    grep -q "^UNIFI_LOCAL_VERIFY_SSL=true" .env && LOCAL_SSL="true"
    echo "✅ Found Local Gateway configuration: ${LOCAL_HOST} (SSL: ${LOCAL_SSL})"
    HAS_LOCAL=true
  fi
fi

# Check Auth
if (grep -q "^UNIFI_API_KEY=" .env && [ $(grep "^UNIFI_API_KEY=" .env | cut -d= -f2 | wc -c) -gt 5 ]) || \
   (grep -q "^UNIFI_USERNAME=" .env && grep -q "^UNIFI_PASSWORD=" .env); then
  echo "✅ Authentication configured"
  HAS_AUTH=true
fi

if [ "${HAS_CLOUD}" = "false" ] && [ "${HAS_LOCAL}" = "false" ]; then
  echo "❌ No valid environments found in .env"
  exit 1
fi

if [ "${HAS_AUTH}" = "false" ]; then
  echo "❌ No valid authentication found in .env"
  exit 1
fi

Read the full file on GitHub · 458 lines

Changes

What this file has done since we first saw it

Hashed on every crawl. A supply-chain change to an agent config is a question of when, not whether, so the history is kept rather than the latest state alone.

  1. 12d ago First seen · 458 lines · 24 tokens per session scan A 7028f8f21019

Subscribe to this mod's changes

unifi-mcp-live-test is a command published in the GitHub repository enuno/unifi-mcp-server (250 stars, last pushed 5d ago), licensed Apache-2.0. It adds 24 tokens to every session and 3,786 once invoked, about $0.0001 per session on Opus 5. A static security scan graded it A with 1 finding (makes network calls). No closer match exists in the catalogue, so it is treated as the original; first seen 2026-08-30.