forked from enuno/unifi-mcp-server
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathdocker-compose.yml
More file actions
114 lines (104 loc) · 3.14 KB
/
docker-compose.yml
File metadata and controls
114 lines (104 loc) · 3.14 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
version: '3.8'
services:
# UniFi MCP Server
unifi-mcp:
build:
context: .
dockerfile: Dockerfile
container_name: unifi-mcp-server
restart: unless-stopped
stdin_open: true # -i flag for STDIO transport
tty: false
environment:
# UniFi API Configuration
UNIFI_API_KEY: ${UNIFI_API_KEY:?UNIFI_API_KEY required}
UNIFI_API_TYPE: ${UNIFI_API_TYPE:-cloud}
UNIFI_HOST: ${UNIFI_HOST:-api.ui.com}
UNIFI_PORT: ${UNIFI_PORT:-443}
UNIFI_LOCAL_HOST: ${UNIFI_LOCAL_HOST:-}
UNIFI_VERIFY_SSL: ${UNIFI_VERIFY_SSL:-true}
UNIFI_SITE: ${UNIFI_SITE:-default}
# MCP Server Configuration
MCP_SERVER_PORT: ${MCP_SERVER_PORT:-3000}
MCP_LOG_LEVEL: ${MCP_LOG_LEVEL:-INFO}
# Optional: Rate Limiting
UNIFI_RATE_LIMIT: ${UNIFI_RATE_LIMIT:-100}
UNIFI_TIMEOUT: ${UNIFI_TIMEOUT:-30}
UNIFI_MAX_RETRIES: ${UNIFI_MAX_RETRIES:-3}
# Optional: Agnost Performance Tracking
AGNOST_ENABLED: ${AGNOST_ENABLED:-false}
AGNOST_ORG_ID: ${AGNOST_ORG_ID:-}
AGNOST_ENDPOINT: ${AGNOST_ENDPOINT:-https://api.agnost.ai}
AGNOST_DISABLE_INPUT: ${AGNOST_DISABLE_INPUT:-false}
AGNOST_DISABLE_OUTPUT: ${AGNOST_DISABLE_OUTPUT:-false}
# Optional: Redis Caching
REDIS_HOST: ${REDIS_HOST:-redis}
REDIS_PORT: ${REDIS_PORT:-6379}
REDIS_DB: ${REDIS_DB:-0}
REDIS_PASSWORD: ${REDIS_PASSWORD:-}
# Optional: Webhook Support
WEBHOOK_SECRET: ${WEBHOOK_SECRET:-}
networks:
- mcp-network
depends_on:
- redis
volumes:
- ./logs:/app/logs
- ./audit.log:/app/audit.log
healthcheck:
test: ["CMD", "python", "-c", "import httpx; httpx.get('http://localhost:3000/health')"]
interval: 30s
timeout: 10s
retries: 3
start_period: 40s
# MCP Toolbox - Analytics and Monitoring Dashboard
mcp-toolbox:
image: us-central1-docker.pkg.dev/database-toolbox/toolbox/toolbox:${TOOLBOX_VERSION:-0.14.0}
container_name: mcp-toolbox
restart: unless-stopped
ports:
- "${TOOLBOX_PORT:-8080}:8080"
command:
- "--tools-file"
- "/app/tools.yaml"
- "--telemetry-otlp"
- "https://api.agnost.ai/v1/otel/${AGNOST_ORG_ID}"
- "--telemetry-service-name"
- "${TOOLBOX_SERVICE_NAME:-unifi-mcp-toolbox}"
volumes:
- ./tools.yaml:/app/tools.yaml:ro
networks:
- mcp-network
healthcheck:
test: ["CMD", "wget", "--quiet", "--tries=1", "--spider", "http://localhost:8080/health"]
interval: 30s
timeout: 10s
retries: 3
start_period: 10s
# Redis Cache (Optional but recommended)
redis:
image: redis:7-alpine
container_name: unifi-mcp-redis
restart: unless-stopped
command: >
redis-server
--appendonly yes
--requirepass ${REDIS_PASSWORD:-}
--maxmemory 256mb
--maxmemory-policy allkeys-lru
volumes:
- redis-data:/data
networks:
- mcp-network
healthcheck:
test: ["CMD", "redis-cli", "ping"]
interval: 10s
timeout: 3s
retries: 3
start_period: 5s
networks:
mcp-network:
driver: bridge
volumes:
redis-data:
driver: local