Dynamic composition of protocol features allows applications to establish connections with custom communication characteristics. Automatically computing possible compositions and checking given compositions requires a common framework for expressing application needs, service features, and system characteristics. In this paper, we present such a framework that is based on situation calculus. We show that the automated composition problem can be reduced to an AI Planning problem. We further illustrate the effectiveness of this approach with several examples.