Subject: RE: How can I force an agent to run on the server?
You will have to use RunOnServer. Of course, a server agent doesn’t have access to your client UI, so it can’t tell which documents are selected. If there information the agent needs to do its job, you will have to package up that information and ship it to the agent in a parameter document. In this case, you could write the note IDs of the selected documents into a multivalue field in the parameter document (if there might be many, you could make it a rich text field or use the IsSummary property to allow the field to contain lots of data).
Subject: How can I force an agent to run on the server?
You will need to use RunOnServer method and figure out how to communicate the information you need to client to server. Agent FAQ has an article about RunOnServer and passing parameters that you might find helpful.