Multi-agent planning is a fundamental problem in multiagent systems that has acquired a variety of meanings in the relative literature. In this paper we focus on a setting where multiple agents with complementary capabilities cooperate in order to generate non-conflicting plans that achieve their respective goals. We study two situations. In the first, the agents are able to achieve their subgoals by themselves, but they need to find a coordinated course of action that avoids harmful interactions. In the second situation, some agents may ask the assistance of others in order to achieve their goals. We formalize the two problems and present algorithms for their solution. These algorithms are based on an underlying classical planner which is used by the agents to generate their individual plans, but also to find plans that are consistent with those of the other agents. The procedures generate optimal plans under the plan length criterion. The central role that has been given to the ...