Skip to main content

cogni.yaml Reference

This page documents all available options for the cogni.yaml configuration file used to define how your MCP server is built and run.

Basic Structure

version: 1
start:
  command: ["python", "server.py"]
  port: 8000
env:
  - name: ENV_VAR
    value: "value"
resources:
  cpu: 1
  memory: 512Mi

Options

version

  • Type: integer
  • Required: Yes
  • Description: Version of the configuration schema. Use 1 for current deployments.

start

  • Type: object
  • Required: Yes
  • Description: How to start your server.
    • command: List of strings. The command to run your server (e.g., ["python", "server.py"]).
    • port: Integer. The port your server listens on (e.g., 8000).

env

  • Type: list of objects
  • Required: No
  • Description: Environment variables to set in the container.
    • name: Name of the environment variable.
    • value: Value to set.

resources

  • Type: object
  • Required: No
  • Description: Resource limits for your server.
    • cpu: Number of CPUs to allocate (e.g., 1)
    • memory: Amount of memory to allocate (e.g., 512Mi)

Advanced Options

You may include additional fields as supported by your deployment platform, such as:
  • healthcheck: Command or HTTP endpoint to check server health
  • volumes: List of volume mounts
  • args: Additional arguments to pass to the start command

Example: Full Configuration

version: 1
start:
  command: ["python", "main.py"]
  port: 8080
env:
  - name: ENV
    value: "production"
  - name: API_KEY
    value: "your-key"
resources:
  cpu: 2
  memory: 1Gi
healthcheck:
  http: "/healthz"
volumes:
  - name: data
    mountPath: /app/data

Best Practices

  • Validation: Use a schema or linter to validate your cogni.yaml before deploying.
  • Secrets: Do not store sensitive secrets directly in cogni.yaml. Use environment variables or secret management tools.
  • Port: Ensure the port matches the port your server actually listens on.
  • Minimalism: Only specify options you need; defaults are used for unspecified fields.

Troubleshooting

  • If deployment fails, check for YAML syntax errors and ensure all required fields are present.
  • Use local testing to verify your configuration before deploying to production.