Machine agent has nothing to do with app server you are running. It basically monitors the hardware metrics related to your environment.You can start a separate command prompt/terminal and start machine agent (" java -jar machineagent.jar").
Also refer to the documentation and find the OS specific information for your environment:
https://docs.appdynamics.com/display/PRO42/Install+the+Standalone+Machine+Agent
https://docs.appdynamics.com/display/PRO42/Start+and+Stop+the+Standalone+Machine+Agent