Core concepts
CLI
Reference for the GolfMCP command-line interface.
The golf
command-line interface is your primary tool for managing GolfMCP projects.
Commands
golf init
Initializes a new GolfMCP project directory.
The name of the project and the directory to be created.
Specifies a different directory to create the project in. Defaults to a new directory named project_name
in the current location.
Alias: -o
Use a specific project template.
Available templates:
default
- Standard GolfMCP project with example componentsapi_key
- Project pre-configured with API key authentication
golf build
Builds your GolfMCP project into a runnable MCP server.
The build environment. Must be either dev
or prod
.
dev
: Creates a development build. Copies the.env
file from your project root to the output directory (dist/
) so the server can access environment variables during local development.prod
: Creates a production build. Environment variables are expected to be set in the production environment itself, so.env
is not copied.
golf run
Runs a previously built GolfMCP server.
Make sure to run golf build
before using golf run
. The command executes the server from the dist/
directory.