To set up your own CoAP server you can pick any server from http://coap.technology/impls.html
To save you some time, an important question is if you need to have multipart paths (eg. the path "rooms/421/light" consists of 3 parts, in CoAP-speak) or multipart queries (the query "?device=sensor&id=1234&key=5678" consists of 3 parts) in your URI. The reason I say this is that I have not been able to make the Sara-N211 separate these according to RFC7252. It will separate the path from the query, but won't go any further than that.
(If anyone knows how to do this, or if a this becomes possible with a new FW, please reply!!!)
The alternative, implementing a CoAP / MQTT-SN client on top of UDP, can be a challenge. But then again, at least you will have control over the code. And also you will be free to use other modules (most NB-IoT modules I know don't have commands for pure CoAP, even the newer u-blox R410).
There are libraries both for MQTT-SN and for CoAP (eg. in the post http://forum.sodaq.com/t/nb-iot-shield-in-germany/1012/32 Holger mentioned he has some example files for this. T-Mobile/DT also has quite a bit of software on https://github.com/telekom/LibNbiot ). Needless to say, some adaptations will be necessary and it is not always easy to edit code made by other people.
Good luck with it,