You have two options to run the agent in Mule, depending on what's your actual use case:
a. You deploy it as a regular Mule application, i.e., a zip file with the appropriate structure, containing the XML configuration and the agent's class.
b. You package it as a jar and you declare the agent configuration in another Mule application, i.e., including this in that other Mule app:
<custom-agent name="mycustomagent" class="agent.AgentTest">
<spring:property name="port" value="8899"></spring:property>
</custom-agent>