Hierarchical Deterministic Wallets are the ideal way to do this, so that you can generate new addresses on the server as needed but the server has no ability to spend. There are implementations in python, Java, C++, and Ruby here:
https://en.bitcoin.it/wiki/BIP_0032#ImplementationsYou could also communicate with Electrum over RPC.