This paper presents REFCON, a framework for the automated development of Agent Communication Contexts (ACCs) in multi-agent systems (MASs). ACCs are intended to capture the interaction requirements of a MAS. A formal specification framework is first presented, aimed at modelling an ACC as a set of rules for filtering and filling messages, based on their contents, and the names and roles of the exchanging agents. A XML-based specification language is then introduced, which encodes the specification formalism for the sake of its computer processing. Finally, an object-oriented software architecture capable of supporting ACC-based MAS development is presented. REFCON key characteristic is that it allows a seamless integration of ACC support (even) into an existing MAS, at run-time, independently of the agent platform used for the implementation. This is made possible by a layered software architecture based on computational reflection, a technology that allows transparent evolution and adaptation of existing systems. The REFCON framework is also dynamic, in the two-fold sense that it is capable of both adding new rules and handling multiple contexts, which it can easily switch among, at run-time. The ACC-based design of an example MAS for document sharing is briefly discussed, as a demonstration of the principles put forward.