Docker Deployment
ctk is a single static Go binary, making it trivial to containerize.
Dockerfile
Section titled “Dockerfile”FROM golang:1.24-alpine AS builderWORKDIR /appCOPY go.mod go.sum ./RUN go mod downloadCOPY . .RUN CGO_ENABLED=0 go build -o /ctk ./cmd/ctk
FROM alpine:3.21RUN apk add --no-cache ca-certificatesCOPY --from=builder /ctk /usr/local/bin/ctkENTRYPOINT ["ctk"]CMD ["mcp"]Build and run:
docker build -t ctk .docker run -i --rm \ -e CONFLUENCE_DOMAIN=mycompany \ -e CONFLUENCE_EMAIL=jane@example.com \ -e CONFLUENCE_API_TOKEN=your-api-token \ ctkDocker Compose
Section titled “Docker Compose”stdio mode (for local MCP clients)
Section titled “stdio mode (for local MCP clients)”services: ctk: build: . stdin_open: true environment: - CONFLUENCE_DOMAIN=mycompany - CONFLUENCE_EMAIL=jane@example.com - CONFLUENCE_API_TOKEN=${CONFLUENCE_API_TOKEN}HTTP Streamable mode (for remote access)
Section titled “HTTP Streamable mode (for remote access)”services: ctk: build: . command: ["mcp", "--port", "8080"] ports: - "8080:8080" environment: - CONFLUENCE_DOMAIN=mycompany - CONFLUENCE_EMAIL=jane@example.com - CONFLUENCE_API_TOKEN=${CONFLUENCE_API_TOKEN} - CTK_ENABLE_WRITES=true restart: unless-stoppedRead-only mode (production)
Section titled “Read-only mode (production)”services: ctk: build: . command: ["mcp", "--port", "8080"] ports: - "8080:8080" env_file: .env restart: unless-stopped # CTK_ENABLE_WRITES is NOT set — all writes are blocked by defaultWith environment file
Section titled “With environment file”Create a .env file:
CONFLUENCE_DOMAIN=mycompanyCONFLUENCE_EMAIL=jane@example.comCONFLUENCE_API_TOKEN=your-api-tokenCONFLUENCE_TOKEN_TYPE=classicKubernetes
Section titled “Kubernetes”apiVersion: apps/v1kind: Deploymentmetadata: name: ctkspec: replicas: 1 selector: matchLabels: app: ctk template: metadata: labels: app: ctk spec: containers: - name: ctk image: ctk:latest args: ["mcp", "--port", "8080"] ports: - containerPort: 8080 envFrom: - secretRef: name: confluence-credentials env: - name: CTK_ENABLE_WRITES value: "false" resources: requests: memory: "32Mi" cpu: "50m" limits: memory: "128Mi" cpu: "200m"---apiVersion: v1kind: Servicemetadata: name: ctkspec: selector: app: ctk ports: - port: 8080 targetPort: 8080Create the secret:
kubectl create secret generic confluence-credentials \ --from-literal=CONFLUENCE_DOMAIN=mycompany \ --from-literal=CONFLUENCE_EMAIL=jane@example.com \ --from-literal=CONFLUENCE_API_TOKEN=your-api-tokenWrite Gating in Production
Section titled “Write Gating in Production”By default, ctk runs in read-only mode — write operations (create, update, delete, move pages) are disabled. This is ideal for production deployments where agents should only read content.
To enable writes explicitly:
environment: - CTK_ENABLE_WRITES=trueDisabling Tools in Production
Section titled “Disabling Tools in Production”Restrict available tools for security:
environment: - CTK_DISABLED_TOOLS=manage_comments,manage_attachments