https://github.com/loisaidasam/2048
Essentially it communicates via an API to a webserver where you write your "brain" logic and respond to the API requests with which move to choose next:
https://github.com/loisaidasam/2048/blob/master/js/autonomou...
Since it's over web, you can write your webserver in the language of your choosing. I wrote a small dumb Python webserver using the Flask microframework:
https://github.com/loisaidasam/2048/blob/master/py/webserver...
And it simply returns a random direction:
https://github.com/loisaidasam/2048/blob/master/py/game.py
This can be adapted obviously for whatever logic you choose. The reason I forked this version and not a totally server-side one (which would be better for performance obviously) is that you can actually watch the moves this one makes as it chooses them, which makes it kinda fun.
Enjoy!