Sadly the viewer has no plugins API at the moment. It's on my TODO list, but given the rather large complexity of the viewer (its written in multiple languages and involves lots of asynchronous code across multiple sandobed processes), its not something easy to do.
For your use case you are probably better off just running calibre from source, which is easy to do see
https://manual.calibre-ebook.com/develop.html and modifying a single file viewr/lookup.py to change the lookup panel to do what you need.