--- name: mintlify-docs description: Use when maintaining, validating, updating or publishing this repository's Mintlify documentation site - docs.json, .mintignore, .mintlify/, the navigation tree, a published page, the agent skills the site serves, or the mintlify-docs and mintlify MCP servers - and for audit, update, verify, release-sync and publish runs against them. license: Apache-2.0 metadata: author: UniFi MCP Server Team version: "1.0.0" --- # Mintlify Documentation Maintenance This repository publishes its documentation as a Mintlify site. The site is built from the Git repository, so **Git is the source of truth**; the Mintlify admin MCP is an editing and publishing surface over that same repository, not a second copy of the content. Two MCP servers are involved, and they are not interchangeable: | Server | Purpose | Authority | |---|---|---| | `mintlify-docs` | Read-only. Mintlify's own documentation: file structure, `docs.json`, MDX, components, skills, the admin MCP. | Mintlify's product docs | | `mintlify` | Read/write. The admin MCP for this project: pages, navigation, `docs.json`, branches, publication, deployments. | This project's site | **The `mintlify` admin MCP is the primary tool for every site operation** — reading pages, inspecting navigation, editing content, publishing, and verifying a deployment. The `mint` CLI has no `publish` command at all; publication is an admin-MCP-only action. The skill directory `mintlify-docs` is a repository-local skill. It is **not** the `mintlify-docs` MCP server, and it is not a page on the published site. ## When to use this skill Use it when the request touches any of: - `docs.json`, `.mintignore`, `.mintlify/`, or the navigation tree - a documentation page: `index.mdx`, a root-level `*.md`, or anything under `docs/` - the published site (`https://unifi-mcp-docs.hashgrid.net`) and the agent skills it serves - the `mintlify-docs` or `mintlify` MCP servers - a request to audit, update, verify, release-sync, or publish the documentation Do not use it for server code, MCP tools, or controller behaviour. Those are covered by `skills/unifi-mcp-tool-builder/SKILL.md` and the tool-set skills. ## Required access | Need | How | If missing | |---|---|---| | Mintlify product guidance | The `mintlify-docs` MCP server | Fall back to `https://www.mintlify.com/docs`, clearly labelled as the web fallback. Never invent Mintlify behaviour. | | Read, edit and publish this project | The `mintlify` admin MCP, with `subdomain` set to this project | Report the blocker. Do not edit Git and the dashboard independently. | | Build and link validation | `mint validate` and `mint broken-links` | See *Validation* below — these have no admin-MCP equivalent. | ### Resolving the project Do not assume a subdomain. Resolve it, then confirm it belongs to this repository: ``` mintlify.list_deployments() -> [{subdomain, name, projectType}] mintlify.list_branches(subdomain) -> {branches, deployBranch} ``` The deploy branch is `main`. The branch list matches this repository's branches, and the site's content matches the files in the working tree — that pair of checks is what identifies the project, not the display name. `get_deployment_settings` and `list_repos_and_prs` need the `deployment:read` scope. A connection without it returns `insufficient_scope`; that is a scope limitation on the OAuth grant, not a missing project. ## Repository discovery Run this first. Every later step depends on it. ```bash cd /home/elvis/projects/unifi-mcp-server git remote -v # origin must be enuno/unifi-mcp-server git rev-parse --abbrev-ref HEAD # current branch git rev-parse HEAD # commit under audit git status -sb # must be clean, or say why not ``` Then read the site configuration: - `docs.json` — theme, brand colours, logo, the navigation tree, navbar, footer, redirects, SEO and integrations. This is the site's structure. - `.mintignore` — gitignore-style. It decides what is *not* published. - `.mintlify/skills/` — the agent skills the site serves. All six entries are symlinks into `skills/`; `.mintlify/skills/mintlify-docs/` is a real directory whose source of truth is its own `SKILL.md`. - `index.mdx` — the landing page. The only `.mdx` page in the repository. - Root-level `*.md` — `API.md`, `SPEC.md`, `SECURITY.md`, `ROADMAP.md`, `NETWORK_PLAYBOOK.md`, `METRICS.md`, `A2A.md`, `WEBHOOK_SETUP.md`, `MULTI_CONTROLLER.md`, `HARBOR_SETUP.md`, `MCP_TOOLBOX.md`, `TEST_STRATEGY.md`, `commands.md`, `SKILL.md`. - `docs/` — `docs/SKILLS.md`, `docs/UNIFI_API.md`, `docs/DISASTER_RECOVERY.md`, `docs/FLEET_SCALING_PLAN.md`, `docs/RELEASE_PROCESS.md`, `docs/AI-Coding/*`, `docs/deploy-prompts/*`. **The documentation root is the repository root, not `docs/`.** Most pages are root-level Markdown files that are published as pages. `docs/` holds a minority. ### What is published Mintlify auto-ignores the root `README.md`, `LICENSE.md`, `CHANGELOG.md` and `CONTRIBUTING.md` at *every* level, and `.gitignore`, `.github`, `.claude`, `.agents`, `.cursor`, `.idea`, `.vscode`, `node_modules`. `.mintignore` adds the internal agent instructions (`AGENTS.md`, `CLAUDE.md`, `GEMINI.md`), the working documents (`DEVELOPMENT_PLAN.md`, `GAP_REPORT.md`, `TODO.md`, `MAINTENANCE_POLICY.md`, `RELEASE_CHECKLIST.md`, `RELEASE_NOTES_0.2.5.md`), `docs/archive/`, `docs/research/`, `.serena/`, `.analysis-reports/`, `scripts/`, the Helm chart templates and CI files, the compose files, and `*.yaml` / `*.yml`. Two consequences that bite: - **A root file named `README.md`, `CHANGELOG.md`, `CONTRIBUTING.md` or `LICENSE.md` is unreachable as a page**, even though it is on disk. That is why the deployment pages were renamed to `overview.md` — `deploy/ansible/overview.md`, `deploy/helm/unifi-mcp/overview.md` and `docs/deploy-prompts/overview.md`. `docs.json` carries redirects for the four root files to their GitHub URLs. - **Published URLs drop the file extension.** An internal link written as `page.md` or `../other/page.md` resolves to a path the site does not serve. Use site-root-relative paths (`/docs/page`) between published pages. ### Navigation and orphans `docs.json` currently holds 30 pages across three tabs. The *Guides* tab carries the landing page, the skills guide, the commands reference, the network playbook, the metrics runbook, the disaster-recovery runbook and nine Deployment pages. The *API reference* tab carries the API catalogue, the UniFi API notes, the toolbox reference, the A2A and webhook guides, and the specification, test-strategy, security and roadmap pages. The *Contributing* tab carries the five AI-coding pages and the release process. The page paths in `docs.json` are site paths, not file paths: the entry `/docs/SKILLS` resolves to the file `docs/SKILLS.md`, and `commands` resolves to `commands.md`. The admin MCP's `read` takes the site path, with or without a leading slash. The admin MCP's `list_nodes` with `type: "page"` returns the same 30 paths. That equality is the check: the local `docs.json` navigation and the deployed navigation must agree exactly. Every navigation path must resolve to a real file that survives the ignore rules. A path that exists on disk but is excluded is a build failure that reads like a missing file. Adding a page means three coordinated edits, not one: 1. the page file itself, 2. its `docs.json` navigation entry, 3. any inbound links, using the published path form. `status` on the admin MCP reports `orphanCount` (currently 7 on `main`). Those are files the build publishes but navigation does not reach — mostly the `docs.md` Noridoc stubs under `src/` and `tests/`, and the developer skills under `skills/` that are not symlinked into `.mintlify/skills/`. A new page that is not added to navigation increases that count. ### The skills the site serves Mintlify serves every directory under `.mintlify/skills/` to agents as a skill. The published slug is the **frontmatter `name`**, so it must match the directory name, and it must be unique: if two directories resolve to the same slug, Mintlify publishes only one and warns in the deployment log. Slugs use lowercase letters, numbers and hyphens only. Verify what is actually served with a plain HTTP request — no login, no MCP: ```bash curl -sSL -o /dev/null -w "%{http_code}\n" \ https://unifi-mcp-docs.hashgrid.net/.well-known/skills//SKILL.md ``` The path form that works is `/.well-known/skills//SKILL.md`. The directory index forms — `/.well-known/skills/`, `/.well-known/skills/` and `/.well-known/agent-skills/` — all return 404 on this site. A 404 on the per-skill path means the skill is not deployed yet, which is the expected answer for a skill that exists only on a branch. All 16 skills under `skills/` are exposed through matching entries under `.mintlify/skills/`. The library includes `unifi-channel-planning`, `unifi-cloud-fleet-tools`, `unifi-devices`, `unifi-discovery`, `unifi-docs-sync`, `unifi-fleet-operations`, `unifi-mcp-setup`, `unifi-mcp-tool-builder`, `unifi-network`, `unifi-network-config-tools`, `unifi-protect`, `unifi-protect-tools`, `unifi-safe-changes`, `unifi-security`, `unifi-security-tools` and `unifi-system`. The separate `mintlify-docs` maintenance skill also remains available under `.mintlify/skills/`. Verify the live endpoints after deployment; local links alone do not prove publication. ### Mintlify parses `.md` with the MDX parser Valid Markdown can still break the build. Three constructs are hazards: - Markdown autolinks: `` — write a normal link instead - HTML comments: `` — write `{/* ... */}` - a bare `<` followed by a digit: `<300 Mbps` — write "under 300 Mbps" Braces and angle brackets **inside backtick code spans** are literal and are not hazards. The CLI reports only the first MDX error per file, so scan every candidate page for all three up front rather than fixing one build at a time. ## Evidence requirements A technical claim in the documentation must trace to implementation. Before changing one, inspect the code it describes. For this project, that means: - **Exact tool names, signatures, defaults and return shapes.** Tools are plain `async def` functions in `src/tools/*.py`; there is no `@mcp.tool()` decorator. Read the function, not a summary of it. - **Registration and availability.** A module is registered in `_LOCAL_TOOL_MODULES` or `_CLOUD_TOOL_MODULES` in `src/main.py`. `UNIFI_PROFILE` narrows the set via `_PROFILE_MODULES`. An unknown profile logs a warning and loads everything. - **Read vs write.** Every tool carries `@read_tool` or `@write_tool` from `src/utils/tool_kind.py`. `UNIFI_READ_ONLY` registers only read tools; `UNIFI_DRY_RUN` forces dry runs. Write tools take `confirm` and `dry_run`, and call `validate_confirmation()` before any request. - **Risk tiers and audit.** `tool_tier()` in `src/tool_registry.py` returns `read`, `write` or `destructive`. `delete_`, `remove_` and `bulk_delete_` prefixes and the `DESTRUCTIVE_TOOLS` set are destructive. Every mutating call is audited by the registry wrapper. Roles in `src/access.py` are `viewer`, `operator`, `admin` and `fleet-admin`, mapped to tiers by `ROLE_TIERS`. - **API modes.** `local`, `cloud-v1` and `cloud-ea` (`APIType` in `src/config/config.py`). Local is the only mode with the full surface. `CLOUD` is a legacy alias for `cloud-ea`. - **Environment variables.** 65 `validation_alias` values are defined in `src/config/config.py`. Read them there; `.env.example` is the documented list. Never invent a key. - **Deployment interfaces.** `docker-compose*.yml`, `deploy/ansible/` and `deploy/helm/unifi-mcp/`. ### Distinguish four levels of truth Keep these apart in the documentation and in any audit report: 1. **Planned** — in `DEVELOPMENT_PLAN.md` or `TODO.md`, not implemented. 2. **Implemented** — the code exists. 3. **Mock-tested** — unit-tested against a mocked controller. This proves the request shape, not that the endpoint exists on real firmware. 4. **Verified against a controller** — exercised on real hardware. Level 3 is the ceiling for most of this project. Say which level applies. ### Counting tools Count from the running server, not from a grep: ```bash .venv/bin/python - <<'PY' import os, asyncio os.environ.update(UNIFI_API_KEY="x", UNIFI_API_TYPE="local", UNIFI_LOCAL_HOST="192.0.2.1") import src.main as M async def go(): print("tools:", len(await M.mcp.list_tools())) asyncio.run(go()) PY ``` This reports **343 in local mode** and **71 in cloud mode** — the figures `README.md` and `docs/SKILLS.md` carry. The per-profile counts in `docs/SKILLS.md` include the four fleet tools each profile also gets (`fleet_health`, `fleet_sites`, `fleet_inventory`, `fleet_fanout`), which is why they run ahead of the module-only numbers. A profile's count is its module tools plus those four. ## Modes The mode is the shape of the task. When the intent is unclear, use **audit**. ### audit Read-only. Review the documentation against the implementation and, where accessible, against the remote Mintlify content. Make no changes. Resolve and read the remote site with the admin MCP: - `list_deployments` — resolve the project - `list_branches` — confirm the deploy branch and that the branches match this repository - `read` with `path` — remote page content - `search` with `query` — where a term appears remotely - `list_nodes` with `type: "page"` — the deployed navigation tree - `diff` and `status` — unpublished remote changes and the orphan count - `deployment_status` — what is live, and from which commit Then compare against the implementation as described under *Evidence requirements*. Report per claim: the claim, the source path and lines, and the verification level. "No confirmed drift within the inspected scope" is a valid result. ### update Prepare and apply a bounded, explicitly authorized documentation change. 1. Establish the scope, the relevant diff or release, and the exact target page or file. 2. Consult `mintlify-docs` for current guidance on anything Mintlify-specific. 3. Inspect the implementation the change describes, and the affected documentation. 4. Present a concise page-level change plan, including the navigation and link changes the new content implies. 5. Prepare the focused content change. 6. Validate it — see *Validation* below. 7. Apply it through the verified workflow — see *Applying changes*. 8. Read the result back and compare it with what was approved. 9. Publish only after explicit publication approval. ### verify Validate an existing change without rewriting anything. Run the checks, report each as passed, failed, blocked or not run, and stop at the first real failure. ### release-sync Reconcile the documentation against an explicitly selected release or commit range. Do not infer the release version from a single metadata file — confirm it from the tag and the diff: ```bash git tag --list 'v*' --sort=-v:refname | head -5 git diff --stat v0.6.1..HEAD -- '*.md' '*.mdx' docs.json ``` Check, for every changed surface: whether `API.md` describes the change, whether `README.md` and `.env.example` still agree with `src/config/config.py`, whether `CHANGELOG.md` has the entry, whether the version and tool counts across `README.md`, `CLAUDE.md`, `docs/SKILLS.md` and `index.mdx` still agree, and whether the navigation still resolves. ### publish Publish an approved revision and verify the deployment. See *Publishing* below — publication carries its own approval. ## Applying changes ### Through the admin MCP The admin MCP's content tools take a `branch` on every call, and the server does not remember a branch between calls. - On the deploy branch (`main`), an edit lands as an **unpublished change**, visible to collaborators in the dashboard editor but not on the site. - On any other branch, the edit goes through a pull request. - `publish` is the only thing that makes a change live. Content tools: `edit_page` (targeted replacements; the default), `write_page` (whole-file replacement; slow for large pages and it resends the entire page), `create_node` (a new page, group, tab, anchor, version, language or product), `update_node`, `move_node`, `delete_node`, `update_config` (for `docs.json` except `navigation`), and `suggest_edit` (a tracked suggestion a human accepts or rejects; the page does not change until they do). `edit_page` returns `notRendered` when the edit adds markup the editor drops (`