Simulink Agentic Toolkit

Plugin

MathWorks 官方工具包:通过 MATLAB MCP 服务器让 agent 读取、搭建、修改和测试 Simulink 模型,附带控制系统、Simscape 物理建模、代码生成与合规检查等技能,支持 Claude Code、Codex 等。需要已授权的 MATLAB R2023a 及以上与 Simulink,先在 MATLAB 中运行官方安装器。

matlab/simulink-agentic-toolkit1.4k
README

The Simulink® Agentic Toolkit enables you to use AI agents with Simulink. It gives your AI agent the knowledge and context to read, build, edit, and test Simulink models by using Model-Based Design best practices. It connects agents to Simulink through the MATLAB MCP Server, giving them the ability (tools) and the knowledge (skills) to work with Simulink models effectively. Use this toolkit to provide trusted Simulink capabilities to your agent. This toolkit helps prevent your AI coding agent from hallucinating, missing new features, and wasting time with extra steps that experienced Simulink users skip.

The toolkit provides:

  • MCP tools for reading, editing, querying, testing, and checking Simulink models
  • Agent skills encoding Model-Based Design best practices for model building, simulation, plant specification, testing, requirements, project management, and architecture modeling
  • Support for Claude Code, GitHub Copilot in Visual Studio Code, GitHub Copilot CLI, and OpenAI Codex

To use AI agents with MATLAB, install the MATLAB Agentic Toolkit. The Agentic Toolkit Installer can install both toolkits in one step.

┌───────────┐       ┌───────────┐       ┌──────────┐
│ AI Agent  │◄─MCP─►│MCP Server │◄─────►│ MATLAB / │
│ (Claude,  │       │ (MATLAB   │       │ Simulink │
│  Codex,   │       │ MCP)      │       └──────────┘
│  Copilot) │       └───────────┘
└───────────┘
      ▲
      │ reads
┌─────┴─────┐
│  Skills   │
│ (MBD best │
│ practices)│
└───────────┘

Your agent reads skills for domain knowledge, then calls MCP tools to interact with MATLAB and Simulink. The MATLAB MCP Server bridges the connection.

Requirements

  • MATLAB R2023a or later with Simulink
  • An AI coding agent that supports MCP servers and skills. The installer configures supported agents automatically. To manually configure the MCP server and install skills, see the documentation for your agent. Supported agents include:
  • Simulink Test (optional) — required only for the model_test tool
  • Some skills require additional toolboxes (e.g., System Composer, Simscape, Stateflow). Check the requires-products field in each skill's manifest.yaml under skills-catalog/ for additional requirements.

These steps show you how to install the Simulink Agentic Toolkit and the MATLAB MCP Server and how to add skills to your agent.

To install, update, or uninstall the Simulink Agentic Toolkit and MATLAB MCP Server together, use the Agentic Toolkit Installer. Follow the installation instructions in the repository. The installer downloads the toolkit and MATLAB MCP Server, installs the required MATLAB toolboxes, and configures the MCP server and skills for your agent.

When you use the installer, you do not need to set up the toolkit for each MATLAB session. The toolkit is automatically available on the MATLAB path, and agents can connect to MATLAB automatically. To use an existing MATLAB session and retain its workspace and loaded models, run shareMATLABSession in that session.

Existing users: If you previously set up the toolkit by using setupAgenticToolkit or the earlier agent-driven workflow, the installer detects the previous installation and prompts you to remove it. You no longer need to run satk_initialize. Remove satk_initialize from your startup.m file. For more information, see Migrate from a Previous Installation.

Verify the Installation

To check your installation, run this in MATLAB:

satk_doctor

satk_doctor checks the toolkit's MATLAB tools, the MATLAB path, and MATLAB session sharing. To check installed versions, configured agents, and the MCP server, run agentic-toolkit-installer status in a terminal. Confirm that your agent lists the Simulink Agentic Toolkit skills. For example, in Claude Code, use the /skills command.

Then, open a Simulink model. You can use your own model or open an example model.

openExample('simulink_general/sldemo_househeatExample')

This command opens the shipped example model sldemo_househeat. Ask your agent:

Describe the structure of the currently open model.

For troubleshooting, see Configuration and Troubleshooting.

Library Configuration

Toolbox Libraries

Use satk.Configuration.setToolboxes to activate pre-built knowledge bases for installed MathWorks toolboxes:

satk.Configuration.setToolboxes('all')                                 % Activate all installed toolbox KBs
satk.Configuration.setToolboxes({'Aerospace Blockset', 'Simscape'})    % Activate specific toolboxes by name
satk.Configuration.setToolboxes('none')                                % Deactivate all toolbox KBs
satk.Configuration.setToolboxes('Simscape', Mode="add")                % Keep the active toolbox KBs and add one
satk.Configuration.setToolboxes('Simscape', Mode="remove")             % Deactivate just this toolbox

By default (Mode="replace"), the toolboxes you list become the only active ones.

Custom Libraries

To use your own custom Simulink block libraries with the toolkit, register them in MATLAB once:

satk.Configuration.setCustomLibraries("C:\path\to\customLibs")

This declares your custom libraries. By default (GenerateKB=false), the toolkit does not build the knowledge base immediately. Instead, the agent indexes the libraries into a knowledge base on the next model-building task or when you invoke the setup-custom-libraries skill. Indexing takes about 3–5 minutes and enables the agent to use custom blocks alongside built-in ones.

Each entry is either a folder, which registers every .slx and .mdl file in it, or the path to a single library file. To register more than one entry, pass a string array or a cell array:

% Multiple folders
satk.Configuration.setCustomLibraries(["C:\path\to\motorLibs", "C:\path\to\sensorLibs"])

% Individual library files
satk.Configuration.setCustomLibraries(["C:\libs\motorLib.slx", "C:\libs\sensorLib.slx"])

Each call replaces the full set of registered custom libraries instead of adding to it, so list every library that you want in a single call.

Options

setCustomLibraries accepts the following options:

% Build the knowledge base deterministically from block metadata present in the libraries. 
satk.Configuration.setCustomLibraries("C:\path\to\customLibs", GenerateKB=true)
% Choose where the KB and configuration folder is written.
% Omitted  -> MATLAB prefdir (default): per-user, global, paths stored absolute.
% <dir>    -> an existing directory: library paths on the same drive are
%             stored relative to this root (so the .satk folder can be
%             committed and shared); paths on a different drive are stored
%             absolute.
satk.Configuration.setCustomLibraries("libs", Location="C:\repo\myProject")

When you register custom libraries with a Location, activating toolbox knowledge bases with setToolboxes writes them into that same .satk folder.

If you activate toolbox KBs globally first and later register custom libraries with a Location, the toolkit automatically moves the toolbox KBs alongside the custom libraries.

Knowledge Base

The agent finds blocks through the knowledge base (KB), markdown pages in the OKF format at .satk/library-kg/. The toolkit generates the pages: setToolboxes adds toolbox pages, and setCustomLibraries registers your custom libraries.

Maintaining the Knowledge Base

Maintain the Knowledge Base with satk.Configuration. All methods act on the effective KB; pass Location="global", "project", or a folder to target a specific one.

TaskMethodDescription
ReadlistPagesTable of pages with ID, type, title, description, tags, and status. Filter by folder (Under=), page type (Type=), or tag (Tag=).
getPageReturn one page: its ID, path, frontmatter, and markdown body.
getBacklinksReturn the IDs of the pages that link to a page.
listBlocksTable of blocks with each block's library, category, and description, and whether you set that description yourself. Filter by library (Library=) or category (Category=).
getBlockLook up a block by its display name or ReferenceBlock.
Curate blockssetBlockDescriptionSet a block's description and regenerate its page.
setBlockCategoryMove blocks to a category, creating the category if it is new, and regenerate.
Edit pagesaddPageAdd a page, such as a guide or a new category page. OnExist= sets what happens if the page already exists: "error" (default), "skip", "update" (merge the fields you pass), or "replace" (overwrite the page).
addPagesAdd several pages from a JSON manifest and report a result for each entry. Accepts the same OnExist= option.
updatePageChange a page's frontmatter (status, title, description, tags) or its body.
removePageRemove a page and return the pages that still link to it. A removed generated page stays removed when you regenerate.
renamePageRename a page and rewrite the links to it. Renaming a generated category page also renames the category. A generated page cannot move to another library folder.
MaintainregeneratePagesRegenerate the generated pages from your libraries. Reset=true drops all page edits and brings back removed pages, but keeps the block descriptions and categories you set. Discard="<page id>" resolves a page marked conflict: it backs up your hand edit under .satk/backup/hand-edits/ and takes the generated version.
lintReport broken links, unknown ReferenceBlock values, wrong block counts, blocked blocks that are listed, and edits that conflict with the generated pages. Fix a conflict with regeneratePages(Discard="<page id>").
reindexRebuild every index.md, for example after you copy pages into the KB by hand.
removeCustomLibraryUnregister a library and remove its pages. The block descriptions and categories you set, and your block policy, are kept.
ExportpackZip the KB so you can share it. Relative links keep working.
vizWrite an interactive HTML graph of the links between pages. Opening it needs network access.
  • Descriptions and categories you set are saved in .satk/library-curation.json and survive regeneration.
  • KB write methods accept By= to record who made a change in log.md, for example By="human:alice". The default is process:satk-configuration.
  • A KB created by an earlier release is migrated on the first write call, and the old folder is kept under .satk/backup/.
Checking the Knowledge Base Status
satk.Configuration.getStatus().kg        % page, block, and lint counts

Clearing Configuration

To remove the global (prefdir) library configuration:

satk.Configuration.clearConfig()

To remove a project-local configuration, including its .satk/ folder and any satk-libraries.json file at the project root, run this command. For example, remove the project configuration if it shadows the global configuration and you want the global configuration to take precedence.

satk.Configuration.clearConfig("C:\repo\myProject")

Both forms are destructive and not reversible.

MCP Tools

After you install the Simulink Agentic Toolkit, your agent can use the following tools.

ToolWhat your agent can do
model_overviewExplore model architecture. Review subsystem hierarchy, interfaces, and how major components connect
model_readUnderstand model behavior. Inspect blocks, algorithmic expressions, signal flow, and parameter values
model_editBuild and modify models. Add blocks, wire signals, create subsystems, and configure parameters as needed
model_checkValidate model structure. Detect unconnected ports, dangling lines, and edit-time check issues in states and subcharts
model_read_diagnosticsRead diagnostics. Retrieve errors, warnings, and info messages from the Diagnostic Viewer after compilation, simulation, or code generation
model_testVerify requirements. Run human-readable Gherkin tests with automatic harness generation (requires Simulink Test)
model_query_paramsInspect any parameter. Query block settings, signal properties, solver config, and logging flags
model_resolve_paramsGet actual values. Resolve workspace variables such as Kp to their numeric values across all scopes
model_scanFind something specific, fast. Regex-search the saved .slx file on disk for a block name, parameter value, or string without loading the model

Agent Skills

After you install the Simulink Agentic Toolkit, your agent can use the skills in the following groups. To see lists of available skills, see the skills catalog.

Skill GroupDescription
Model-Based Design CoreCore Model-Based Design (MBD) skills for building, testing, and specifying Simulink models
Model-Based System EngineeringModel-Based System Engineering skills for System Composer architecture models
Verification, Validation, and TestAuthor custom Model Advisor checks, run compliance reviews against industry standards (MISRA, MAB, ISO 26262, DO-178C, etc.), fix SLDV incompatibilities, and explain missing coverage
Simulink SimulationSkills for constructing simulation input datasets and configuring simulation workflows
Simulink ModelingConfigure and integrate C/C++ and Python code into Simulink models via C Function and Python Code blocks
Control SystemsControl system design and analysis skills for Simulink models
Simulink Environment FundamentalsCore Simulink environment capabilities, including discovering shipped example models
Signal ProcessingBuild frame-based streaming DSP models in Simulink by using DSP System Toolbox
Physical ModelingModel, simulate, and analyze multidomain physical systems with the Simscape product family
Code GenerationPrepare Simulink models for production code generation, including single-precision conversion, optimizing generated embedded code, configuring Embedded Coder deployment settings, and customizing A2L calibration files
Real-Time Simulation and TestingConfigure, deploy, and run Simulink models on real-time target computers with Simulink Real-Time
Simulink Block and Blockset AuthoringAuthor the appearance of custom Simulink blocks, such as dynamic SVG block icons
AerospaceAerospace skills for Simulink models using Aerospace Blockset
RF and Mixed-SignalPhysics-based RF system modeling and simulation in Simulink with RF Blockset Circuit Envelope and Idealized Baseband

Security Considerations

When you use the Simulink Agentic Toolkit and MATLAB MCP Server, review and validate all tool calls before you run them. Always keep a human in the loop for important actions, and proceed only when you are confident that the call does what you expect. For more information, see User Interaction Model (MCP) and Security Considerations (MCP).

Licensing and Usage

The license is available in the LICENSE.md file in this GitHub repository.

MCP servers are only permitted to be used with MATLAB and Simulink in accordance with the MathWorks Software License Agreement, and must not be shared by multiple users. Contact MathWorks if you need to support shared or centralized server use.

Research Preview: Agentic Task Explorer

The Agentic Task Explorer provides curated, multi-step tasks that show what agents can do with Simulink — model understanding, creation, editing, testing, bug fixing, and verification. Each task includes Simulink models and supporting files, ready to go.

slAgenticTaskExplorer

Select a task from the interactive UI. The explorer stages it into an isolated workspace with all required files, then opens your coding agent. Each task presents step-by-step prompts — copy each prompt into your coding agent and watch it work.

This is a research preview. Behavior and interfaces might change.


Report Bugs

If you encounter a bug, use the filing-bug-reports skill to generate a report before opening a GitHub issue. Ask your agent:

File a bug report for this issue

The skill automatically captures environment details, reproduction steps, and error output. Run the skill in the same session where the bug occurred, because it uses conversation context to reconstruct what happened. Then open a bug report and paste the generated report.


Support and Contributions

MathWorks encourages you to use this repository and provide feedback. To request technical support or submit an enhancement request, create a GitHub issue or contact technical support. For installation issues, see the Agentic Toolkit Installer repository. For MATLAB MCP Server issues, see the MATLAB MCP Server repository.

This repository does not accept pull requests. See CONTRIBUTING.md for details.

Copyright 2025-2026 The MathWorks, Inc.