# \[ANN\] julia-mcp — persistent Julia sessions for AI assistants

**URL:** <https://discourse.julialang.org/t/ann-julia-mcp-persistent-julia-sessions-for-ai-assistants/135386>\
**Category:** Package Announcements\
**Tags:** ai\
**Created:** [February 1, 2026, 3:20pm UTC](https://discourse.julialang.org/t/ann-julia-mcp-persistent-julia-sessions-for-ai-assistants/135386 "2026-02-01T15:20:48Z")\
**Posts on this page:** 20\
**Page:** 2

<div class="post-metadata">

**Author:** ![Palli](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/palli/32/3380_2.png) [@Palli](https://discourse.julialang.org/u/Palli)\
**Post date:** [February 11, 2026, 2:54pm UTC](https://discourse.julialang.org/t/ann-julia-mcp-persistent-julia-sessions-for-ai-assistants/135386/21 "2026-02-11T14:54:33Z")

</div>

I suppose you need some spec file that instructs to not change .julia this way, or at least ask for permission first. For anything other than installing packages possibly. I’m new to agentic coding, and spec files. I suppose people should collaborate on good Julia-specific spec files.

Until then, previous idea: Julia stdlib/Base was made read-only, maybe you can do the same for .julia. Except that would be bad for installing packages…

I don’t know of a good sandboxing for this, and I suppose tools like Claude Code, might also think they need to change to read/write and have that power, same as you do…

---

<div class="post-metadata">

**Author:** ![nhz2](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/nhz2/32/44428_2.png) [@nhz2](https://discourse.julialang.org/u/nhz2)\
**Post date:** [February 11, 2026, 4:26pm UTC](https://discourse.julialang.org/t/ann-julia-mcp-persistent-julia-sessions-for-ai-assistants/135386/22 "2026-02-11T16:26:16Z")

</div>

I want to try having a depot stack with a read only depot with most packages preinstalled and then a per session depot where the agent can do whatever it wants. In my experience the LLM usually ignore generic instructions if it cycles for long enough.

---

<div class="post-metadata">

**Author:** ![oschulz](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/oschulz/32/2998_2.png) [@oschulz](https://discourse.julialang.org/u/oschulz)\
**Post date:** [February 11, 2026, 8:19pm UTC](https://discourse.julialang.org/t/ann-julia-mcp-persistent-julia-sessions-for-ai-assistants/135386/23 "2026-02-11T20:19:26Z")

</div>

Here’s a `julia-mcp` bash script for Linux that automatically Git-clones julia-mcp, downloads `uv` download and starts it, isolated in a platform-specific directory. (Disclaimer: contains Gemini-generated code.)

```shell
#!/bin/bash -e

git_clone_if_missing() {
    local repo_url="$1"
    local target_dir="$2"

    if [[-z "$repo_url" || -z "$target_dir"]]; then
        echo "ERROR: Usage: git_clone_or_update <git_url> <target_directory>" >&2
        exit 1
    fi

    if [[! -d "$target_dir"]]; then
        echo "INFO: Directory "$target_dir" does not exist. Cloning \"$repo_url\"." >&2
        git clone "$repo_url" "$target_dir"
    
    else
        echo "INFO: Directory "$target_dir" already exists." >&2
        if [[! -d "$target_dir/.git"]]; then
            echo "ERROR: '$target_dir' exists but is not a git repository." >&2
            exit 1
        fi
    fi
}

install_uv_if_missing() {
    local target_bin_dir="$1"

    if [[-z "$target_bin_dir"]]; then
        echo "ERROR: Usage: ensure_uv_installed <bin_directory_path>" >&2
        exit 1
    fi{
	"servers": {
		"julia": {
			"type": "stdio",
			"command": "julia-mcp"
		}
	},
	"inputs": []
}

    local uv_binary="$target_bin_dir/uv"

    if [[-f "$uv_binary"]]; then
        echo "INFO: uv installed in \"$target_bin_dir\"." >&2
    else
        echo "INFO: uv not found in \"$target_bin_dir\". Installing..." >&2

        # Ensure the directory exists
        mkdir -p "$target_bin_dir"

        # 3. Install using the official script
        # We set UV_INSTALL_DIR so it installs to the specific target folder.
        # We set INSTALLER_NO_MODIFY_PATH=1 to prevent it from editing your .bashrc/.zshrc
        export UV_INSTALL_DIR="$target_bin_dir"
        export INSTALLER_NO_MODIFY_PATH=1
        
        if (curl -LsSf https://astral.sh/uv/install.sh | sh >&2); then
            echo "INFO: uv successfully installed to \"$target_bin_dir\"." >&2
        else
            echo "ERROR: Failed to install uv." >&2
            exit 1
        fi
    fi
}

JLMCPDIR="$HOME/.julia-mcp-server_`uname -m`"
mkdir -p "$JLMCPDIR" && cd "$JLMCPDIR" || exit 1

git_clone_if_missing "https://github.com/aplavin/julia-mcp.git" "julia-mcp"
install_uv_if_missing "`pwd`/bin"

exec bin/uv run --directory "julia-mcp" python server.py "$@"

```

If you put this `julia-mcp` script into `~/.local/bin` or so, the VS-Code `mcp.json` configuration file can then just be

```json
{
	"servers": {
		"julia": {
			"type": "stdio",
			"command": "julia-mcp"
		}
	},
	"inputs": []
}

```

---

<div class="post-metadata">

**Author:** ![stephenll](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/stephenll/32/28751_2.png) [@stephenll](https://discourse.julialang.org/u/stephenll)\
**Post date:** [February 11, 2026, 9:09pm UTC](https://discourse.julialang.org/t/ann-julia-mcp-persistent-julia-sessions-for-ai-assistants/135386/24 "2026-02-11T21:09:23Z")

</div>

I installed and have Julia-mcp working in both VS Code and in Raycast. I’m able to call basic function such as x = rand(10). If I try to ask for a package installed, the LLM understands and says it will execute `using Pkg; Pkg.add(my_package_name)` but it just spins after that. I first tried with Plots, but then an easier package. This happens both with VS Code and Raycast.

---

<div class="post-metadata">

**Author:** ![aplavin](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/aplavin/32/222056_2.png) [@aplavin](https://discourse.julialang.org/u/aplavin)\
**Post date:** [February 11, 2026, 9:16pm UTC](https://discourse.julialang.org/t/ann-julia-mcp-persistent-julia-sessions-for-ai-assistants/135386/25 "2026-02-11T21:16:19Z")

</div>

Reproducible examples are welcome – something one can just run through command line with julia-mcp, without any LLMs! I _might’ve_ seen something similar (hanging on Pkg operations), but it’s been quite rare, far from every time – so I didn’t spend time understanding if it’s just a transient issue or not.

---

<div class="post-metadata">

**Author:** ![stephenll](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/stephenll/32/28751_2.png) [@stephenll](https://discourse.julialang.org/u/stephenll)\
**Post date:** [February 12, 2026, 1:00pm UTC](https://discourse.julialang.org/t/ann-julia-mcp-persistent-julia-sessions-for-ai-assistants/135386/26 "2026-02-12T13:00:10Z")

</div>

I first asked `using Julia to create 10 random numbers`. That worked fine. You could see the thinking that it used julia\_mcp.

Then I asked: `create a lognormal distribution with mu=12 and sigma=0.5`. It started thinking, said it needed to use Julia\_mcp, and it needed to add the Distributions package. It just hangs at Running…

 ![image](https://global.discourse-cdn.com/julialang/original/3X/d/5/d50ffc980ce5b8793664c1b5524c8c4544c75310.png)

---

<div class="post-metadata">

**Author:** ![nhz2](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/nhz2/32/44428_2.png) [@nhz2](https://discourse.julialang.org/u/nhz2)\
**Post date:** [February 19, 2026, 10:28pm UTC](https://discourse.julialang.org/t/ann-julia-mcp-persistent-julia-sessions-for-ai-assistants/135386/27 "2026-02-19T22:28:47Z")

</div>

I made [GitHub - nhz2/SandboxMCPRepl.jl: A Julia repl session manager for AI using Sandbox.jl](https://github.com/nhz2/SandboxMCPRepl.jl) as a julia app using Sandbox.jl to run each session in a sandbox.

---

<div class="post-metadata">

**Author:** ![nhz2](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/nhz2/32/44428_2.png) [@nhz2](https://discourse.julialang.org/u/nhz2)\
**Post date:** [February 22, 2026, 6:44pm UTC](https://discourse.julialang.org/t/ann-julia-mcp-persistent-julia-sessions-for-ai-assistants/135386/28 "2026-02-22T18:44:13Z")

</div>

I’ve added an example of using bubblewrap instead of Sandbox.jl to block network access: [GitHub - nhz2/SandboxMCPRepl.jl: A Julia repl session manager for AI using Sandbox.jl](https://github.com/nhz2/SandboxMCPRepl.jl?tab=readme-ov-file#using-a-bubblewrap-sandbox-to-block-network-access)

This should work with uv as well if you can figure out what directories to bind.

Blocking network access breaks juliaup ([Julia fails to launch without network connectivity · Issue #1204 · JuliaLang/juliaup · GitHub](https://github.com/JuliaLang/juliaup/issues/1204)) so you will want to install julia manually or using [GitHub - abelsiqueira/jill: Command line installer of the Julia Language.](https://github.com/abelsiqueira/jill)

---

<div class="post-metadata">

**Author:** ![freeman](https://avatars.discourse-cdn.com/v4/letter/f/ec9cab/32.png) [@freeman](https://discourse.julialang.org/u/freeman)\
**Post date:** [May 5, 2026, 11:48am UTC](https://discourse.julialang.org/t/ann-julia-mcp-persistent-julia-sessions-for-ai-assistants/135386/29 "2026-05-05T11:48:00Z")

</div>

Hi. I just tried julia-mcp (with opencode).  
It worked for “simple” things, but when I tried telling my llm “take this script from this file, copy-paste it into the julia repl and run it” it some times tells me that “julia mcp timed out”. I know I can run my script, so how do I debug what’s happening?  
(Yes, the project is right, I tell the llm use Pkg.activate(" etc "))

```julia-auto
MCP Error -32001: Request timed out

```

Other times that doesn’t happen, but on the second iteration I get

```julia-auto
Thinking: It seems the previous code is still running: Let me restart and try again 

```

---

<div class="post-metadata">

**Author:** ![scheidan1](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/scheidan1/32/24771_2.png) [@scheidan1](https://discourse.julialang.org/u/scheidan1)\
**Post date:** [May 5, 2026, 2:48pm UTC](https://discourse.julialang.org/t/ann-julia-mcp-persistent-julia-sessions-for-ai-assistants/135386/30 "2026-05-05T14:48:01Z")

</div>

Both, `julia-mcp` and the coding harnesses have separate time-out rules; whichever is shorter counts. For example, for Codex I changed the following settings: [Enhance Codex CLI instructions by scheidan · Pull Request #3 · aplavin/julia-mcp · GitHub](https://github.com/aplavin/julia-mcp/pull/3/changes)

Not sure you have the same problem.

---

<div class="post-metadata">

**Author:** ![aplavin](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/aplavin/32/222056_2.png) [@aplavin](https://discourse.julialang.org/u/aplavin)\
**Post date:** [May 6, 2026, 2:15am UTC](https://discourse.julialang.org/t/ann-julia-mcp-persistent-julia-sessions-for-ai-assistants/135386/31 "2026-05-06T02:15:32Z")

</div>

@freeman when I see claude experiencing timeout because it executed some long-running code, it automatically re-runs it and passes a longer timeout to the mcp. Presumably something like this should happen with opencode as well, but it doesn’t?

---

<div class="post-metadata">

**Author:** ![freeman](https://avatars.discourse-cdn.com/v4/letter/f/ec9cab/32.png) [@freeman](https://discourse.julialang.org/u/freeman)\
**Post date:** [May 8, 2026, 8:11pm UTC](https://discourse.julialang.org/t/ann-julia-mcp-persistent-julia-sessions-for-ai-assistants/135386/32 "2026-05-08T20:11:40Z")

</div>

Hey.

Hm depends. First off, I don’t run Claude, I run Qwen 3.6. Some times it re-tries with a longer timeout, some times it tries other things (for example copy pasting chunks of the script and running the smaller chunks).

But I think there’s a bigger problem. The use case that I had in mind is that I as a human decide on the important part of the Julia session, and then give it narrow instructions within that. For example, if I know that putting the Julia session in place takes 10 minutes to create some big objects, that’s fine. What I wanted is that I do that part and then hand it over to the LLM and tell it “here’s the session, here’s what this objects mean, I would like you to investigate XYZ”. Basically I’d like to use it as a researcher that’s looking at the same objects are me and can create hypothesis and test them. And as it makes partial progress, I would like to observe what it’s doing and simultaneously manipulate the same objects myself. With julia-mcp only the agent has access to the session and I have to be asking it about the session if I want to know something.

Thoughts?

---

<div class="post-metadata">

**Author:** ![Alec\_Loudenback](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/alec_loudenback/32/278_2.png) [@Alec\_Loudenback](https://discourse.julialang.org/u/Alec_Loudenback)\
**Post date:** [May 9, 2026, 4:23am UTC](https://discourse.julialang.org/t/ann-julia-mcp-persistent-julia-sessions-for-ai-assistants/135386/33 "2026-05-09T04:23:41Z")

</div>

@aplavin once again hitting a home run for me - this package has made Claude Code A LOT more effective for me. Thanks again!

---

<div class="post-metadata">

**Author:** ![aplavin](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/aplavin/32/222056_2.png) [@aplavin](https://discourse.julialang.org/u/aplavin)\
**Post date:** [May 9, 2026, 2:34pm UTC](https://discourse.julialang.org/t/ann-julia-mcp-persistent-julia-sessions-for-ai-assistants/135386/34 "2026-05-09T14:34:27Z")

</div>

@freeman on timeout: what do you think can be an improvement on the julia-mcp side? It already has a configurable timeout that can be set to arbitrarily long.

On mcp + human sharing the same session: that would definitely be useful! I don’t _often_ wish for this, but sometimes I do.  
I just don’t know how to achieve that practically. The key benefit of julia-mcp is that it’s fully automatic, no daemons in the background, no cleanup or lifecycle management. How to make a Julia session one can share under this constraint, keeping everything robust and reliable, and preferably cross-platform?..

---

<div class="post-metadata">

**Author:** ![freeman](https://avatars.discourse-cdn.com/v4/letter/f/ec9cab/32.png) [@freeman](https://discourse.julialang.org/u/freeman)\
**Post date:** [May 9, 2026, 3:34pm UTC](https://discourse.julialang.org/t/ann-julia-mcp-persistent-julia-sessions-for-ai-assistants/135386/35 "2026-05-09T15:34:20Z")

</div>

Have a look at this conversation: [Best Practices for Using Coding Agents with Julia? - #6 by Satvik](https://discourse.julialang.org/t/best-practices-for-using-coding-agents-with-julia/136829/6)

I can imagine something which is like your julia-mcp but instead of sending to Julia language server, it sends to tmux.

Alternatively, perhaps keep your julia-mcp exactly as it is, but expose a reference to the LanguageServer so that the user can use the regular julia repl and attach to the LanguageServer (I’m assuming this is a feature)

---

<div class="post-metadata">

**Author:** ![greatpet](https://avatars.discourse-cdn.com/v4/letter/g/e495f1/32.png) [@greatpet](https://discourse.julialang.org/u/greatpet)\
**Post date:** [May 9, 2026, 4:36pm UTC](https://discourse.julialang.org/t/ann-julia-mcp-persistent-julia-sessions-for-ai-assistants/135386/36 "2026-05-09T16:36:34Z")

</div>

> [@aplavin](#):
>
> On mcp + human sharing the same session

This seems to be the main design goal of

> **[GitHub - hexaeder/MCPRepl.jl: Expose your repl via MCP!](https://github.com/hexaeder/MCPRepl.jl)**
>
> Expose your repl via MCP!

(I haven’t tried.)

---

<div class="post-metadata">

**Author:** ![freeman](https://avatars.discourse-cdn.com/v4/letter/f/ec9cab/32.png) [@freeman](https://discourse.julialang.org/u/freeman)\
**Post date:** [May 9, 2026, 5:12pm UTC](https://discourse.julialang.org/t/ann-julia-mcp-persistent-julia-sessions-for-ai-assistants/135386/37 "2026-05-09T17:12:48Z")

</div>

Points to a fork which points to Kaimon.jl 🙂

This space seems to have 20 half-baked attempts at the same idea, but Kaimon seems to be the more polished one. (also I haven’t tried.)

---

<div class="post-metadata">

**Author:** ![aplavin](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/aplavin/32/222056_2.png) [@aplavin](https://discourse.julialang.org/u/aplavin)\
**Post date:** [May 9, 2026, 9:48pm UTC](https://discourse.julialang.org/t/ann-julia-mcp-persistent-julia-sessions-for-ai-assistants/135386/38 "2026-05-09T21:48:07Z")

</div>

There are quite a few attempts in this field, yes (eg, also [Letting AI agents use the VSCode Julia REPL](https://discourse.julialang.org/t/letting-ai-agents-use-the-vscode-julia-repl/136805)).

But I specifically highlighted the key design consideration of julia-mcp above:

> [@aplavin](#):
>
> it’s fully automatic, no daemons in the background, no cleanup or lifecycle management

In the vast majority of cases, one doesn’t want any interactive REPL, nor inspect what variables/functions the agent has there. And I want this regime to be as streamlined and smooth as possible: everything is fully automatic, no manual julia REPL startups, no background daemons, etc.

Unless I missed something, none of the linked alternatives have this. Suggestions on how to implement “join a julia-mcp session interactively” are welcome!

---

<div class="post-metadata">

**Author:** ![greatpet](https://avatars.discourse-cdn.com/v4/letter/g/e495f1/32.png) [@greatpet](https://discourse.julialang.org/u/greatpet)\
**Post date:** [May 12, 2026, 9:37am UTC](https://discourse.julialang.org/t/ann-julia-mcp-persistent-julia-sessions-for-ai-assistants/135386/39 "2026-05-12T09:37:30Z")

</div>

Currently there are three tools, `julia_eval`, `julia_restart`, and `julia_list_sessions`. Would it make sense to add `julia_eval_script` for running a complete script? Following DaemonMode.jl, you could wrap every script in its own module to prevent conflicting function definitions.

---

<div class="post-metadata">

**Author:** ![aplavin](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/aplavin/32/222056_2.png) [@aplavin](https://discourse.julialang.org/u/aplavin)\
**Post date:** [May 12, 2026, 1:30pm UTC](https://discourse.julialang.org/t/ann-julia-mcp-persistent-julia-sessions-for-ai-assistants/135386/40 "2026-05-12T13:30:22Z")

</div>

What would be the difference of `julia_eval_script` vs existing `julia_eval` with code=`module MyModule <actual code> end`?  
I’d prefer to avoid redundancy in julia-mcp unless actually required. This specific scenario seems to be handled best by just telling your LLM in plain text that you prefer to run julia scripts in isolated modules…

[Previous page](https://discourse.julialang.org/t/ann-julia-mcp-persistent-julia-sessions-for-ai-assistants/135386.md?page=1)

[Next page](https://discourse.julialang.org/t/ann-julia-mcp-persistent-julia-sessions-for-ai-assistants/135386.md?page=3)
