call custom library from MCP for Federation SP use case

We would like to call some custom library from Message consumer pluggin code.
Can you help us with this?

Additional Details:
Our system will be SP which will consume Assertion sent by IDP (3rd party - external) MyCompany uses custom directory as userstore. (no LDAP/AD) Policy server does not have access to the user database and needs to talk to an intermediate application to get the details. Thanks,
DTRAO