Your best bet is likely to be to pull the filtering data from server B, save it in a listy variable of some sort, and then build your SQL query for pulling the data from server A along with a where COLUMN_X in ( FILTER_FROM_B )
.
Without knowing more about your table structures and how you're trying to join them, I can't really give you a more specific answer.