Downloads MATLAB Package Manager (mpm) and installs MathWorks products from the command line. Use for scripted, repeatable installations in CI/CD, containers, or fleet provisioning.
Ships in matlab-core. Installing the plugin adds it to Claude Code.
What the skill costs in Claude's context, stage by stage
Name and description: Claude knows it exists.
SKILL.md joins the conversation and stays.
Read when SKILL.md points to them.
Use this skill when asked to install MathWorks products using MATLAB Package Manager (mpm) from the OS command line.
$ARGUMENTS
mpm / mpm.exe. Never rely on relative paths.STOP. Read this entire section before executing ANY Windows step.
NEVER use powershell.exe -Command for ANY reason. Bash mangles $, backticks, quotes, arrays, and script blocks before PowerShell sees them. This WILL cause unexpected EOF or syntax errors.
NEVER create any file with a bash heredoc (cat > file <<'EOF' ... EOF) or shell redirection (echo ... > file, printf ... > file, >>). This includes quoted heredocs (<<'PS1', <<"EOF"). Do not rationalize an exception: the reason is NOT variable expansion (so "the delimiter is quoted, so it's safe" is wrong). The reasons the ban is absolute are (a) Git Bash rewrites paths, line endings, and encoding as it creates the file, corrupting .ps1 parsing, and (b) the Write file tool is the single approved mechanism for creating any file in this protocol — scripts and input files alike. There is no safe heredoc. If you catch yourself reaching for cat, echo, printf, >, >>, or << to produce a file, STOP and use the Write file tool.
ALWAYS write .ps1 files using the Write file tool, then invoke with:
powershell.exe -NoLogo -NoProfile -NonInteractive -ExecutionPolicy Bypass -File <absolute-script-path>
Do not emit CMD-only syntax (if not exist, set VAR=, %USERPROFILE%). Use PowerShell equivalents (Test-Path, $env:USERPROFILE).
ASCII only in all .ps1 file content. No em dashes (—), en dashes (–), curly quotes, or other non-ASCII characters. They cause PowerShell parse errors (broken string terminators, missing brace errors) when file encoding doesn't preserve them.
If you are about to type powershell.exe -Command — STOP. You are violating this rule. Use the Write file tool to create a .ps1 file instead.
Windows script authoring pattern:
powershell.exe -Command "$script = @'... (bash corrupts $ and heredocs)cat > C:/Windows/Temp/script.ps1 <<'PS1' ... PS1 (bash heredoc — banned even with a quoted 'PS1' delimiter)echo '...' > script.ps1 or printf '...' > script.ps1 (shell redirection — banned).ps1 files into it, then run with -FileThe only Bash tool commands allowed in this protocol are: mkdir -p (create the working folder), powershell.exe ... -File (invoke a script), test -f (verify artifacts), and rm -rf (cleanup). Any Bash command that would create or write file content is a violation — file content comes from the Write file tool, always.
Unique temp folder:
mkdir -p "C:/Users/<username>/AppData/Local/Temp/mpm-<YYYYMMDD-HHMMSS>"mkdir -p "/tmp/mpm-<YYYYMMDD-HHMMSS>"Windows PowerShell syntax reminders:
if not exist C:\Users\name\Downloads mkdir C:\Users\name\Downloads (CMD syntax)if (-not (Test-Path -LiteralPath 'C:\Users\name\Downloads')) { New-Item -ItemType Directory -Path 'C:\Users\name\Downloads' | Out-Null }Do not ask the user for the exact product name or identifier. Look it up using the appropriate mpm input file from https://www.mathworks.com/products/mpm.html Do not ask the user whether to install dependencies or not. mpm will take care of it. Just install whatever the user asked for, and let mpm do the rest. If a user types the shortname of MATLAB releases, automatically use the correct expanded full name. e.g. 25a is R2025a, 25b is R2025b
R2025b)Before executing any steps, always confirm the user's choices:
Ask for confirmation in one message. The user can reply yes to all to confirm everything at once. If they reply with specific changes, update the selections and confirm again.
Display each value to be confirmed in its own new line.
Note at the bottom of the confirmation message: "Required dependencies will be installed automatically by mpm."
Once the user confirms their inputs, display a clear installation plan before running any commands. Adapt the template below for the target OS (use forward slashes and /tmp/ for Linux/macOS, omit .ps1 script references, and omit the UAC note). Use this format:
Here's what I'll do:
Working folder: <C:\Users\<username>\AppData\Local\Temp\mpm-YYYYMMDD-HHMMSS>
Step 1 — Download mpm
Check for mpm at <canonical mpm path>
Download from <URL> if not present
Script: <working folder>\mpm_download.ps1
Step 2 — Prepare input file
Download release template for <release> from mathworks.com
Set destination folder: <destination>
Enable products: <comma-separated list>
Input file: <working folder>\mpm_input_<releaselower>.txt
Script: <working folder>\mpm_prepare_input.ps1
Step 3 — Run installation
Execute mpm install using the prepared input file
<Windows only: note that elevated permissions (UAC prompt) will be required>
Step 4 — Verify
Confirm MATLAB binary exists: <completion artifact path>
Verify products via: <DESTINATION>/appdata/prodcontents.json
<if support packages requested> Verify support packages via: <SUPPORTPKGROOT>/appdata/prodcontents.json
Delete working folder: <working folder>
<if MATLAB included> Show release notes: https://www.mathworks.com/help/matlab/release-notes.html?startrelease=<RELEASE>&endrelease=<RELEASE>
Resolve all environment variables and shell-specific paths to absolute paths before displaying. Generate the timestamp for the working folder name at plan display time so it is fixed for the entire session. Do not start Step 1 until the user acknowledges the plan (a simple "ok", "go", "yes", or similar is enough).
Official documentation:
Important: When executing steps, do not narrate or explain what you are about to do. Just run the commands and report results concisely (success, failure, or error). Reserve commentary for confirmations, the plan display, and error reporting only.
The
caller=agentline is a usage-data tag, not an installation setting, so it does not need to appear in the confirmation, plan, progress messages, or summary. If the user asks about it, explain that it marks the install as agent-initiated in mpm usage data and has no effect on what gets installed or where.
powershell.exe)bash / shzsh or bash (Apple silicon only; Intel Mac is not supported — stop and inform the user)Before running any command in Steps 1–3 on Windows, confirm:
-Command, not heredoc, not echo/printf)powershell.exe ... -File <path> (not -Command)bash command<<, >, or >> redirecting into a .ps1 or input file (heredoc/redirection is banned even with a quoted delimiter)If any check fails, STOP and rewrite using the Write file tool.
Canonical locations (resolve to absolute paths before use):
<user home>\Downloads\mpm.exe<user home>/Downloads/mpm<user home>/Downloads/mpmIf the file exists at that path, reuse it. Otherwise download from:
MANDATORY: Use the Write file tool to create this script. NEVER use -Command or heredoc.
mkdir -p "C:/Users/<username>/AppData/Local/Temp/mpm-YYYYMMDD-HHMMSS"
<working folder>\mpm_download.ps1:param(
[Parameter(Mandatory = $true)]
[string]$Destination
)
if (Test-Path -LiteralPath $Destination) {
Write-Host "mpm already present at $Destination"
} else {
Write-Host "Downloading mpm from https://www.mathworks.com/mpm/win64/mpm - this may take a few minutes..."
Invoke-WebRequest -Uri "https://www.mathworks.com/mpm/win64/mpm" -OutFile $Destination -UseBasicParsing
if (-not (Test-Path -LiteralPath $Destination)) { throw "mpm download failed: $Destination" }
Write-Host "mpm downloaded to $Destination"
}
powershell.exe -NoLogo -NoProfile -NonInteractive -ExecutionPolicy Bypass -File "<working folder>\mpm_download.ps1" -Destination "C:\Users\<username>\Downloads\mpm.exe"
See reference/linux-macos-steps.md for full shell scripts. Summary: create working folder at /tmp/mpm-YYYYMMDD-HHMMSS, download mpm with curl -fL -o to ~/Downloads/mpm, and chmod +x.
Always use a release template input file from: https://www.mathworks.com/products/mpm.html
Download the template input file for the requested release, then edit it:
destinationFolder to the requested installation path.product.<Name> line for requested products and support packages.noJRE=true to the input file (on its own line, after destinationFolder). This prevents mpm from bundling a Java Runtime. Only omit this line if the user explicitly requests JRE installation.caller=agent line (see "caller — mark the install as agent-driven" below).updateLevel commented unless the user requests a specific update.?checksum=...).After editing the file, verify:
destinationFolder matches the user-requested install path exactly.product.<Name> line is uncommented (no leading #).caller=agent line is present.If any verification fails, stop and retry the download once, then re-edit and re-verify. If it still fails, stop and report the error.
The input file format uses product.<Name> entries for both products and support packages.
You must look up the exact product.<Name> identifiers in the release input file.
Product identifiers use underscores for spaces (e.g. "Signal Processing Toolbox" -> product.Signal_Processing_Toolbox).
Recent versions of mpm accept a caller input-file key that records what initiated the installation. Always add it to the input file as its own line with the fixed value agent, so the line reads exactly caller=agent.
Use this exact value — do not substitute an agent name, model, or any other identifier. It records only that an automation agent performed the install, letting agent-driven installs be distinguished from manual ones in mpm usage data.
Set caller inside the input file, not on the command line. When --inputfile is used, mpm rejects any other command-line option, so the caller value must travel in the input file. mpm records the value in its usage data (uppercased), so casing is not significant. The line has no effect on what gets installed or where.
See Execution Style for how to handle the caller line in user-facing messages.
MANDATORY: Use the Write file tool to create this script. NEVER use -Command or heredoc.
<working folder>\mpm_prepare_input.ps1:param(
[Parameter(Mandatory = $true)]
[string]$Release,
[Parameter(Mandatory = $true)]
[string]$Destination,
[Parameter(Mandatory = $true)]
[string]$WorkingFolder,
[Parameter(Mandatory = $true)]
[string]$Products
)
Set-StrictMode -Version Latest
$ErrorActionPreference = "Stop"
# -File mode passes "a,b" as one string; split into an array
$ProductList = $Products -split ',' | ForEach-Object { $_.Trim() }
$releaseLower = $Release.ToLower()
$inputUrl = "https://www.mathworks.com/content/dam/mathworks/mathworks-dot-com/products/mpm/mpm-input-${releaseLower}.txt"
$inputFile = Join-Path $WorkingFolder "mpm_input_${releaseLower}.txt"
Write-Host "Downloading input file from $inputUrl..."
Invoke-WebRequest -Uri $inputUrl -OutFile $inputFile -UseBasicParsing
if (-not (Test-Path -LiteralPath $inputFile)) {
throw "Input file was not downloaded: $inputFile"
}
$lines = Get-Content -LiteralPath $inputFile
$lines = $lines | ForEach-Object {
if ($_ -match '^\s*#?\s*destinationFolder=') {
"destinationFolder=$Destination"
"noJRE=true"
"caller=agent"
}
else {
$_
}
}
foreach ($product in $ProductList) {
$escaped = [Regex]::Escape($product)
$lines = $lines | ForEach-Object {
if ($_ -match "^\s*#\s*$escaped\s*$") {
$product
}
else {
$_
}
}
}
Set-Content -LiteralPath $inputFile -Value $lines -Encoding UTF8
$lines = Get-Content -LiteralPath $inputFile
$destinationLine = $lines | Where-Object { $_ -match '^destinationFolder=' } | Select-Object -First 1
if (-not $destinationLine) { throw "destinationFolder line not found in $inputFile" }
if ($destinationLine -ne "destinationFolder=$Destination") { throw "destinationFolder mismatch: $destinationLine" }
$callerLine = $lines | Where-Object { $_ -match '^caller=' } | Select-Object -First 1
if ($callerLine -ne "caller=agent") { throw "caller line missing or incorrect: $callerLine" }
$uncommentedProducts = $lines | Where-Object { $_ -match '^\s*product\.' }
$unexpectedProducts = $uncommentedProducts | Where-Object { $ProductList -notcontains $_ }
if ($unexpectedProducts) { throw "Unrequested products enabled: $($unexpectedProducts -join ', ')" }
foreach ($product in $ProductList) {
if (-not ($lines -contains $product)) { throw "Requested product not enabled: $product" }
}
Write-Host "Input file ready: $inputFile"
Note: the script writes the input file to <working folder>\mpm_input_<releaselower>.txt, so cleanup of the working folder deletes it automatically. The input file path will be reported by the script on completion.
powershell.exe -NoLogo -NoProfile -NonInteractive -ExecutionPolicy Bypass -File "<working folder>\mpm_prepare_input.ps1" -Release "R2025b" -Destination "C:\MATLAB\R2025b" -WorkingFolder "<working folder>" -Products "product.MATLAB,product.Simulink"
See reference/linux-macos-steps.md for the full shell script. Summary: download the release input file with curl, edit with sed to set destinationFolder, add noJRE=true and a caller=agent line, and uncomment requested products, then verify all edits.
IMPORTANT:
--inputfile, do not pass any other mpm options. The caller value is set inside the input file in Step 2 (caller=agent), not on the command line — mpm rejects --inputfile combined with any other option.Start-Process -Verb RunAs for elevated execution.MANDATORY: Use the Write file tool to create a .ps1 script for this step. NEVER use -Command or heredoc. Then invoke with powershell.exe ... -File <path>.
Write the following to <working folder>\mpm_install.ps1 using the Write file tool, then run with -File:
param(
[Parameter(Mandatory = $true)]
[string]$MpmPath,
[Parameter(Mandatory = $true)]
[string]$InputFile
)
$installArgs = @(
"install",
"--inputfile=$InputFile"
)
$display = '"' + $MpmPath + '" install ' + ('--inputfile="' + $InputFile + '"')
Write-Host "Running: $display"
Start-Process -FilePath $MpmPath -ArgumentList $installArgs -Verb RunAs -Wait
Run it:
powershell.exe -NoLogo -NoProfile -NonInteractive -ExecutionPolicy Bypass -File "<working folder>\mpm_install.ps1" -MpmPath "C:\Users\<username>\Downloads\mpm.exe" -InputFile "<working folder>\mpm_input_<releaselower>.txt"
See reference/linux-macos-steps.md. Summary: run mpm install --inputfile=<path> directly (no elevation needed). The caller=agent line is already in the input file from Step 2.
This step defines completion. It is mandatory. Wait until the mpm process has exited. Do not proceed until it is done. If the completion artifact does not exist, stop and report failure. Do not re-run Step 3.
Completion artifacts (use the destination folder you set in the input file):
<DESTINATION>\bin\matlab.exe<DESTINATION>/bin/matlab<DESTINATION>/Contents/MacOS/MATLABUse the Bash tool with test -f to check existence. Do not use powershell.exe -Command for this check.
test -f "<DESTINATION>/bin/matlab.exe" && echo "VERIFIED" || echo "NOT FOUND"
After confirming the MATLAB binary exists, verify each requested item was installed. Products and support packages are stored in separate locations with separate prodcontents.json files. Do not check one location for items that belong in the other.
Products (items whose mpm identifier does NOT contain Support_Package):
<DESTINATION>/appdata/prodcontents.json using the Read tool."Simulink 25.1 win64").product. prefix and replace underscores with spaces). For example, product.Signal_Processing_Toolbox matches a key starting with Signal Processing Toolbox.Support packages (items whose mpm identifier contains Support_Package):
C:\ProgramData\MATLAB\SupportPackages\<RELEASE>/usr/local/MATLAB/SupportPackages/<RELEASE>~/Library/Application Support/MathWorks/MATLAB/SupportPackages/<RELEASE><SUPPORTPKGROOT>/appdata/prodcontents.json using the Read tool.Report Verified or Not found for each item. If any item is not found, stop and report which items failed.
After all items are verified, delete the entire working folder and its contents using the Bash tool:
rm -rf "C:/Users/<username>/AppData/Local/Temp/mpm-YYYYMMDD-HHMMSS"
Only if MATLAB (the base product) was included in the installation, provide a link to the release notes after successful verification and cleanup:
https://www.mathworks.com/help/matlab/release-notes.html?startrelease=<RELEASE>&endrelease=<RELEASE>&rntext=&groupby=release&sortby=descending&searchHighlight=
Replace <RELEASE> with the installed release (e.g., R2025b). Display the link on its own line for readability:
View the MATLAB R2025b Release Notes by visiting this link: https://www.mathworks.com/help/matlab/release-notes.html?startrelease=R2025b&endrelease=R2025b&rntext=&groupby=release&sortby=descending&searchHighlight=
Do not show this link if the user only installed toolboxes or support packages without MATLAB.
ErrorCode::IncompatibleProduct ("Selected products are incompatible"): The destination folder most likely contains an existing MATLAB installation. Inform the user and ask them to choose an empty destination folder.| Command / Pattern | Purpose |
|---|---|
mpm install --inputfile=<file> | Install products defined in an input file |
mpm_input_<release>.txt | Release-specific input file template from mathworks.com |
product.<Name> | Input file entry format for products and support packages |
destinationFolder=<path> | Input file directive setting the install location |
Start-Process -Verb RunAs -Wait | Elevated execution on Windows (UAC) |
Invoke-WebRequest -OutFile | Download files in PowerShell |
curl -fL -o | Download files on Linux/macOS |
Copyright 2026 The MathWorks, Inc.
What SKILL.md sets; muted values are Claude Code's defaults
Three short reads, in order
/matlab-core:matlab-install-productsfrom matlab-core
npx claudepluginhub matlab/matlab-agentic-toolkit --plugin matlab-core6 skills in this plugin
/matlab-create-live-scriptCreate, edit, and run plain-text MATLAB live scripts (.m files) with rich text formatting, LaTeX equations, section breaks, and inline figures. Use when generating tutorials, analysis notebooks, reports, documentation, or educational content, when modifying existing live scripts, or when converting existing binary .mlx files to .m for version control. Requires R2025a+./matlab-debug-codeDiagnose MATLAB errors and unexpected behavior. Breakpoints, workspace inspection, try-catch diagnostics, and common error patterns. Use when debugging functions, tracing errors, inspecting variables, or diagnosing runtime failures./matlab-list-productsShow all installed MATLAB products and support packages for a given MATLAB installation folder. Use when listing, checking, or verifying what products or support packages are in a MATLAB installation./matlab-read-documentationGuides the agent to reference official MathWorks Documentation and Help. Determine correct function syntax and workflows from user guides when deeper context is needed. Minimize iterations and repetitive trial and error. Use this skill to: Identify correct syntax and configuration details. Retrieve relevant, version-specific (or release-specific) information from official documentation. Consult user guides when conceptual or workflow context is needed. Apply best practices./matlab-review-codeReview MATLAB code for quality, performance, maintainability, and adherence to MathWorks coding standards. Uses check_matlab_code and matlab_coding_guidelines. Use when reviewing code, checking style, finding code smells, assessing quality, or preparing code for handoff or publication.Other plugins' skills for the same job