julia-mcp
Enables GitHub Copilot to run Julia code via MCP, maintaining state across interactions within project directories.
Click on "Install 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-mcpcompute 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".
| Name | Required | Description | Default |
|---|---|---|---|
| code | Yes | ||
| env_path | No | ||
| timeout | No | ||
| julia_cmd | No |
Output Schema
| Name | Required | Description |
|---|---|---|
| result | Yes |
TDQS
Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?
With no annotations, the description fully discloses behavior: persistent REPL session with state preserved, lazy session creation per env_path, timeout auto-disabled for Pkg operations, and the need for display/println to see output. It lacks details on error handling or side effects, but covers key behavioral traits adequately.
Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.
Is the description appropriately sized, front-loaded, and free of redundancy?
The description is concise and well-structured: a bold directive first, then a line about session behavior, then a bullet-point list for arguments. Every sentence adds value, and there is no redundant information.
Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.
Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?
Given 4 parameters, no annotations, and an existing output schema, the description covers purpose, usage guidelines, behavior, and parameter details comprehensively. It explains session persistence, environment management, and special timeout behavior, making the tool easy to use correctly.
Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.
Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?
Schema coverage is 0%, but the description explains every parameter's purpose and usage: code requires display/println, env_path defaults to a temporary environment, timeout auto-disables for Pkg, and julia_cmd is rarely used with examples. This adds significant meaning beyond the schema's field names and types.
Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.
Does the description clearly state what the tool does and how it differs from similar tools?
The description explicitly states 'ALWAYS use this tool to run Julia code' and explains it as a persistent REPL session. The verb 'run' and resource 'Julia code' are specific, and the instruction 'NEVER run julia via command line' distinguishes it from command-line execution, setting it apart from siblings like julia_list_sessions and julia_restart.
Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.
Does the description explain when to use this tool, when not to, or what alternatives exist?
The description provides clear directives: 'ALWAYS use this tool to run Julia code' and 'NEVER run julia via command line.' It also advises against typing Pkg.activate() explicitly, recommending the env_path argument instead. This explicitly communicates when to use this tool and how to use it correctly.
Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.
julia_list_sessionsA
List all active Julia sessions and their environments.
| Name | Required | Description | Default |
|---|---|---|---|
No parameters | |||
Output Schema
| Name | Required | Description |
|---|---|---|
| result | Yes |
TDQS
Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?
No annotations are provided, so the description must disclose behavior. It mentions 'active' but does not explain what constitutes active, nor does it cover output format, side effects, or error cases. This is insufficient for a tool with no annotations.
Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.
Is the description appropriately sized, front-loaded, and free of redundancy?
The description is a single, clear sentence with no redundant or unnecessary words. It conveys the core purpose efficiently.
Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.
Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?
For a straightforward list tool with no parameters and an output schema present, the description is largely complete. However, it could briefly mention what 'environments' entails or the structure of the output for added clarity.
Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.
Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?
The input schema has no parameters, and the description correctly implies no inputs are needed. Schema coverage is 100%, so the description adds minimal extra semantic value, but it reinforces the parameterless nature.
Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.
Does the description clearly state what the tool does and how it differs from similar tools?
The description clearly specifies the tool's action ('list') and resource ('active Julia sessions and their environments'), which distinguishes it from siblings like julia_eval (evaluation) and julia_restart (restarting).
Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.
Does the description explain when to use this tool, when not to, or what alternatives exist?
No explicit guidance on when to use this tool over siblings or when it is appropriate. The context signals and sibling names provide implicit differentiation, but the description itself lacks direct usage recommendations.
Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.
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.
| Name | Required | Description | Default |
|---|---|---|---|
| env_path | No |
Output Schema
| Name | Required | Description |
|---|---|---|
| result | Yes |
TDQS
Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?
Without annotations, the description fully discloses behavioral traits: restarting is slow, loses all state, Revise.jl is loaded automatically, and the default behavior of env_path restarts only the temporary session.
Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.
Is the description appropriately sized, front-loaded, and free of redundancy?
The description is concise and well-structured. It starts with the core purpose, then provides crucial context in an IMPORTANT note, and includes a clear Args section for the parameter. Every sentence adds value.
Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.
Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?
Given the presence of an output schema (which can describe return values), the description covers all other aspects: purpose, behavior, parameter semantics, and usage context. It is complete for the tool's complexity.
Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.
Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?
The schema has 0% coverage for the single parameter env_path. The description adds essential meaning: environment to restart, default behavior (restarts temporary session, not all active), and recommends using the same env_path from julia_eval.
Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.
Does the description clearly state what the tool does and how it differs from similar tools?
The description clearly states 'Restart a Julia session, clearing all state,' which is a specific verb-resource pair. It distinguishes from siblings julia_eval and julia_list_sessions, which evaluate code and list sessions respectively.
Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.
Does the description explain when to use this tool, when not to, or what alternatives exist?
Explicitly says 'Only restart as a last resort' and explains that Revise.jl automatically picks up code changes, so restarting is rarely needed. Provides clear when-to-use and when-not-to-use guidance.
Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.
Tool Schema Changelog
Recent tool additions, removals, and schema changes observed during successful MCP inspections. Dates show when Glama detected each change.
3 tool updates
v0.1.0- First observed
julia_eval - First observed
julia_list_sessions - First observed
julia_restart
TDQS
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
Resources
Unclaimed servers have limited discoverability.
Looking for Admin?
If you are the server author, to access and configure the admin panel.
Related MCP Connectors
- mcp-serverOAuthai.cdbx
Build Apps and run code in 30 languages — sandboxed, with persistent sessions for agent loops.
On-demand GPU nodes for agents: create nodes, run commands, and submit jobs, billed by the minute.
Hosted runtime for persistent agent teams, durable workflows, memory, schedules, and goals.
Persistent memory and cross-session learning for AI coding assistants (hosted remote MCP).
Related MCP Servers
- AlicenseNot gradedqualityDmaintenanceThe sessionless code interpreter. Securely run AI-generated code in stateful sandboxes that run forever.123228MIT

HOPX MCP Serverofficial
FlicenseNot gradedqualityCmaintenanceEnables 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.155-- AlicenseAqualityDmaintenanceEnables AI agents to execute Python, TypeScript, and JavaScript code in persistent Jupyter kernels with stateful variables and imports across interactions.74MIT
- FlicenseAqualityDmaintenanceEnables AI assistants to securely execute Python and JavaScript code in sandboxed environments, with file management and package installation.788-
Latest Blog Posts
- Who's Calling? MCP Hosts Are an Identity Blind Spot (And the Spec Knows It)By Om-Shree-0709 on .mcpAgent IdentityOAuth 2.1
- Your AI Chatbot Just Exposed Your CEO's Salary to an InternBy Om-Shree-0709 on .Agent IdentityMCP SecurityOAuth Delegation
- Why MCP Servers Need Execution Sandboxing (And Why Your Current Stack Isn't Enough)By Om-Shree-0709 on .Agentic AiPrompt InjectionWebAssembly
MCP directory API
We provide all the information about MCP servers via our MCP API.
curl -X GET 'https://glama.ai/api/mcp/v1/servers/aplavin/julia-mcp'
If you have feedback or need assistance with the MCP directory API, please join our Discord server