FROM node:20-slim AS base

WORKDIR /app

# Install the CLI globally from npm (includes bundled servers)
# Override at build time for staging package:
#   --build-arg PACKAGE_NAME=@kylewadegrove/cutline-mcp-cli-staging
ARG PACKAGE_NAME=@vibekiln/cutline-mcp-cli
ARG PACKAGE_TAG=latest
RUN npm install -g "${PACKAGE_NAME}@${PACKAGE_TAG}"

# Default to the main constraints server (cutline-server.js)
# Override with: docker run ... cutline-mcp serve premortem
ENTRYPOINT ["cutline-mcp"]
CMD ["serve", "constraints"]
