Skip to content
Back to search

julia-mcp

MCP server for persistent Julia sessions, compiled to a standalone binary with juliac --trim=safe

Safety scan

A static text scan, not a guarantee. Select the badge to see what was scanned and every finding.

Checked today
Badge for your README
findsafeskills safety rating

Markdown

[![findsafeskills safety rating](/api/listings/jkrumbiegel--julia-mcp/badge.svg)](/listings/jkrumbiegel--julia-mcp)

HTML

<a href="/listings/jkrumbiegel--julia-mcp"><img src="/api/listings/jkrumbiegel--julia-mcp/badge.svg" alt="findsafeskills safety rating" /></a>

Install

i

What was scanned

The files the safety scan read, as written by the repository's author and shown as plain text. Lines with a finding are marked.

README.md · README · 55 lines
  1. # julia-mcp
  2. An MCP server for persistent Julia sessions, written in Julia and compiled with `juliac --trim=safe` into a standalone executable. It provides three tools over stdio: `julia_eval`, `julia_restart` and `julia_list_sessions`. Each environment gets its own `julia` child process, so state and compiled code are kept between calls.
  3. This is a Julia port of the Python server [aplavin/julia-mcp](https://github.com/aplavin/julia-mcp), with the same tools and behavior.
  4. Only macOS and Linux are supported, because the process and pipe handling uses POSIX file descriptors.
  5. ## Build
  6. Requires Julia 1.13 (via juliaup) and a C compiler.
  7. ```sh
  8. ./build.sh # uses `julia +1.13`; override with JULIA=/path/to/julia
  9. ```
  10. This writes a relocatable bundle to `dist/`. The executable is `dist/bin/julia-mcp` and needs `dist/lib` next to it. A rebuild replaces `dist/` only once the new bundle is complete, so running servers are not affected.
  11. ## Register with Claude Code
  12. Link the executable into a directory on your `PATH` and register it:
  13. ```sh
  14. ln -sf "$PWD/dist/bin/julia-mcp" ~/.local/bin/julia-mcp
  15. claude mcp add --scope user julia -- ~/.local/bin/julia-mcp
  16. ```
  17. To update, pull and run `./build.sh` again; new Claude sessions pick up the new binary.
  18. Julia flags passed after the executable replace the default `--threads=auto`.
  19. ## Test
  20. ```sh
  21. julia +1.13 --project=test -e 'import Pkg; Pkg.instantiate(); include("test/runtests.jl")'
  22. ```
  23. ## Differences from the Python server
  24. - Sessions can be given a `name`, so several sessions can share one `env_path` (for example the same project under two Julia versions), and later calls can address a session by name alone.
  25. - Sessions idle for 72 hours are shut down.
  26. - Sessions are killed and temporary directories removed when the client closes stdin, including sessions that are still busy.
  27. - Each session gets a small `/bin/sh` watcher that SIGKILLs it once the server process is gone, so sessions do not outlive a server that was terminated by a signal.
  28. - Unexpected internal errors are reported without exception details, because generic `showerror` is not trim-safe.
  29. ## Trim notes
  30. These parts of Base fail `--trim=safe` verification on Julia 1.13.3, and are worked around here:
  31. - `run(pipeline(cmd; stdin, stdout, stderr); wait = false)`: stdio setup goes through `Vector{Union{RawFD, FileRedirect, IOServer, IO}}`. Processes are spawned with a direct `jl_spawn` call on raw pipe fds instead (`src/fdio.jl`).
  32. - Reading from any libuv stream (`stdin`, `PipeEndpoint`): `Base.uv_readcb` calls `readcb_specialized` on an abstract `LibuvStream`. Reads use `FileWatching.FDWatcher` plus `read(2)` instead.
  33. - `Timer(callback, timeout)` and `@sync` are not inferable. Timeouts use a plain `Timer` waited on in a separate task.
  34. - `Libc.strftime` and `lpad` hit unresolved calls; `string(x; pad = 2)` works.
  35. - JSON.jl is trim-safe as long as parsed `Any` values are narrowed with `isa` before use and everything written has a concrete type. Responses are therefore structs or NamedTuples, never `Dict{String, Any}` or tuples of mixed types.
  36. - On SIGTERM the trimmed runtime exits without running `atexit` hooks, hence the watcher process above.

Ratings and comments

Sign in to rate this skill.

Sign in

Free to use. If it’s helped, pass it on.