Error: socket file "/var/tmp/mattermost_local.socket" doesn't exists, please check the server configuration for local mode

What deployment method are you using? Is this a docker setup f.ex.? If so, the socket only exists inside the container and cannot be accessed from the outside by default. You would have to map the file to your host in order to use mmctl from the host directly. Alternatively you can run docker exec -ti <containerid> mmctl --local ....