error: Couldn't get available api versions from server: couldn't get version/kind; json parse error: json: cannot unmarshal string into Go value of type struct { APIVersion string "json:\"apiVersion,omitempty\""; Kind string "json:\"kind,omitempty\"" }
I spent some time this morning troubleshooting this exact error and it looks like this error is thrown when kubeconfig file is not a valid yaml file.
In my particular case the problems with the file were:
Config file was auto-generated and fixing both issues allowed kubectl to use it