diff --git a/include/mtxclient/http/client.hpp b/include/mtxclient/http/client.hpp
index 500d0cff6fb4adc12e1814c093d3c5460c82a26c..b2d2f605d6b3ada2f13fef27181b2c446183f3f4 100644
--- a/include/mtxclient/http/client.hpp
+++ b/include/mtxclient/http/client.hpp
@@ -213,6 +213,11 @@ public:
     void set_server(const std::string &server);
     //! Retrieve the homeserver domain name.
     std::string server() { return server_; };
+    //! Retrieve the full server url including protocol and ports
+    std::string server_url()
+    {
+        return protocol_ + "://" + server() + ":" + std::to_string(port());
+    };
     //! Set the homeserver port.
     void set_port(uint16_t port) { port_ = port; };
     //! Retrieve the homeserver port.