matlab/matlab-agentic-toolkit

The MATLAB Agentic Toolkit brings proven MATLAB capabilities to AI agents, making engineering and scientific workflows agent-ready.

MATLAB Agentic Toolkit – Quick Overview

What it is – A MATLAB‑provided add‑on that lets large‑language‑model (LLM) coding assistants (Claude Code, GitHub Copilot, OpenAI Codex, Gemini CLI, Amp, etc.) talk to a running MATLAB session. It does this by installing the MATLAB MCP Server (a Model‑Context‑Protocol server) and loading a collection of skills that encode MATLAB‑specific knowledge (toolbox functions, coding standards, workflow conventions).

Why it matters – LLM‑based code generators often hallucinate MATLAB functions or miss toolbox‑specific syntax. By giving the agent a curated, token‑efficient knowledge base and direct execution tools, the toolkit makes the AI’s suggestions more reliable and reduces wasted tokens.


Key Features (from the README)

Feature What you get How it’s used
MCP Server installation A local server that exposes MATLAB as a set of tools (e.g., evaluate_matlab_code, run_matlab_test_file). The installer adds the server automatically; agents call the tools via the MCP protocol.
Curated Skills Pre‑packaged skill groups covering core MATLAB, app building, data analysis, external language interfaces, and dozens of toolbox domains (AI, Aerospace, Robotics, etc.). Agents trigger a skill by name (e.g., /matlab-write-tests) or let the toolkit suggest the right one based on the request.
Guidelines as resources matlab_coding_guidelines and plain_text_live_code_guidelines – plain‑text reference documents the agent can read. Helpful for style checks or Live Script formatting.
Toolbox‑aware execution Tools to run code, execute files, run tests (runtests), static analysis (check_matlab_code), and list installed toolboxes. Agents can ask: “Run this script and give me the output.”
Seamless session sharing shareMATLABSession() lets the agent attach to an existing MATLAB session instead of spawning a new one. Run once in the MATLAB command window; subsequent calls reuse that session.
Cross‑product support A companion Simulink Agentic Toolkit exists; both can be installed together. Enables agents to work with Simulink models as well as MATLAB code.

Getting Started (step‑by‑step)

  1. Download the installer – agenticToolkitInstaller.mltbx from the latest release.
  2. Open in MATLAB – Installs the MATLAB Agentic Toolkit add‑on.
  3. Run the setup command:
    setupAgenticToolkit("install")
    
  4. Select skill groups – Choose only the ones you need (e.g., MATLAB Core + Deep Learning Toolbox).
  5. Share the session (optional) – In the MATLAB command window run shareMATLABSession() so the LLM works in the same session you’re using.
  6. Test – Ask the connected agent something like:
    What version of MATLAB is running? List the installed toolboxes.
    
    The agent should reply using the detect_matlab_toolboxes tool.

Who is it for?

  • MATLAB users who want to augment their workflow with AI coding assistants.
  • Teams deploying LLM‑based code‑generation pipelines that need to stay within MathWorks licensing.
  • Researchers building custom agents that need reliable access to MATLAB’s extensive toolbox ecosystem.

Limitations & Considerations

  • Requires MATLAB R2021a+ and a supported LLM agent that can talk to MCP servers.
  • Licensing – The MCP server may only be used by a single MATLAB license; sharing across users is prohibited without a special agreement.
  • Security – Calls made by the agent should be reviewed; the README stresses a human‑in‑the‑loop for important actions.
  • No direct code contributions – Pull requests are disabled; feedback is collected via GitHub issues or MathWorks support.

Where to Find More

  • Configuration & troubleshooting – Configuration_and_Troubleshooting.md (offline install, manual setup, data‑collection opt‑out, etc.).
  • Skill catalog – skills-catalog/ directory lists every skill group and the toolboxes it covers.
  • MCP Server repo – https://github.com/matlab/matlab-mcp-server for deeper protocol details.

TL;DR

The MATLAB Agentic Toolkit is a real, production‑grade bridge that lets LLM coding assistants safely and efficiently work with MATLAB by providing a local MCP server, a rich set of toolbox‑aware skills, and execution tools. It’s aimed at MATLAB users who want AI‑assisted coding without the typical hallucination problems.

Related

  • Project
  • Project
  • Project
  • Project
  • Project