Slash commands for MATLAB development workflows across multiple AI coding agents. Provides documentation generation, testing, optimization, code analysis, and live execution via MCP.
| Agent | Format | Commands | Install |
|---|---|---|---|
| Claude Code | Plugin | All 13 | /plugin install github:matlab/slash-commands |
| GitHub Copilot | .prompt.md |
6 key commands | Copy copilot/prompts/ to .github/prompts/ |
| Cursor IDE | .mdc rules |
Rules (always-on) | Copy cursor/rules/ to .cursor/rules/ |
| Any MCP agent | MCP server | Via MATLAB MCP Core Server | See MCP Guide |
When the MATLAB MCP Core Server is connected, commands gain live capabilities:
| MCP Tool | What It Enables |
|---|---|
check_matlab_code |
Real Code Analyzer diagnostics |
evaluate_matlab_code |
Execute MATLAB expressions, benchmark code |
run_matlab_file |
Run .m files and return output |
run_matlab_test_file |
Execute test suites and report results |
detect_matlab_toolboxes |
List installed toolboxes |
All commands work without MCP. They generate code and instructions as before. MCP adds validation, execution, and measurement. See MCP Integration Guide.
/plugin install github:matlab/slash-commandscp -r copilot/prompts/ .github/prompts/mkdir -p .cursor/rules
cp cursor/rules/matlab-development.mdc .cursor/rules/git clone https://github.com/matlab/slash-commands.git| Command | Description | MCP Enhanced |
|---|---|---|
/matlab-readme |
Generate project README | Yes |
/matlab-docs |
Document MATLAB functions | Yes |
/matlab-livescript |
Create formatted Live Scripts | Yes |
/matlab-check |
Run Code Analyzer on code | MCP |
/matlab-run |
Execute MATLAB code or files | MCP |
| Command | Description | MCP Enhanced |
|---|---|---|
/matlab-test |
Generate unit tests | Yes |
/matlab-property-test |
Create property-based tests | Yes |
/matlab-run-tests |
Run test suite and report results | MCP |
| Command | Description | MCP Enhanced |
|---|---|---|
/matlab-optimize |
Optimize code performance | Yes |
/matlab-errors |
Add error handling and validation | Yes |
| Command | Description | MCP Enhanced |
|---|---|---|
/matlab-explain |
Explain code functionality | Yes |
/matlab-refine |
Refine requirements into specs | Yes |
/matlab-toolboxes |
Detect installed toolboxes | MCP |
MCP Enhanced = works without MCP but gains live capabilities with it MCP = primarily designed for MCP, with static fallback
/matlab-test myFunction # Generate tests
/matlab-run-tests # Run them via MCP, see pass/fail
/matlab-optimize # Optimizes and benchmarks before/after
/matlab-refine "process sensor data" # Clarify requirements
/matlab-test processData # Generate tests
/matlab-check processData.m # Run Code Analyzer
/matlab-optimize # Optimize performance
/matlab-errors # Add error handling
/matlab-docs processData # Generate documentation
/matlab-readme # Generate project README
- Command Reference: Reference for all 13 commands
- MCP Integration Guide: Setup and usage with MATLAB MCP Core Server
- Cross-Agent Support: Using commands with Copilot, Cursor, etc.
- Usage Guide: Development patterns and best practices
- Installation Guide: Setup instructions for all agents
- Examples: Complete workflow examples
- An AI coding agent (Claude Code, GitHub Copilot, Cursor, or any MCP-compatible agent)
- MATLAB development environment (for running generated code)
- Optional: MATLAB MCP Core Server for live execution
See CONTRIBUTING.md for guidelines on adding commands, improving existing ones, and maintaining cross-agent formats.
BSD 3-Clause License. See LICENSE.
Copyright (c) 2025, The MathWorks, Inc.
- matlab/matlab-mcp-core-server: MATLAB MCP server for AI agent integration
- matlab/prompts: MATLAB prompts for AI assistants and copilots
- matlab/skills: Agents Skills for MATLAB