Make plugin php file called directly aware of WordPress?

You can’t load plugin files directly, you need to target either a front-end or admin URL that bootstraps WordPress. An easy way to do this is the admin_post_(action) action:

add_action( 'admin_post_add_foobar', 'prefix_admin_add_foobar' );
function prefix_admin_add_foobar() {
    // your code here
}

You can then POST your data to admin_url( 'admin-post.php' ) and set action to add_foobar in this example, which will trigger your hooked function.