mmctl is a command line client which is using the API to connect to the Mattermost server by default, so you need to use the mmctl auth login command first to login to your local or remote instance. Once that’s done, a session token will be saved in mmctl’s config and you can use this token for all further commands.
Alternatively, you can enable Mattermost’s so-called “local mode” by changing the value of EnableLocalMode in its config.json to trueand after a server restart, you can use the socket-authenticated mmctl --local with all available commands without having to do a separate login first.