They were very much against it. While "Communist" doesn't come into general usage until later, Marx and his associates were already sufficiently organised in the newly-created International Workingmen's Association to write to Lincoln in 1864 in support the Union's cause: "it fell to the lot of Abraham Lincoln, the single-minded son of the working class, to lead his country through the matchless struggle for the rescue of an enchained race and the reconstruction of a social world."
Marx and his colleagues and heirs are often thought to have had muted moral feelings about the issue, but that's largely down to the style of argument of a movement that considered itself scientific rather than moved by subjective values. In Marx's analysis, slavery was the enemy of the working class because it divided it and drove down the bargaining power and conditions of all, thereby impeding progress. But that doesn't mean he and other socialists - marxist and other - didn't also hate it with a passion for its own sake.
Marx, aside from finding the practice disgraceful, considered the American institution of slavery to be a bastardization of earlier European feudalism, which, by the dialectic of class struggle, was doomed to destruction by the capitalist north. As socialism was necessary to replace capitalism, capitalism was necessary to replace feudalism.