Hi Carlo,
thanks for a more in-depth explanation, now I see what you are looking to achieve. Yes, integrating Kaa into the gateway (which would simultaneously be an MQTT broker or an FTP server) is certainly possible. Even though Kaa works best when the SDK is directly integrated into the ultimate endpoint (sensor, MCU, any device) - providing numerous services to the device firmware / application, this is not always possible.
This is the most typical deployment scenario for Kaa:

The alternative option is when you integrate Kaa SDK into a gateway (we call it "actor gateway"). The actor gateway instantiates an endpoint actor per each physical device. The actor handles communication with the actual device and presents itself to the cloud as a virtual representation of the sensor, etc. Here is how this looks like:

Please let me know if this helps and if you have any further questions.
Andrew