Mockzilla logo

Configuration

Mockzilla is configured with environment variables. This page covers the settings the server actually reads.

Environment Variables

Core Settings

VariableDescriptionDefault
PORTPort the server listens on.36666
NODE_ENVdevelopment or production.development in Docker Compose
DEPLOY_MODEfull serves the dashboard and APIs and redirects / to /app. landing serves only the marketing pages and docs; /app and /api return 404.full
NEXT_TELEMETRY_DISABLEDSet to 1 to disable Next.js telemetry.1 in Docker
NODE_ORIGINSComma-separated hosts allowed to open the development server from another device, such as 192.168.1.10.(none)

Database

Mockzilla stores folders and mocks in PostgreSQL through Drizzle ORM.

VariableDescription
DATABASE_URLPostgreSQL connection string. If it is not set, Mockzilla uses an embedded PGlite database instead.
MOCKZILLA_DATA_DIRDirectory for PGlite data when DATABASE_URL is unset. Defaults to ./data (/app/data in the Docker image).
POSTGRES_USER / POSTGRES_PASSWORD / POSTGRES_DBUsed by the development docker-compose.yaml to create its PostgreSQL container. All default to mockzilla.

To keep PGlite data between container restarts, mount a volume at /app/data:

docker run -p 36666:36666 -v mockzilla-data:/app/data andrecrjr/mockzilla:latest

Data Generation

VariableDescriptionDefault
MOCKZILLA_MAX_ITEMSUpper limit for generated arrays. Arrays with no maxItems in their schema generate this many items.1000

Docker Compose example

# docker-compose.yaml snippet
services:
  app:
    environment:
      - PORT=36666
      - DATABASE_URL=postgresql://mockzilla:mockzilla@postgres:5432/mockzilla
    ports:
      - "36666:36666"

Advanced Settings

CORS

Every /api/* response, including served mocks and MCP, includes CORS headers. Mockzilla echoes the request's Origin (or * when there is none), allows credentials, and answers OPTIONS preflight requests directly. There is no origin allow-list to configure, so put Mockzilla behind your own proxy if you need to restrict access.

MCP (Model Context Protocol)

The MCP endpoint is /api/mcp, for example http://localhost:36666/api/mcp. It needs no extra configuration. See AI Integration (MCP).