Skip to main content
Catie MCP

Deployment Basics

Deployment Basics

This guide covers the fundamental approaches to deploying MCP Catie (Context Aware Traffic Ingress Engine) in various environments.

Deployment Options

MCP Catie can be deployed in several ways depending on your infrastructure requirements:

  1. Standalone Binary: Direct deployment of the compiled Go binary
  2. Docker Container: Containerized deployment using Docker
  3. Kubernetes: Orchestrated deployment in Kubernetes clusters
  4. Cloud Platforms: Deployment on managed cloud services

Standalone Binary Deployment

For simple deployments or development environments, you can run MCP Catie directly as a compiled binary.

Prerequisites

  • Go 1.18 or higher (for building)
  • Linux, macOS, or Windows environment

Steps

  1. Build the binary:
go build -o mcp-catie ./cmd/main.go
  1. Create your configuration file:
cp router_config.yaml.example router_config.yaml
# Edit router_config.yaml to match your environment
  1. Run the service:
./mcp-catie
  1. Verify the service is running:
curl http://localhost:80/health

Docker Deployment

Docker provides a consistent deployment environment and simplifies dependency management.

Prerequisites

  • Docker installed on your host system

Steps

  1. Build the Docker image:
docker build -t mcp-catie:latest .
  1. Run the container:
docker run -d \
  --name mcp-catie \
  -p 80:80 \
  -v $(pwd)/router_config.yaml:/app/router_config.yaml \
  mcp-catie:latest
  1. Check container status:
docker ps
docker logs mcp-catie

Docker Compose Deployment

For multi-container deployments, Docker Compose offers a convenient way to define and run services.

Prerequisites

  • Docker and Docker Compose installed

Steps

  1. Create a docker-compose.yml file:
version: '3'
services:
  mcp-catie:
    build: .
    ports:
      - "80:80"
    volumes:
      - ./router_config.yaml:/app/router_config.yaml
    restart: unless-stopped
    healthcheck:
      test: ["CMD", "curl", "-f", "http://localhost/health"]
      interval: 30s
      timeout: 10s
      retries: 3
  1. Start the services:
docker-compose up -d
  1. View logs:
docker-compose logs -f

Kubernetes Deployment

For production environments, Kubernetes provides scalability, high availability, and automated management.

Prerequisites

  • Kubernetes cluster
  • kubectl configured

Steps

  1. Create a ConfigMap for the router configuration:
apiVersion: v1
kind: ConfigMap
metadata:
  name: mcp-catie-config
data:
  router_config.yaml: |
    resources:
      "^weather/.*": "http://weather-service:8080/mcp"
      "^database/.*": "http://database-service:8080/mcp"
    tools:
      "^calculator$": "http://calculator-service:8080/mcp"
      "^translator$": "http://translator-service:8080/mcp"
    default: "http://default-service:8080/mcp"
    ui:
      username: "admin"
      password: "your_secure_password"
  1. Create a Deployment:
apiVersion: apps/v1
kind: Deployment
metadata:
  name: mcp-catie
  labels:
    app: mcp-catie
spec:
  replicas: 2
  selector:
    matchLabels:
      app: mcp-catie
  template:
    metadata:
      labels:
        app: mcp-catie
    spec:
      containers:
      - name: mcp-catie
        image: mcp-catie:latest
        imagePullPolicy: Always
        ports:
        - containerPort: 80
        volumeMounts:
        - name: config-volume
          mountPath: /app/router_config.yaml
          subPath: router_config.yaml
        livenessProbe:
          httpGet:
            path: /health
            port: 80
          initialDelaySeconds: 30
          periodSeconds: 10
        readinessProbe:
          httpGet:
            path: /health
            port: 80
          initialDelaySeconds: 5
          periodSeconds: 5
      volumes:
      - name: config-volume
        configMap:
          name: mcp-catie-config
  1. Create a Service:
apiVersion: v1
kind: Service
metadata:
  name: mcp-catie
spec:
  selector:
    app: mcp-catie
  ports:
  - port: 80
    targetPort: 80
  type: ClusterIP
  1. Apply the configurations:
kubectl apply -f configmap.yaml
kubectl apply -f deployment.yaml
kubectl apply -f service.yaml
  1. Check deployment status:
kubectl get pods
kubectl logs -l app=mcp-catie

Environment Variables

MCP Catie supports the following environment variables for configuration:

Variable Description Default
CONFIG_FILE Path to the router configuration file router_config.yaml
PORT Port to listen on 80
LOG_LEVEL Logging level (debug, info, warn, error) info
METRICS_ENABLED Enable Prometheus metrics true

Production Considerations

When deploying to production environments, consider the following:

  1. High Availability: Deploy multiple instances behind a load balancer
  2. Monitoring: Set up Prometheus and Grafana for metrics visualization
  3. Logging: Configure centralized logging with ELK or similar stack
  4. Security:
    • Use HTTPS with proper certificates
    • Implement network policies to restrict access
    • Regularly update dependencies and the base image
  5. Configuration Management: Use secrets management for sensitive configuration
  6. Resource Limits: Set appropriate CPU and memory limits

Troubleshooting

Common deployment issues and their solutions:

  1. Service Unavailable:

    • Check if the service is running: docker ps or kubectl get pods
    • Verify network connectivity: curl http://service-ip/health
    • Check logs for errors: docker logs mcp-catie or kubectl logs pod-name
  2. Configuration Issues:

    • Validate YAML syntax: yamllint router_config.yaml
    • Check if the configuration file is mounted correctly
    • Verify the configuration is being loaded (check logs)
  3. Performance Problems:

    • Check resource usage: docker stats or Kubernetes metrics
    • Review Prometheus metrics for bottlenecks
    • Consider scaling horizontally by adding more replicas

Next Steps

After basic deployment, consider exploring: