It is possible to create connectors and processors (or use the MODX index.php in the connectors directory), but I usually don't bother.
A typical AJAX call handler is just some code at a URL that does something and then returns a JSON string.
A MODX resource with no template and nothing in the content but a call to a snippet works nicely.
The snippet gets the incoming data (if any) from the $_GET or $_POST array, does its thing, then returns the JSON string expected by the JavaScript that made the AJAX call.
The snippet should have a permission test at the top to make sure the current user is logged in and has permission to operate the processor.
if (!$modx->user->hasPermission('some_permission')) {
/* Bail out */
}
/* Do something here */
/* Create $result array here */
return $modx->toJSON($result);