Gravity assist from Mercury

The Oberth effect states most energy can be gained when you have highest velocity in orbit. The interplanetary missions, generally involve ion propulsion along with gravity assist from planets such as Jupiter. Therefore, would not we get the most benefit if we go to inner planets with increased velocity due to sun and then get a gravity assist providing maximum energy gain?

I am looking for a quantitative calculations regarding such assist from mercury or venus whichever is more efficient.

There are two different kinds of manoeuvre (or at least two ends of a range) being conflated here.

A gravity-well manoeuvre is a powered manoeuvre. By using propulsion deep inside a gravity well, a spacecraft can get more eventual change in velocity for less fuel expended. This can be seen in two ways:

1. The spacecraft converts some of the potential energy of the fuel into velocity, as well as the chemical energy
2. By dropping down into a gravity well and then accelerating so as to rise up more quickly then you dropped down, the gravity of the source of the well pulls you forward for longer and backward for less time, giving you a net benefit.

However you think of it, you get a net benefit. This is the Oberth effect.

This kind of manoeuvre is seen, for example in the Gallileo, Cassine and Juno missions, each of which made its main burn to enter orbit as close as the mission planners dared to its target gas giant.

If you wanted to launch a deep interstellar mission, taking advantage of the Suns gravity well in this way could be a good idea. You'd want to get as close to the Sun as you could, though, Mercury is probably not close enough.

A gravity assist is an unpowered manoeuvre (more or less) in which you use the gravity of a moving (relative to the Sun say) object to deflect your course (relative to it) in such a way as to get a net benefit relative to the Sun. These are seen in many missions, for instance the Voyagers, or New Horizons at Jupiter, or Juno at Venus and Earth. The main consideration here is mass of the planet you are using, so in the inner solar system Venus and Earth tend to be preferred, while in the outer system Jupiter is king.

In either case, the main problem is that Mercury is too small, and also not close enough to the Sun.

Venus has been used for gravity assists (by the Galileo mission I think). A "common" transfer is EEVJ, which means Earth-Earth-Venus-Jupiter. However, I wouldn't be surprised if Mercury was too close to the Sun to make a gravity assist useful. In fact, a spacecraft gets the most out of the GA by passing close to the center of mass of the planet (the energy extracted from the GA is inversely proportional to the radius of periapse). Hence, a Mercury fly by may no be able to harvest enough useful energy from Mercury compared to a Venus flyby, yet still cause the spacecraft to stray very close to the Sun. This may be impractical for spacecraft navigation but also for systems engineering as the vehicle now needs to be able to sustain much higher temperatures.

In fact, as correctly pointed out by uhoh in the comments, Mercury may only yield about 1.7 km/s for a gravity assist, as shown by HopDavid in this great answer: https://space.stackexchange.com/a/4135/1391 .