matlab-agentic-toolkit
matlab · matlab/matlab-agentic-toolkit
Provides an MCP server and specialized skills to let AI agents write, run, and debug MATLAB code for engineering and scientific workflows.
The MATLAB Agentic Toolkit brings proven MATLAB capabilities to AI agents, making engineering and scientific workflows agent-ready.
Preview
What you can do with it
- Generate and execute MATLAB scripts for data analysis directly from Claude Code
- Use the MCP server to debug complex engineering simulations and fix toolbox errors
- Equip your agent with specialized skills to avoid hallucinations of MATLAB toolbox functions
Safety check
Usable, but read the notes first.
- ●No clear license: check with the author before using it in a commercial product.
Automated scan of the repo files. Always review code you run.
From the README
MATLAB Agentic Toolkit
English • Español • 日本語 • 한국어 • 简体中文
The MATLAB® Agentic Toolkit allows you to use AI agents with MATLAB by giving your AI agent the knowledge and context to work efficiently with MATLAB and its toolboxes. Use this toolkit to provide proven MATLAB capabilities to your agent. This toolkit can prevent your AI coding agent from hallucinating toolbox functions, missing new features, and wasting time with extra steps that experienced MATLAB users would skip.
Use this toolkit to:
-
Connect your AI agent to MATLAB. This toolkit does this by automatically installing the MATLAB MCP Server. You can then use your agent to write idiomatic code, generate and run tests, diagnose errors, build apps, and more.
-
Provide curated expertise, called skills, to your agent. These skills equip your agent with knowledge of MATLAB workflows, conventions, and best practices while minimizing token burn.
[!Note] To use AI agents efficiently with Simulink®, install Simulink Agentic Toolkit. When you install either toolkit, you can choose to install both toolkits.
Requirements
- MATLAB R2021a or later
- AI coding agent that supports MCP servers and skills. Supported agents are configured automatically. Otherwise, refer to your agent’s documentation to manually configure the MCP server and install skills. Supported agents include:
- Claude Code
- GitHub® Copilot
- OpenAI® Codex
- Gemini™ CLI
- Amp
Get Started with MATLAB Agentic Toolkit
These steps show you how to use the MATLAB Agentic Toolkit to install the MATLAB MCP Server and add skills to your agent.
Note: For instructions on installation from local files, installation in an offline environment, configuration options for this toolkit, platform-specific notes, verification steps, troubleshooting, and manual setup without the installer, see Configuration and Troubleshooting. If you already have the MCP server installed and only need to add skills, see Adding Skills Only.
Install MATLAB Agentic Toolkit from MATLAB
Follow these steps to set up the MATLAB Agentic Toolkit in MATLAB.
- To download the agentic toolkit installer package, click agenticToolkitInstaller.mltbx.
- Open the downloaded file with MATLAB to install the installer add-on.
- In MATLAB, run this command.
setupAgenticToolkit("install")
- Install only the skill groups relevant to your work. This helps your agent reliably trigger the right skills. To add more skill groups later, re-run the installer.
- By default, your agent creates a new MATLAB session when you call it. To connect your agent to the existing MATLAB session, run this command in the MATLAB command window.
shareMATLABSession()
If you are running multiple MATLAB sessions, the agent connects to the MATLAB session where you most recently ran this command.
Alternatively, you can also add this command to your MATLAB Startup Script.
Install MATLAB Agentic Toolkit from Command Line
If you are using Claude Code or OpenAI Codex, you can also set up the MATLAB Agentic Toolkit, Simulink Agentic Toolkit, and MATLAB MCP Server together on an operating system command line using the Agentic Toolkit Installer. For details, see Agentic Toolkit Installer.
Verify
Ask your agent:
What version of MATLAB is running? List the installed toolboxes.
Run and Test MATLAB Code Using MCP Tools
After you install the MATLAB Agentic Toolkit, your agent can use these tools provided by the MATLAB MCP Server.
| Tasks you can ask your agent to do | Tool used by agent |
|---|---|
| Run MATLAB code and return command window output | evaluate_matlab_code |
| Run a MATLAB program | run_matlab_file |
Run tests via runtests with structured results | run_matlab_test_file |
| Static analysis with the Code Analyzer | check_matlab_code |
| List installed MATLAB version and toolboxes | detect_matlab_toolboxes |
The server also provides two MCP resources: matlab_coding_guidelines (coding standards) and plain_text_live_code_guidelines (Live Script format rules). These resources provide reference information that agents can read as needed.
Run MATLAB Workflows Using Agent Skills
After you install the MATLAB Agentic Toolkit, your agent can use MathWorks® curated skills. For best results, install only the skill groups relevant to your work — agents are more reliable at triggering skills when fewer are loaded. You can also manually trigger a specific skill by name (e.g., /matlab-write-tests in Claude Code) to guarantee it loads. To read details about all the skills, see the skills catalog. Skill groups include:
MATLAB Skills
| Skill Group | Description |
|---|---|
| MATLAB Core | Create, debug, review, and manage MATLAB code and installations |
| MATLAB App Building | Build MATLAB apps programmatically using UI components, layouts, callbacks, and web integration |
| MATLAB Data Import and Analysis | Import, export, and analyze data in MATLAB using tables, timetables, filtering, aggregation, and time-series operations |
| MATLAB External Language Interfaces | Call Python® libraries |