julia-mcp
Enables AI assistants to execute Julia code efficiently with persistent sessions, avoiding startup costs and maintaining state across calls.
README
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
Requirements
- uv (you might already have it installed)
- Julia – any version,
juliabinary must be inPATH- Recommended 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.git
Then 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.py
Project-scoped (only available in the current project):
claude mcp add --scope project julia -- uv run --directory /any_directory/julia-mcp python server.py
<details> <summary>Custom Julia CLI arguments</summary>
Append 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=yes
</details>
Claude Desktop
Add to claude_desktop_config.json:
{
"mcpServers": {
"julia": {
"command": "uv",
"args": ["run", "--directory", "/any_directory/julia-mcp", "python", "server.py"]
}
}
}
<details> <summary>Custom Julia CLI arguments</summary>
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"]
}
}
}
</details>
Codex CLI
User-wide — makes Julia available in all projects:
codex mcp add julia -- uv run --directory /any_directory/julia-mcp server.py
<details> <summary>Custom Julia CLI arguments</summary>
Append 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=yes
</details>
VS Code Copilot
Add to .vscode/mcp.json:
{
"servers": {
"julia": {
"command": "uv",
"args": ["run", "--directory", "/path/to/julia-mcp", "python", "server.py"]
}
}
}
<details> <summary>Custom Julia CLI arguments</summary>
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"]
}
}
}
</details>
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.
Recommended Servers
playwright-mcp
A Model Context Protocol server that enables LLMs to interact with web pages through structured accessibility snapshots without requiring vision models or screenshots.
Magic Component Platform (MCP)
An AI-powered tool that generates modern UI components from natural language descriptions, integrating with popular IDEs to streamline UI development workflow.
Audiense Insights MCP Server
Enables interaction with Audiense Insights accounts via the Model Context Protocol, facilitating the extraction and analysis of marketing insights and audience data including demographics, behavior, and influencer engagement.
VeyraX MCP
Single MCP tool to connect all your favorite tools: Gmail, Calendar and 40 more.
graphlit-mcp-server
The Model Context Protocol (MCP) Server enables integration between MCP clients and the Graphlit service. Ingest anything from Slack to Gmail to podcast feeds, in addition to web crawling, into a Graphlit project - and then retrieve relevant contents from the MCP client.
Kagi MCP Server
An MCP server that integrates Kagi search capabilities with Claude AI, enabling Claude to perform real-time web searches when answering questions that require up-to-date information.
E2B
Using MCP to run code via e2b.
Neon Database
MCP server for interacting with Neon Management API and databases
Exa Search
A Model Context Protocol (MCP) server lets AI assistants like Claude use the Exa AI Search API for web searches. This setup allows AI models to get real-time web information in a safe and controlled way.
Qdrant Server
This repository is an example of how to create a MCP server for Qdrant, a vector search engine.