unifi-mcp-server / rules
Cursor rule294 starsChanged 18 days agoApache-2.0View on GitHub
Environment variables and configuration setup
- Reads credentials
We split this environment-setup.mdc into the rules it gives an agent
3 rules. About 0 are common, 1 is distinctive, and 2 are very specific to this project.
≈0
Common · estimate
Many files like this have a rule of this kind.
≈1
Distinctive · estimate
This author's own choices. Worth a look.
2
Very specific
Tied to their project's names, files or tools. Probably skip.
- Common
- Distinctive
- Very specific
- could be automatic: a setting could enforce it
- Very specific: line 48
Always use .env.example as a template:
- Very specific: line 71
NEVER: commit .env files to version control
- Distinctive: line 72
ALWAYS: use environment variables for sensitive data
≈ “Common” is an estimate: at least 1 in 5 of the 6,350 Cursor rule 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
--- description: Environment variables and configuration setup globs: [".env*", "src/config/**/*.py"] alwaysApply: false --- # Environment Setup ## Required Environment Variables ```bash # Required UNIFI_API_KEY=your-api-key-here UNIFI_API_TYPE=cloud # or "local" UNIFI_HOST=api.ui.com # or local gateway IP UNIFI_SITE=default # Optional REDIS_HOST=localhost # Enable caching REDIS_PORT=6379 WEBHOOK_SECRET=your-secret # Enable webhook HMAC verification ``` ## Configuration Loading Order The server merges settings from **environment variables**, an optional `.env` file, and `src/config/config.py` (listed in order of precedence). ## API Configuration ### Cloud API (Default) ```bash UNIFI_API_TYPE=cloud UNIFI_CLOUD_API_URL=https://api.ui.com ``` ### Local Gateway Proxy ```bash UNIFI_API_TYPE=local UNIFI_LOCAL_HOST=192.168.2.1 UNIFI_LOCAL_PORT=443 UNIFI_LOCAL_VERIFY_SSL=true ``` ## Development Environment Always use `.env.example` as a template: ```bash # Copy example file cp .env.example .env # Never commit .env to version control # It's in .gitignore by default ``` ## Configuration in Code Load settings in Python using Pydantic: ```python from src.config.config import Settings settings = Settings() # Automatically loads from environment ``` ## Security Reminders - **NEVER** hardcode API keys in source code - **NEVER** commit `.env` files to version control - **ALWAYS** use environment variables for sensitive data - **ALWAYS** mask sensitive data in logs - **ALWAYS** validate configuration on startup
Where files are headingNew Cursor rule files have more rules about planning and tracking tasks, and fewer about code style.
Of the Cursor rule files we read, the 3,978 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 repository52 other files it gives its agents.
- AGENTS.mdAGENTS.md
- .agents/skills/fastmcp/CLAUDE.mdCLAUDE.md
- CLAUDE.mdCLAUDE.md
- .claude/skills/fastmcp/CLAUDE.mdCLAUDE.md
- .cursor/rules/common-mistakes.mdcCursor rule
- .cursor/rules/core-principles.mdcCursor rule
- .cursor/rules/mcp-tools.mdcCursor rule
- .cursor/rules/project-context.mdcCursor rule
- .cursor/rules/README.mdCursor rule
- .cursor/rules/unifi-api.mdcCursor rule
- .cursor/rules/workflow.mdcCursor rule
- FastMCP DevelopmentSkill
- mcp-builderSkill
- source-command-build-dockerSkill
- source-command-check-depsSkill
- source-command-cleanSkill
- source-command-docsSkill
- source-command-formatSkill
- source-command-lintSkill
- source-command-prSkill
- source-command-securitySkill
- source-command-setupSkill
- source-command-testSkill
- source-command-unifi-api-docs-update-2Skill
- source-command-unifi-api-docs-updateSkill
- source-command-unifi-mcp-add-toolSkill
- source-command-unifi-mcp-release-prepSkill
- source-command-unifi-mcp-test-coverageSkill
- source-command-unifi-mcp-update-docsSkill
- unifi-cloud-fleet-toolsSkill
- unifi-mcp-tool-builderSkill
- unifi-network-config-toolsSkill
- unifi-protect-toolsSkill
- unifi-security-toolsSkill
- FastMCP DevelopmentSkill
- mcp-builderSkill
- unifi-cloud-fleet-toolsSkill
- unifi-mcp-tool-builderSkill
- unifi-network-config-toolsSkill
- unifi-protect-toolsSkill
- unifi-security-toolsSkill
- unifiSkill
- unifi-channel-planningSkill
- unifi-cloud-fleet-toolsSkill
- unifi-devicesSkill
- unifi-mcp-tool-builderSkill
- unifi-network-config-toolsSkill
- unifi-networkSkill
- unifi-protect-toolsSkill
- unifi-securitySkill
- unifi-security-toolsSkill
- unifi-systemSkill
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.

