Yes, there is a LUA plugin ("worker_ui") distributed with BletchMAME that essentially provides what is sort of a hybrid between a command console and an RPC-like mechanism. Its not using sockets, but rather standard IO - meaning that you can execute MAME with that plugin and control MAME using the same facilities BletchMAME is using.