MATLAB MCP Server
Connect MCP-compatible AI applications to MATLAB for code execution, script analysis, and testing.
The server uses a local stdio integration and lets users choose working directories and, for Claude Desktop, filesystem scopes, showing some least-privilege consideration. However, arbitrary MATLAB execution, custom tools, and the filesystem extension remain broad capabilities, with no server-side sandbox evidenced. Human review of tool calls is recommended, but this is guidance rather than an enforced confirmation control. Default-on telemetry, its recipient, and a clear opt-out are disclosed; deductions apply because collected fields, retention, endpoints, and log-redaction practices are not specified. Credential, sensitive-file, and sensitive-log handling receive little dedicated treatment. Dependencies are pinned, three CVE/Dependabot mitigation pins are explicitly documented, and a vulnerability-reporting route exists, supporting full dependency-security credit. Executable effects and GUI exceptions are disclosed, but file, network, and system effects of arbitrary MATLAB code are not comprehensively constrained. A client removal command supports limited reversal, while MATLAB execution has no general rollback mechanism. Repository ownership claims, resource sources, copyright, and support channels are attributed; source attribution is not full because publisher identity is unverified by the supplied registry, without treating that unknown identity as suspicious.
The README is broadly consistent across tools, flags, release requirements, and client configurations, and it distinguishes read-only analysis from execution. Full credit is withheld because no implementation files are supplied to verify those contracts. MATLAB R2021a+, the rolling five-year support statement, R2023a/R2025a feature thresholds, PATH requirements, Go builds, and platform binaries address dependency availability well; reliance on latest-release links and an external MATLAB installation, without an offline path or detailed compatibility matrix, remains a limitation. Configurable log folders and levels plus the Windows Codex WINDIR workaround aid diagnosis, but common errors, structured error formats, recovery procedures, and failure examples are not systematically documented.
The material thoroughly addresses Claude Code, Claude Desktop, VS Code/Copilot, Codex, Windows, Linux, macOS, and multilingual readers. Tool inventories, inputs, release thresholds, display modes, and existing-session prerequisites establish useful boundaries, but safety limits, rejection conditions, and resource constraints for arbitrary evaluation and extension files are incomplete. Tool names and schemas are precise, and static checking is separated from execution, yet there is no complete agent-side policy for when each tool should be selected, avoided, or confirmed. Environment fit is strong, with platform-specific paths, environment-variable mapping, client configurations, and a documented Windows exception.
The README has mature navigation and separates setup, arguments, tools, resources, telemetry, security, licensing, and support. Installation examples cover four client families, three operating systems, and source builds. Server, tool, flag, and derived environment-variable names are stable and internally consistent. Examples are plentiful, but there is no dedicated FAQ or comprehensive troubleshooting tutorial. Several limitations are documented—release requirements, GUI exceptions, shared-session setup, single-user licensing, and WINDIR—but they are not consolidated into a complete limitations section. LICENSE.md supplies full restrictive BSD-style terms and identifies separate third-party licenses, earning full license credit. A latest-release path and version flag exist, but no changelog, migration guidance, or release cadence is provided. Copyright, issue reporting, technical support, and a security mailbox establish maintenance routes; full credit is withheld because the publisher is unverified in the supplied registry and no maintainer roster or response commitment is shown.
The tools promise directly usable toolbox metadata, static-analysis warnings, execution output, and comprehensive test results, giving outputs clear operational purposes. Connecting several AI clients to MATLAB while combining checking, execution, testing, and coding resources provides meaningful marginal value, though the static evidence contains no comparative evaluation, adoption evidence, or output-quality measurements. Binary installation is straightforward, but a licensed MATLAB installation, potentially heavyweight sessions or desktop windows, default telemetry, and single-user restrictions add cost and deployment constraints.
Most capabilities trace to named tools, fields, resources, defaults, and release requirements; dependency and CVE mitigation claims include exact version annotations. Implementation, tests, and release records are absent from the supplied evidence, so some behavioral and promotional claims rest only on the README. README, go.mod, LICENSE.md, SECURITY.md, and workflows corroborate the module name, copyright, maintenance routes, and dependency governance, but core runtime behavior lacks code-level corroboration. Defaults, conditions, release thresholds, and read-only versus executable behavior are generally separated clearly; however, claims such as “official,” “fully anonymized,” and “comprehensive test results” have no verification method in the provided material.
- The server can execute arbitrary MATLAB code and scripts. Enable per-call human confirmation in the client and restrict accessible directories, MATLAB account privileges, and network access to what the task requires.
- Telemetry is enabled by default, while the supplied material does not identify exact fields, retention, or endpoints. For sensitive projects, set --disable-telemetry=true first and inspect log contents and placement.
- The extension-file option can introduce custom tools, and Claude Desktop also requires a filesystem extension. Review extension definitions independently and authorize only necessary folders.
- MATLAB execution may modify files, open GUI windows, or cause other system effects, and no general rollback is provided. Use version control, backups, or an isolated environment for important work.
- The license restricts use to MathWorks products and offerings and limits shared or centralized multi-user use. Confirm the applicable MATLAB licensing terms before deployment.
- This assessment is based only on the supplied static files; the server, MATLAB, tests, and dependency scanners were not executed.
What does this agent do, and when should you use it?
MATLAB MCP Server is the official MathWorks MCP server for connecting compatible AI applications to a local MATLAB installation. It runs as a standalone binary over stdio and includes documented setup paths for Claude Code, Claude Desktop, GitHub Copilot in Visual Studio Code, and Codex. Its tools can start or quit MATLAB, evaluate code strings, execute .m files, run MATLAB unit tests, and perform read-only static analysis. The server also exposes MCP resources for MATLAB coding standards and plain-text Live Code, while JSON extension files can add custom tools. Execution remains within the user's machine and MATLAB environment, so adoption requires a supported MATLAB installation and careful review of calls that run code.
An AI application launches matlab-mcp-server over stdio, after which the server either starts MATLAB or, with MATLAB R2023a and later, connects to an existing session shared through shareMATLABSession(). detect_matlab_toolboxes reports installed MATLAB and toolbox versions. check_matlab_code reads an absolute .m script_path and returns style, potential-error, deprecated-function, performance, and best-practice findings without executing or modifying the file. evaluate_matlab_code runs a code string with project_path as MATLAB's working folder, run_matlab_file executes a script, and run_matlab_test_file executes a MATLAB unit-test file and returns comprehensive results. The server publishes guidelines://coding and guidelines://plain-text-live-code resources and can load custom MCP tools from one or more JSON files supplied with --extension-file. CLI flags or MW_MCP_SERVER_* environment variables control the MATLAB location, session and display modes, initial folder, logging, startup initialization, and telemetry.
- A MATLAB developer using Claude Code or Codex who wants an assistant to execute code inside a specific local project and inspect the output.
- A team maintaining .m files that needs read-only checks for style problems, potential errors, deprecated functions, performance issues, and best-practice violations.
- A developer using the MATLAB testing framework who wants an AI client to run a test file through run_matlab_test_file and receive comprehensive results.
- A MATLAB R2023a-or-newer user who wants the server to reuse an already running session shared with shareMATLABSession().
- A team that wants its AI client to consume MATLAB coding standards or guidance for version-controlled plain-text Live Code files.
- An organization with specialized MATLAB workflows that can express additional MCP tools in one or more extension-file JSON definitions.
What are this agent's strengths and limitations?
- It is provided by MathWorks and directly covers MATLAB lifecycle control, execution, static analysis, and unit testing.
- Its local stdio MCP interface has explicit setup instructions for Claude Code, Claude Desktop, GitHub Copilot in VS Code, and Codex.
- The new, auto, and existing session modes offer a choice between isolated MATLAB startup and reuse of a shared R2023a-or-later session.
- check_matlab_code is explicitly read-only and identifies several classes of code-quality issue without running the script.
- Multiple extension-file JSON definitions can add custom tools, and two built-in resources supply MATLAB-specific coding guidance.
- Core operation requires a local MATLAB R2021a-or-later installation and remains subject to the MathWorks Software License Agreement.
- The server may not be shared by multiple users; shared or centralized use requires contacting MathWorks.
- Execution tools can run code in the local MATLAB environment, so important calls require human review and validation.
- Anonymized telemetry is enabled by default and must be explicitly disabled with --disable-telemetry=true.
- Codex on Windows does not forward the WINDIR variable required by MATLAB and Simulink, requiring an env_vars = ["WINDIR"] config.toml workaround.
- The repository metadata reports NOASSERTION for the license, while the supplied material only points to LICENSE.md and does not name its license.
How do you install or deploy this agent?
Prerequisites: install MATLAB R2021a or later and add it to the system PATH. The server supports MATLAB releases from the past five years. On Windows or Linux, download the binary from the repository's Latest Release. Alternatively, install Go and build it with:
go install github.com/matlab/matlab-mcp-server/cmd/matlab-mcp-server@latestFor Apple silicon macOS:
curl -L -o ~/Downloads/matlab-mcp-server https://github.com/matlab/matlab-mcp-server/releases/latest/download/matlab-mcp-server-macos-arm64
chmod +x ~/Downloads/matlab-mcp-serverFor Intel macOS:
curl -L -o ~/Downloads/matlab-mcp-server https://github.com/matlab/matlab-mcp-server/releases/latest/download/matlab-mcp-server-macos-x64
chmod +x ~/Downloads/matlab-mcp-serverClaude Code:
claude mcp add --transport stdio matlab -- /fullpath/to/matlab-mcp-server-binaryCodex:
codex mcp add matlab -- /fullpath/to/matlab-mcp-server-binaryFor Claude Desktop, first install and enable Anthropic's Filesystem extension and authorize the required folders. Then download matlab-mcp-server.mcpb from Latest Release, open it, and install the extension in Claude Desktop. For GitHub Copilot in VS Code, create .vscode/mcp.json with a matlab server whose type is stdio and whose command is the full path to the downloaded binary.
How do you use this agent?
After registering the server, call detect_matlab_toolboxes to confirm that MATLAB and its toolboxes are visible. For static analysis, call check_matlab_code with the absolute script_path of a valid .m file. To evaluate a code string, call evaluate_matlab_code with code and an absolute project_path; use run_matlab_file or run_matlab_test_file with an absolute script_path to execute a script or test file. MATLAB starts on the first tool call by default; add --initialize-matlab-on-startup=true to start it with the server. To reuse a running MATLAB session, first run ./matlab-mcp-server --setup-matlab to install MATLAB MCP Server Toolbox, execute shareMATLABSession() in MATLAB, and launch the server with --matlab-session-mode=existing or auto. Options such as --initial-working-folder, --matlab-display-mode, --matlab-root, --log-level, and --disable-telemetry=true customize operation; CLI flags override corresponding MW_MCP_SERVER_* environment variables.
How does this agent compare with similar options?
Compared with using the MATLAB Agentic Toolkit or Simulink Agentic Toolkit to assist an agent with MATLAB or Simulink, this repository supplies the underlying official MCP server; those toolkits can also install it and contribute skills. Within the server itself, new mode always starts MATLAB, while existing mode connects to a prepared shared session and auto mode tries the shared session before starting a new one.