One of the reasons that NFS was so popular is that Sun gave away the protocol implementation. It's really interesting to see the technology behind that though. The whole protocol (both versions 2 and 3) is defined in a single file.[0] You run that file through the rpcgen program which spits out some .c and .h files which you can just link into your program. Of course on the server side you actually need to implement the code to handle those procedures, but on the client side it's all there, ready to use.
[0] https://github.com/freebsd/freebsd-src/blob/main/include/rpc...