julia-mcp
Enables GitHub Copilot to run Julia code via MCP, maintaining state across interactions within project directories.
Click on "Deploy Server".
Wait a few minutes for the server to deploy. Once ready, it will show a "Started" state.
In the chat, type
@followed by the MCP server name and your instructions, e.g., "@julia-mcp compute the first 10 prime numbers"
That's it! The server will respond to your query, and you can continue using it as needed.
Here is a step-by-step guide with screenshots.
julia-mcp
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.
Sessions start on demand, persist state between calls, and recover from crashes — no manual management
Each project directory gets its own isolated Julia process
Pure stdio transport — no open ports or sockets
Tools
julia_eval(code, env_path?, timeout?) — execute Julia code in a persistent session.
env_pathsets the Julia project directory (omit for a temporary session).timeoutdefaults to 60s and is auto-disabled forPkgoperations.julia_restart(env_path?) — restart a session, clearing all state. If
env_pathis omitted, restarts the temporary session.julia_list_sessions — list active sessions and their status
Related MCP server: HOPX MCP Server
Requirements
uv (you might already have it installed)
Julia – any version,
juliabinary must be inPATHRecommended packages – used automatically if available in the global environment:
Revise.jl - to pick code changes up without restarting
TestEnv.jl — to properly activate test environment when
env_pathpoints to/test/
The server itself is written in Python since the Python MCP protocol implementation is very mature.
Usage
First, clone the repository:
cd /any_directory
git clone https://github.com/aplavin/julia-mcp.gitThen register the server with your client of choice (see below).
That's it! Your AI assistant can now execute Julia code more efficiently, saving of TTFX.
Claude Code
User-wide (recommended — makes Julia available in all projects):
claude mcp add --scope user julia -- uv run --directory /any_directory/julia-mcp python server.pyProject-scoped (only available in the current project):
claude mcp add --scope project julia -- uv run --directory /any_directory/julia-mcp python server.pyAppend Julia flags after server.py to override the defaults (--startup-file=no --threads=auto):
claude mcp add --scope user julia -- uv run --directory /any_directory/julia-mcp python server.py --threads=1 --startup-file=yesClaude Desktop
Add to claude_desktop_config.json:
{
"mcpServers": {
"julia": {
"command": "uv",
"args": ["run", "--directory", "/any_directory/julia-mcp", "python", "server.py"]
}
}
}Append Julia flags after server.py to override the defaults (--startup-file=no --threads=auto):
{
"mcpServers": {
"julia": {
"command": "uv",
"args": ["run", "--directory", "/any_directory/julia-mcp", "python", "server.py", "--threads=1", "--startup-file=yes"]
}
}
}Codex CLI
User-wide — makes Julia available in all projects:
codex mcp add julia -- uv run --directory /any_directory/julia-mcp server.pyAppend Julia flags after server.py to override the defaults (--startup-file=no --threads=auto):
codex mcp add julia -- uv run --directory /any_directory/julia-mcp server.py --threads=1 --startup-file=yesVS Code Copilot
Add to .vscode/mcp.json:
{
"servers": {
"julia": {
"command": "uv",
"args": ["run", "--directory", "/path/to/julia-mcp", "python", "server.py"]
}
}
}Append Julia flags after server.py to override the defaults (--startup-file=no --threads=auto):
{
"servers": {
"julia": {
"command": "uv",
"args": ["run", "--directory", "/path/to/julia-mcp", "python", "server.py", "--threads=1", "--startup-file=yes"]
}
}
}GitHub Copilot CLI
Edit $HOME/.copilot/mcp-config.json, and enter
{
"mcpServers": {
"julia": {
"type": "stdio",
"command": "uv",
"args": ["run", "--directory", "/path/to/julia-mcp", "python", "-u", "server.py"]
}
}
}Beware that on Windows, \ must be escaped (so write as C:\\my_folder\\...)
GitHub Copilot Cloud Agent
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
{
"mcpServers": {
"julia": {
"type": "local",
"command": "uvx",
"args": [
"--from",
"git+https://github.com/aplavin/julia-mcp",
"julia-mcp"
],
"tools": ["*"]
}
}
}Details
Each unique
env_pathgets its own isolated Julia session. Omittingenv_pathuses a temporary session that is cleaned up on MCP shutdown.If
env_pathends in/test/, the parent directory is used as the project andTestEnvis activated automatically. For this to work,TestEnvmust be installed in the base environment.Julia is launched with
--threads=autoand--startup-file=noby default. Pass custom Julia CLI flags afterserver.pyto override these defaults entirely.
Alternatives
Other projects that give AI agents access to Julia:
MCPRepl.jl and REPLicant.jl require you to manually start and manage Julia sessions.
julia-mcphandles this automatically.DaemonConductor.jl (linux only) runs Julia scripts, but calls are independent and don't share variables.
julia-mcpretains state between calls.
Available Tools
3 toolsjulia_evalA
ALWAYS use this tool to run Julia code. NEVER run julia via command line.
Persistent REPL session with state preserved between calls.
Each env_path gets its own session, started lazily.
Do not type Pkg.activate() explicitly in your code; instead, specify the env_path argument to select the environment.
Args: code: Julia code to evaluate. Use display(...)/println(...) to see output. env_path: Julia project directory path. Omit for a temporary environment. timeout: Seconds (default: 60). Auto-disabled for Pkg operations. julia_cmd: Custom Julia command, should be used rarely, only when explicitly requested. Examples: "julia +1.11", "julia --check-bounds=yes", "/path/to/julia".
Inputs: code (required), env_path, timeout, julia_cmd. Returns: result
julia_list_sessionsA
List all active Julia sessions and their environments.
Inputs: no named parameters. Returns: result
julia_restartA
Restart a Julia session, clearing all state.
IMPORTANT: Restarting is slow and loses all session state. Very rarely needed. Revise.jl is loaded automatically in every session, so code changes to loaded packages are picked up without restarting. Only restart as a last resort when the session is truly broken, or code changes that Revise cannot fix. Do NOT restart just because source files were edited between script or test runs — Revise picks up those changes automatically.
Args: env_path: Environment to restart. If omitted, restarts the temporary session (NOT every active session) — most callers should pass the same env_path they used in julia_eval.
Inputs: env_path. Returns: result
Tool Schema Changelog
Recent tool additions, removals, and schema changes observed during successful MCP inspections.
Loading tool schema changelog…
TDQS
Scored across 3 tools
Each tool has a clearly distinct purpose: julia_eval runs code, julia_list_sessions lists active sessions, and julia_restart restarts a session. There is no overlap or ambiguity.
All tool names follow a consistent 'julia_verb' pattern with snake_case, making it easy to predict and understand the function of each tool.
With 3 tools, the server covers the essential interactions with a Julia REPL (evaluating code, listing sessions, restarting). The count is well-scoped for the server's purpose.
The tool set covers core lifecycle operations (evaluate, list, restart). Minor gaps like obtaining session metadata or clearing state without restarting exist, but the surface is functional for typical usage.
Maintenance
Related MCP Connectors
Build Apps and run code in 30 languages — sandboxed, with persistent sessions for agent loops.
Persistent cloud workspaces for AI agents: run commands, edit files, use git and a browser.
Persistent Linux computers for AI agents: desktop, signed-in browser, vault, apps and shell.
On-demand GPU nodes for agents: create nodes, run commands, and submit jobs, billed by the minute.
Related MCP Servers
- AlicenseNot gradedqualityDmaintenanceThe sessionless code interpreter. Securely run AI-generated code in stateful sandboxes that run forever.76 npm230MIT

HOPX MCP Serverofficial
FlicenseNot gradedqualityDmaintenanceEnables AI assistants to execute Python, JavaScript, Bash, and Go code in blazing-fast (~0.1ms startup), isolated cloud containers with secure, ephemeral environments that auto-destroy after use.128-- AlicenseAqualityDmaintenanceEnables AI agents to execute Python, TypeScript, and JavaScript code in persistent Jupyter kernels with stateful variables and imports across interactions.779 PyPI4MIT
- AlicenseAqualityDmaintenanceEnables AI assistants to securely execute Python and JavaScript code in sandboxed environments, with file management and package installation.785 npmMIT