Generative Model: Updating distribution based on MCMC proposal

Let us say I have a simple network defined in the following image:
(I have this confusion of what to choose, Bayesian or Markov, because my nodes may have cycles, but they would have directions as well. I am thinking of markov networks as generalization of Bayesian. This may be a different question altogether, but it should not matter much for our question at hand)

This graph is something I would call distribution X.

I am interested in
posterior P(y | X, e, h),
where (y belongs_to Y), and Y is a random variable representing the output,
for the prior, we can assume Y is Normally distributed (at least for the time being)
e is a set of external parameters.
This is some information outside of the distribution which has strong correlations to some y belongs_to Y.
h is a history of selection.

How do I plan to update the distribution:
Use MCMC to sample from X.

  1. For each proposal of the sample, accept or reject it based on some (step?) function/ method f(ā€¦). The parameters for this method will be e, proposal (this will be some node in the network), h (history), C (some contextual information). I want to have a custom evaluation of the proposal, rather than having some logp of previous sample determine the acceptance or rejection.
  2. If proposal is accepted, then the probability values in the original distribution X (mentioned above) would change. (for example, if node A was proposed and accepted, the probability of moving from Z to A would increase. In next iteration, if B is proposed and accepted, the probability of moving from A to B would increase (hence some other probabilities might decrease a bit), so on and so forth)
  3. Over the period of time, after a burn-in time, My original distribution X would have shifted to a posterior distribution, to which I can simply pass the (e) and get the appropriate node.

Now my specific questions are: Well, how do I go about each step? I understand MCMC at theorotical level, but do not know the APIs. How do I access the proposal? Where do I write a custom acceptance/ rejection code? How do I send the proposal to this location? I do not mind updating the probabilities of the distribution myself, but would like to know whether there is an automatic way? Once I have the iterations performed, how to use model with external parameters ā€˜eā€™ ?

I thank you for your patience because English is no my fluent language. So expressing the problem may be little longer than required.