Skip to content
Back to search

julia-mcp

MCP server for persistent Julia sessions — fast iteration without startup/compilation overhead

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/aplavin--julia-mcp/badge.svg)](/listings/aplavin--julia-mcp)

HTML

<a href="/listings/aplavin--julia-mcp"><img src="/api/listings/aplavin--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 · 194 lines

View this file on GitHub (read at the repository's current version: the scan did not record which commit it read)

  1. # julia-mcp
  2. MCP server that gives AI assistants access to efficient Julia code execution. Avoids Julia's startup and compilation costs by keeping sessions alive across calls, and persists state (variables, functions, loaded packages) between them — so each iteration is fast.
  3. - Sessions start on demand, persist state between calls, and recover from crashes — no manual management
  4. - Each project directory gets its own isolated Julia process
  5. - Pure stdio transport — no open ports or sockets
  6. ## Tools
  7. - **julia_eval(code, env_path?, timeout?)** — execute Julia code in a persistent session. `env_path` sets the Julia project directory (omit for a temporary session). `timeout` defaults to 60s and is auto-disabled for `Pkg` operations.
  8. - **julia_restart(env_path?)** — restart a session, clearing all state. If `env_path` is omitted, restarts the temporary session.
  9. - **julia_list_sessions** — list active sessions and their status
  10. ## Requirements
  11. - [uv](https://docs.astral.sh/uv/) (you might already have it installed)
  12. - Julia – any version, `julia` binary must be in `PATH`
  13. - Recommended packages – used automatically if available in the global environment:
  14. - [Revise.jl](https://github.com/timholy/Revise.jl) - to pick code changes up without restarting
  15. - [TestEnv.jl](https://github.com/JuliaTesting/TestEnv.jl) — to properly activate test environment when `env_path` points to `/test/`
  16. The server itself is written in Python since the Python MCP protocol implementation is very mature.
  17. # Usage
  18. First, clone the repository:
  19. ```bash
  20. cd /any_directory
  21. git clone https://github.com/aplavin/julia-mcp.git
  22. ```
  23. Then register the server with your client of choice (see below).
  24. That's it! Your AI assistant can now execute Julia code more efficiently, saving of TTFX.
  25. ### Claude Code
  26. User-wide (recommended — makes Julia available in all projects):
  27. ```bash
  28. claude mcp add --scope user julia -- uv run --directory /any_directory/julia-mcp python server.py
  29. ```
  30. Project-scoped (only available in the current project):
  31. ```bash
  32. claude mcp add --scope project julia -- uv run --directory /any_directory/julia-mcp python server.py
  33. ```
  34. <details>
  35. <summary>Custom Julia CLI arguments</summary>
  36. Append Julia flags after `server.py` to override the defaults (`--startup-file=no --threads=auto`):
  37. ```bash
  38. claude mcp add --scope user julia -- uv run --directory /any_directory/julia-mcp python server.py --threads=1 --startup-file=yes
  39. ```
  40. </details>
  41. ### Claude Desktop
  42. Add to `claude_desktop_config.json`:
  43. ```json
  44. {
  45. "mcpServers": {
  46. "julia": {
  47. "command": "uv",
  48. "args": ["run", "--directory", "/any_directory/julia-mcp", "python", "server.py"]
  49. }
  50. }
  51. }
  52. ```
  53. <details>
  54. <summary>Custom Julia CLI arguments</summary>
  55. Append Julia flags after `server.py` to override the defaults (`--startup-file=no --threads=auto`):
  56. ```json
  57. {
  58. "mcpServers": {
  59. "julia": {
  60. "command": "uv",
  61. "args": ["run", "--directory", "/any_directory/julia-mcp", "python", "server.py", "--threads=1", "--startup-file=yes"]
  62. }
  63. }
  64. }
  65. ```
  66. </details>
  67. ### Codex CLI
  68. User-wide — makes Julia available in all projects:
  69. ```
  70. codex mcp add julia -- uv run --directory /any_directory/julia-mcp server.py
  71. ```
  72. <details>
  73. <summary>Custom Julia CLI arguments</summary>
  74. Append Julia flags after `server.py` to override the defaults (`--startup-file=no --threads=auto`):
  75. ```
  76. codex mcp add julia -- uv run --directory /any_directory/julia-mcp server.py --threads=1 --startup-file=yes
  77. ```
  78. </details>
  79. ### VS Code Copilot
  80. Add to `.vscode/mcp.json`:
  81. ```json
  82. {
  83. "servers": {
  84. "julia": {
  85. "command": "uv",
  86. "args": ["run", "--directory", "/path/to/julia-mcp", "python", "server.py"]
  87. }
  88. }
  89. }
  90. ```
  91. <details>
  92. <summary>Custom Julia CLI arguments</summary>
  93. Append Julia flags after `server.py` to override the defaults (`--startup-file=no --threads=auto`):
  94. ```json
  95. {
  96. "servers": {
  97. "julia": {
  98. "command": "uv",
  99. "args": ["run", "--directory", "/path/to/julia-mcp", "python", "server.py", "--threads=1", "--startup-file=yes"]
  100. }
  101. }
  102. }
  103. ```
  104. </details>
  105. ### GitHub Copilot CLI
  106. Edit `$HOME/.copilot/mcp-config.json`, and enter
  107. ```json
  108. {
  109. "mcpServers": {
  110. "julia": {
  111. "type": "stdio",
  112. "command": "uv",
  113. "args": ["run", "--directory", "/path/to/julia-mcp", "python", "-u", "server.py"]
  114. }
  115. }
  116. }
  117. ```
  118. Beware that on Windows, `\` must be escaped (so write as `C:\\my_folder\\...`)
  119. ### GitHub Copilot Cloud Agent
  120. To enable the MCP for a single repo, go to Settings, then scroll down the left panel until you get to Copilot, open that dropdown and select Cloud agent. Then scroll down to the section Model Context Protocol (MCP) and add the following
  121. ```json
  122. {
  123. "mcpServers": {
  124. "julia": {
  125. "type": "local",
  126. "command": "uvx",
  127. "args": [
  128. "--from",
  129. "git+https://github.com/aplavin/julia-mcp",
  130. "julia-mcp"
  131. ],
  132. "tools": ["*"]
  133. }
  134. }
  135. }
  136. ```
  137. ## Details
  138. - Each unique `env_path` gets its own isolated Julia session. Omitting `env_path` uses a temporary session that is cleaned up on MCP shutdown.
  139. - If `env_path` ends in `/test/`, the parent directory is used as the project and `TestEnv` is activated automatically. For this to work, `TestEnv` must be installed in the base environment.
  140. - Julia is launched with `--threads=auto` and `--startup-file=no` by default. Pass custom Julia CLI flags after `server.py` to override these defaults entirely.
  141. ## Alternatives
  142. Other projects that give AI agents access to Julia:
  143. - [MCPRepl.jl](https://github.com/hexaeder/MCPRepl.jl) and [REPLicant.jl](https://github.com/MichaelHatherly/REPLicant.jl) require you to manually start and manage Julia sessions. `julia-mcp` handles this automatically.
  144. - [DaemonConductor.jl](https://github.com/tecosaur/DaemonConductor.jl) (linux only) runs Julia scripts, but calls are independent and don't share variables. `julia-mcp` retains state between calls.

Ratings and comments

Sign in to rate this skill.

Sign in

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