The golf command-line interface is your primary tool for managing GolfMCP projects.

Commands

golf init

Initializes a new GolfMCP project directory with Golf branding and modern authentication setup.
golf init my_awesome_server
project_name
string
required
The name of the project and the directory to be created.
--output-dir
string
Specifies a different directory to create the project in. Defaults to a new directory named project_name in the current location.Alias: -o

golf build

Builds your GolfMCP project into a runnable MCP server. The build process includes enhanced authentication handling and validation.
golf build dev
The build environment parameter is required and must be either dev or prod:
Development (dev)Production (prod)
• Copies .env file to dist/ directory
• Environment variables loaded from local file
• Optimized for local development and testing
• No .env file copied
• Environment variables expected at runtime
• Optimized for production deployment

golf run

Runs a previously built GolfMCP server with enhanced runtime features.
golf run
Make sure to run golf build before using golf run. For automatic telemetry with Golf Platform, set GOLF_API_KEY before running (see Telemetry).