Can a sensor connect directly connect to the server?
What you seem to think you want is:

&lt;Sensor&gt; -&gt; &lt;WiFi&gt;


Whereas in reality what you actually need is:

&lt;Sensor&gt; -&gt; &lt;X&gt; -&gt; &lt;WiFi&gt;


Where &lt;X&gt; is some device that can do two things:


Read the data from the sensor, and
Connect to the WiFi and send the data through it to the internet.


You have already achieved that with the Raspberry Pi, although for a single small sensor the Pi is considerably more powerful than you would ever need.

Instead you want something smaller.  As has been mentioned in the comments using the Pi as a "hub" to connect multiple sensors to the internet is one possibility - for that you may choose something like the nRF24L01+ wireless modules along with small microcontrollers, such as Arduino-style boards, or maybe X-Bee modules with the same boards, etc.

Another option is to use a small WiFi-enable microcontroller, such as the ESP8266, which you can program to read the data from your sensor and to communicate to the outside world through WiFi.

{{analogy alert}}

Basically, at the moment you have a can of petrol and a road and you want to magically travel on the road with just that. What you lack is the vehicle to consume the petrol and travel on the road. Get a car (Arduino + WiFi), bus (Rasperry Pi) or Motorbike (ESP8266) and fill it with your petrol.