julia
MCP server for persistent Julia sessions — fast iteration without startup/compilation overhead
claude mcp add --transport stdio aplavin-julia-mcp uv run --directory /any_directory/julia-mcp python server.py
How to use
The julia MCP server provides persistent Julia sessions that can execute code with minimal startup overhead. Each unique env_path you specify corresponds to an isolated Julia process with its own state (variables, functions, and loaded packages). Sessions are created on demand and persist across calls, so repeated evaluations are fast. Available tools include julia_eval for running code in a persistent session, julia_restart to reset a session and clear all state, and julia_list_sessions to inspect active sessions and their status. The server is designed to be transport-agnostic, using a pure stdio-based protocol, so you won’t need to open network ports. You can integrate this with Claude, Codex, or code editors by registering the MCP server under a name like julia and pointing the client to the uv transport as shown in the examples.
How to install
Prerequisites:
- Julia installed and accessible as julia on your PATH
- uv (the Python MCP transport) installed on your system
- Python 3.8+ installed
Step-by-step:
-
Clone the repository: git clone https://github.com/aplavin/julia-mcp.git cd julia-mcp
-
Ensure Julia and uv are available:
- Verify Julia: julia --version
- Verify uv: uv --version
-
Install Python dependencies (if requirements.txt exists): python -m pip install -r requirements.txt (If no requirements file is present, ensure Python 3.x is installed and you can run server.py directly.)
-
Start or register the MCP server using the client configuration provided in the README. For example, using the uv transport: uv run --directory /path/to/julia-mcp python server.py
-
Register the server with your client of choice (Claude, Codex, VS Code Copilot, etc.) using the command examples in the README, adapting the directory path to where you cloned the repository.
Notes:
- You may need to customize the environment (e.g., Julia project directories) via env_path passed to julia_eval. Ensure you have the necessary Julia packages installed or available globally.
- If you run multiple projects, provide a separate env_path so each gets its own isolated Julia session.
Additional notes
Tips and caveats:
- env_path controls per-project isolation; omit env_path for a temporary session that is cleaned up on shutdown.
- If you work with a /test/ path, the server can auto-activate TestEnv when available; ensure TestEnv.jl is installed in the base Julia environment for this to work.
- The default Julia flags used by the server are --threads=auto and --startup-file=no. You can override these by passing additional Julia flags after server.py in the client command.
- The tools are designed to be resilient: sessions recover from crashes and are recovered automatically; you don’t need manual session management.
- If you encounter issues with long-running computations, consider increasing the timeout in julia_eval or adjusting Julia’s thread settings via the CLI arguments.
Related MCP Servers
mcp -odoo
A Model Context Protocol (MCP) server that enables AI assistants to securely interact with Odoo ERP systems through standardized resources and tools for data retrieval and manipulation.
mcp-in-action
极客时间MCP新课已经上线!超2000同学一起开启MCP学习之旅!
mcp-stata
A lightweight Model Context Protocol (MCP) server for Stata. Execute commands, inspect data, retrieve stored results (r()/e()), and view graphs in your chat interface. Built for economists who want to integrate LLM assistance into their Stata workflow.
asterisk
Asterisk Model Context Protocol (MCP) server.
BinAssistMCP
Binary Ninja plugin to provide MCP functionality.
mcp-cyberbro
Using MCP is fun with Cyberbro!