[ANN] MCPRepl.jl -- share your REPL with your AI Agent

I am experimenting a bit more with coding agents lately, especially Claude Code. To circumvent the TTFX issues, I am trying to teach Claude to use Julia how I use it: through the REPL. For that, I’ve created a small package, MCPRepl.jl, whose purpose is to expose your REPL via the MCP protocol, i.e., coding agents can send code to your REPL: both you and the agend share the same state.

The results are… well, sometimes great, sometimes not. All work in progress. But I thought I’d share – might be of value to someone else!

:warning: Disclaimer: This tool opens a TCP port and executes arbitrary code which it receives. This is incredibly stupid and unthinkable outside the AI coding agent yolo world, so be warned!

The key problems I identified so far:

  • MCP connection may break. Claude assumes a lot of auth endpoints on the server; MCPRepl.jl tries to fake them.
  • Claude has a very bad concept of environments, modules, and so on. It will sometimes try to include stuff from the src folder or similar. I think better prompting would help there.

Contributions welcome! I don’t know how much time and effort I want to put into this experiment, but if more people contribute and we get the prompts right to improve Claude’s usage of that tool, it might become really helpful.

Similar Packages

  • ModelContexProtocol.jl offers a way of defining your own servers. Since MCPRepl is using a HTTP server I decieded to not go with this package.

  • REPLicant.jl is very similar, but the focus of MCPRepl.jl is to integrate with the user repl so you can see what your agent is doing.

4 Likes

Very interesting! I built a similar tool but decided to use a jupyter kernel, which has had the advantage of being pretty stable, but the disadvantage of not being very visible.

Interesting. Is that code published? Did you create an HTTP MCP server or did you create an server which is launched as an executable by the agent and communicates via stdin/stdout?

It’s not published yet…I’ll try to get it up on github today or tomorrow (need to strip out some company-specific details.)

I used Python and FastMCP, mostly because Python has the reference implementation of the jupyter_client library. Then I created an MCP file with FastMCP that’s just a thin wrapper around those functions, e.g.

@mcp.tool()
def julia_execute(code: str, timeout: int = 300) -> str:
    """Execute Julia code and return the output.
    
    Args:
        code: Julia code to execute
        timeout: Execution timeout in seconds (default: 300)
    """
...

and with Claude Code it’s just claude mcp add -s user julia-kernel python mcp/julia_mcp_server.py, using stdio by default.

1 Like