If you want to get the value of entropy as given by the Gibbs-Shannon expression $\sum_k -p_k\log p_k$, you are going to have to introduce some auxiliary discrete states that the system can be in (for example, system being in a phase space cell of some small dimensions), estimate their probabilities* and then evaluate the expression.
If you are interested only on thermodynamic entropy of equilibrium systems, you can avoid that and make a simulation of quasistatic heat transfer and calculate entropy as
$$ \int_i^f \frac{dQ}{T}. $$
This gives you difference of entropy between two states, which is all that matters physically.
- probability that the system is in state $k$ given the macroscopic state variable values.
* probability that the system is in state $k$ given the macroscopic state variable values.