Source: The Book of Many Things

Wondrous Item, rare (requires attunement)

This silver skeleton key is warm to the touch. While holding the key in its key form, you can use an action to cast the Knock spell from the key.

Transforming the Key. While holding the key, you can use a bonus action to transform it into a magic longsword. You are considered proficient with the sword, and you have a +1 bonus to attack and damage rolls made with it. On a hit, the sword deals 1d10 force damage. The item remains in its sword form until it leaves your grasp or you use another bonus action to revert it to its key form.

If you end your attunement to the item while it’s in its sword form, it automatically reverts to its key form.