unifi-mcp-server: Command for Claude Code

.claude/commands/unifi-api-docs-update.md

unifi-api-docs-update is a command for Claude Code from enuno/unifi-mcp-server. It costs 12 tokens per session (973 once invoked), scanned A, original, Apache-2.0.

A command that reads the official UniFi API documentation and updates the project's UNIFI_API.md file with newly found endpoints and examples.

In plain words
What is it for?
Use it to refresh documentation for UniFi's Site Manager, Network, and Protect APIs, review the detected changes, and see a summary of the update.
Why use it?
It removes the need to manually compare UniFi's website with your local API notes, reducing the chance that the documentation falls behind.

Command for Claude Code

Written for Claude Code: allowed-tools in frontmatter.

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 →

Needs its repository: it runs a file that does not travel with it, so clone the repository first. The line is node scripts/update-api-docs.js.

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-api-docs-update.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-api-docs-update

README.md
[![agentmods](https://agentmods.dev/badge/commands/enuno/unifi-mcp-server/unifi-api-docs-update/github.svg)](https://agentmods.dev/commands/enuno/unifi-mcp-server/unifi-api-docs-update)
Your own site
<a href="https://agentmods.dev/commands/enuno/unifi-mcp-server/unifi-api-docs-update"><img src="https://agentmods.dev/badge/commands/enuno/unifi-mcp-server/unifi-api-docs-update/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-api-docs-update

Your own site · 80×15
<a href="https://agentmods.dev/commands/enuno/unifi-mcp-server/unifi-api-docs-update"><img src="https://agentmods.dev/badge/commands/enuno/unifi-mcp-server/unifi-api-docs-update.svg" alt="Reviewed on agentmods" width="80" height="20"></a>
Per session 12 Only the description is in the session, so the agent can decide to use it. The body loads when it is invoked.
When invoked 973 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.00012 $0.00973
Opus 5 $0.00006 $0.00487
Sonnet 5 $0.00002 $0.00195
Haiku 4.5 $0.00001 $0.00097

Measured 9d ago against content hash 2973961c90fe, method: parsed. Prices are Anthropic first-party input rates as of 2026-09-08, from the pricing page.

Security

Grade A, and why

unifi-api-docs-update 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 9d 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.

- Code examples (curl commands)
.claude/commands/unifi-api-docs-update.md · 140 lines

What it actually says

Scrape the latest UniFi API documentation from developer.ui.com and update docs/UNIFI_API.md with newly discovered endpoints.

This command runs the scripts/update-api-docs.js Puppeteer-based scraper to fetch API documentation from the official UniFi developer site and compare it against the current documentation.

API Sources:

Steps to execute:

  1. Verify dependencies are installed:

    npm list puppeteer
    

    If not installed, run: npm install puppeteer

  2. Run the API documentation updater:

    node scripts/update-api-docs.js
    
  3. Review the changes:

    • Check how many new endpoints were discovered
    • Verify the markdown formatting is correct
    • Review the extracted examples and descriptions
  4. Show summary:

    git diff --stat docs/UNIFI_API.md
    

What the script does:

  1. Extracts endpoints from each API source:

    • Navigates to the getting started page
    • Discovers all endpoint links from the sidebar
    • Filters out non-API pages (getting started, guides, etc.)
  2. Compares with existing documentation:

    • Loads current docs/UNIFI_API.md
    • Checks if each endpoint is already documented
    • Identifies new endpoints to add
  3. Extracts detailed information for new endpoints:

    • HTTP method (GET, POST, PUT, PATCH, DELETE)
    • Endpoint path
    • Description
    • Code examples (curl commands)
    • Reference link to official docs
  4. Updates documentation:

    • Generates markdown sections for each API product
    • Adds new endpoints with proper formatting
    • Appends sections to existing documentation
    • Preserves all existing content

Expected output:

🔍 UniFi API Documentation Updater

Loading existing documentation...
✓ Loaded (42243 characters)

Processing Site Manager v1.0.0...
  Loading https://developer.ui.com/site-manager/v1.0.0/gettingstarted...
  ✓ Found 11 endpoints
  → 4 new endpoints found
    Extracting: Query ISP Metrics...
    Extracting: List SD-WAN Configs...
    Extracting: Get SD-WAN Config by ID...
    Extracting: Get SD-WAN Config Status...

Processing Network v10.1.68...
  Loading https://developer.ui.com/network/v10.1.68/gettingstarted...
  ✓ Found 74 endpoints
  → 3 new endpoints found
    Extracting: Adopt Devices...
    Extracting: List DPI Application Categories...
    Extracting: Quick Start...

Processing Protect v6.2.83...
  Loading https://developer.ui.com/protect/v6.2.83/gettingstarted...
  ✓ Found 41 endpoints
  → 36 new endpoints found
    Extracting: Get application information...
    Extracting: Get viewer details...
    [... more endpoints ...]

Generating updated documentation...
✓ Updated documentation saved to: docs/UNIFI_API.md

📊 Summary:
  Site Manager: +4 new endpoints
  Network: +3 new endpoints
  Protect: +36 new endpoints

✅ Complete!

Report back with:

  • Number of new endpoints discovered per API product
  • Total lines added to documentation
  • Any errors or warnings during extraction
  • Git diff statistics showing the changes

Safety checks:

  • Script only adds new endpoints, never removes existing content
  • All official API URLs are hardcoded (no user input)
  • Runs in headless mode (no manual interaction needed)
  • Timeout handling for slow pages
  • Error handling to skip problematic endpoints

Notes:

  • The script uses Puppeteer to scrape public documentation (no authentication required)
  • First run may take 2-3 minutes depending on network speed
  • Subsequent runs will be faster as most endpoints are already documented
  • Script is safe to run multiple times (idempotent)
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. 9d ago First seen · 140 lines · 12 tokens per session scan A 2973961c90fe

Subscribe to this mod's changes

unifi-api-docs-update is a command published in the GitHub repository enuno/unifi-mcp-server (247 stars, last pushed 2d ago), licensed Apache-2.0. It adds 12 tokens to every session and 973 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.