You could run local copy of melpa and use it from carton using the init file, for example.  But I agree it is hard to come up with useful example.

How about running carton-cli.el directly, without using `bin/carton`?  This way, you can inject anything.

But if you think hardcoding test server is OK then I guess I can live with that.  Perhaps naming it as `carton-test` or something like that may be better.