Farpoint creatures

Spaceborne shapeshifters enslaved at Deneb IV

Huge jellyfish-like spaceborne lifeforms able to turn energy into matter, one of which the Bandi captured and forced to take the shape of Farpoint Station until the Enterprise-D set it free.

The creatures are the mystery at the heart of Encounter at Farpoint, the first Next Generation story. They live in space, feed on energy and can reshape themselves into almost anything, from a starbase to a ship, while producing any object those inside them wish for.
One of them came to Deneb IV injured. The Bandi, led by Groppler Zorn, fed it just enough geothermal energy to keep it alive and compelled it to become a lavish station that they hoped to offer Starfleet. Troi senses its pain and loneliness, and the Enterprise crew notice that the place supplies whatever they ask for.
In 2364 its mate arrives in the form of a vast vessel, bombards the old Bandi city and seizes Zorn. With Q judging humanity by how it handles the puzzle, Picard has the Enterprise beam energy to the captive. It rises from the planet in its true form and the pair, tendrils joined, depart together.