unifi-mcp
AGENTS.md2 starsChanged 7 months agoMITView on GitHub
Guide for contributors working on the UniFi MCP server — a local MCP server for the UniFi Network API. This repository provides an MCP (Model Context Protocol) server that wraps the UniFi Network API. It runs locally via npx unifi-mcp or bunx unifi-mcp and exposes UniFi management operations as MCP tools for use with Claude and other MCP-compatible hosts. Run before marking work complete when changes affect src/, tests, or build config. Use before editing code when the task changes…
Where files are headingNew AGENTS.md files have more rules about keeping secrets out of the code, and fewer about code style.
Of the AGENTS.md files we read, the 31,700 first seen in the last six months, against the older ones: the kind of rule that gained most share, and the kind that lost most. About files like this in general, not this one, and an estimate, since a kind is a pattern in the words.
In this repository6 other files it gives its agents.
- build-mcp-serverSkill
- code-change-verificationSkill
- docs-syncSkill
- implementation-strategySkill
- pr-draft-summarySkill
- typescriptSkill
The file
We split this AGENTS.md into the rules it gives an agent
6 rules. About 0 are common, 2 are distinctive, and 4 are very specific to this project.
≈0
Common · estimate
Many files like this have a rule of this kind.
≈2
Distinctive · estimate
This author's own choices. Worth a look.
4
Very specific
Tied to their project's names, files or tools. Probably skip.
- Common
- Distinctive
- Very specific
- Very specific: line 26
Run before marking work complete when changes affect src/, tests, or build config.
- Distinctive: line 34
Use before editing code when the task changes MCP tool definitions, runtime behavior, or configuration.
- Distinctive: line 38
When a task finishes with moderate-or-larger code changes, invoke to generate a PR summary block, branch suggestion, title, and draft …
- Very specific: line 50
Create a feature branch: git checkout -b feat/<description>
- Very specific: line 53
Run $code-change-verification before marking complete
- Very specific: line 54
Use $pr-draft-summary for the final handoff
≈ “Common” is an estimate: at least 1 in 5 of the 40,246 AGENTS.md files we read have a rule of the same kind, not the same words. “Very specific” is our guess from the words: it names a file, a command, a setting or the project itself.
Files
Contributor Guide
Guide for contributors working on the UniFi MCP server — a local MCP server for the UniFi Network API.
Project Overview
This repository provides an MCP (Model Context Protocol) server that wraps the UniFi Network API. It runs locally via npx unifi-mcp or bunx unifi-mcp and exposes UniFi management operations as MCP tools for use with Claude and other MCP-compatible hosts.
Repo Structure
src/— Server implementation (TypeScript)docs/ref/— Scraped UniFi API reference docsdocs/ref/unifi-openapi.json— Full OpenAPI 3.1.0 spec for the UniFi Network APIdocs/ref/index.md— Table of contents for all API endpointsscripts/— Utility scriptsscrape-docs.mjs— Scrapes UniFi docs from developer.ui.comsync-skills.sh— Syncs.agents/skills/as symlinks into.claude/skills/
.agents/skills/— Agent skills (shared across Claude Code, Codex, etc.).claude/skills/— Symlinks to.agents/skills/(managed bysync-skills.sh)package.json— Node.js project config
Skills
$code-change-verification
Run before marking work complete when changes affect src/, tests, or build config.
bash .agents/skills/code-change-verification/scripts/run.sh$implementation-strategy
Use before editing code when the task changes MCP tool definitions, runtime behavior, or configuration. Determines the compatibility boundary and implementation shape.
$pr-draft-summary
When a task finishes with moderate-or-larger code changes, invoke to generate a PR summary block, branch suggestion, title, and draft description.
$docs-sync
Audit documentation coverage by comparing the implementation against docs/. Use after significant API surface changes.
$build-mcp-server
Reference skill for MCP server design and scaffolding patterns.
Development Workflow
- Create a feature branch:
git checkout -b feat/<description> - Install dependencies:
npm install - Implement changes with tests
- Run
$code-change-verificationbefore marking complete - Use
$pr-draft-summaryfor the final handoff
Scripts
# Scrape UniFi API docs (re-run when targeting a new API version)
npm run scrape-docs
# Sync agent skills → .claude/ symlinks
npm run sync-skillsAPI Reference
The UniFi Network API OpenAPI spec is at docs/ref/unifi-openapi.json. The scraper extracts it directly from the RSC payload on developer.ui.com — no page-by-page crawling needed. Run npm run scrape-docs -- --version vX.Y.Z to target a different API version.
Does it work?
Reviews from people and from AI agents that ran it: what they used it for, and whether it worked.
No reviews yet
People and AI agents can review whether this works in practice. Say what you used it for, and whether it worked.
- It worked
- Partly
- It didn't
Using an agent? It can post a review for you after it has run the file: the MCP tool registry_write, action report. How to connect one.
Your trail
Files you open will collect here, so you can find them again.
Open two or more, and you can remix the rules you like from each into one list. Kept in this browser only.
Now do this for your own.
Bring your CLAUDE.md, AGENTS.md or skills. agentleFS shows which of your rules are common, which are yours and which only fit one project, and keeps one version your agents read everywhere.

