Nano Banana Pro
Agent skill for nano-banana-pro
This file provides guidance to Claude Code (claude.ai/code) when working with code in this repository.
Sign in to like and favorite skills
This file provides guidance to Claude Code (claude.ai/code) when working with code in this repository.
UniFi MCP Server is a FastMCP-based Model Context Protocol server that provides tools for managing UniFi Network and Access controllers. The server exposes UniFi controller operations as MCP tools, enabling AI assistants to interact with UniFi infrastructure.
# Install dependencies using uv (preferred) pip install uv && uv sync # Or install with pip pip install -r requirements.txt # Install in development mode pip install -e .
# Start server via CLI python -m unifi_mcp start --host 127.0.0.1 --port 8000 # Start with debug mode python -m unifi_mcp start --host 127.0.0.1 --port 8000 --debug # Start with auto-reload (for development) python -m unifi_mcp start --reload # Or run directly python -c "from unifi_mcp.main import main; main()"
# Display current configuration python -m unifi_mcp config # Check server status python -m unifi_mcp status # Test controller connections python -m unifi_mcp test-connection network python -m unifi_mcp test-connection access # Run tests python tests/test_unifi_mcp.py
1. Configuration Layer (
config.py)
NetworkSettings, AccessSettings, LocalSettings (all inherit from UniFiSettings)ServerSettingsSettings class aggregates all configuration__ (e.g., UNIFI__NETWORK_CONTROLLER__HOST)2. Client Layer (
clients/)
/api/auth/login3. MCP Tools Layer (
tools/)
@tool decorators for each operation4. Server Layer (
server.py)
5. Data Models (
models/)
network.py: NetworkDevice, NetworkClient, NetworkWLAN, NetworkSiteaccess.py: Access controller models6. Utilities (
utils/)
retry_utils.py: Retry logic with exponential backoffvalidators.py: Input validation helpersUNIFI__)pyproject.toml under [tool.unifi-mcp] section.env file_authenticated flag before requestsauthenticate() method/api/auth/login, extracts CSRF tokenX-CSRF-Token headerTools are registered conditionally in
server.py:
if network_client: server.register_tool( lambda: get_unifi_sites(network_client), name="get_unifi_sites", description="...", )
This pattern allows:
pyproject.toml)verify_ssl=False)