Hi,
following up on Hélio's idea about a possible kernel for Jupyter, here
are some relevant ingredients:
http://jupyter-client.readthedocs.org/en/latest/wrapperkernels.html
http://pexpect.readthedocs.org/en/latest/api/replwrap.html
It does look doable, but of course the devil will be in the details.
cheers
sven