I do not know the MGRS system, but the Proj4JS library can be useful. This is used to convert between coordinate systems, so you can configure it to convert from coordsys to pixels or, more often, from one coordsys to another.
It is open source and is widely based on the well-known proj.4 library and interacts with OpenLayers. In fact, OpenLayers uses proj4js to convert between different coordinate systems.
source share