Counting and uniform sampling of directed acyclic graphs (DAGs) from a Markov equivalence class are fundamental tasks in graphical causal analysis. In this paper, we show that these can be performed polynomial time, solving long-standing open problem area. Our algorithms effective easily implementable. Experimental results the significantly outperform state-of-the-art methods.