Designing a query language

You could consider using EMF in combination with XMI or a JSON variant of XMI to serialize models: see also Polyglot Modeling/Metamodeling formats and frameworks

I’m not familiar with protocols that are specific to transporting parse trees: EMF/XMI are generic frameworks capable of transporting ASTs/models.