loading…
Search for a command to run...
loading…
A Model Context Protocol (MCP) server that enables seamless integration between MATLAB and MCP-compatible applications like Claude Code, allowing execution of M
A Model Context Protocol (MCP) server that enables seamless integration between MATLAB and MCP-compatible applications like Claude Code, allowing execution of MATLAB code, workspace management, plotting, and data I/O.
A Model Context Protocol (MCP) server that enables seamless integration between MATLAB and MCP-compatible applications like Claude Code. Execute MATLAB code, manage workspace variables, create plots, handle data I/O, and more - all through a token-efficient MCP interface.
Prerequisites:
uv package manager installed (install uv)Just configure and run - no manual installation needed!
1. Find your MATLAB library path:
# macOS (Apple Silicon)
/Applications/MATLAB_R2025b.app/bin/maca64
# Linux
/usr/local/MATLAB/R2024b/bin/glnxa64
2. Configure Claude Code:
Option A: Using CLI (Recommended)
# macOS (Apple Silicon)
claude mcp add --transport stdio matlab \
--env DYLD_LIBRARY_PATH=/Applications/MATLAB_R2025b.app/bin/maca64 \
-- uvx matlab-mcp-server
# Linux
claude mcp add --transport stdio matlab \
--env LD_LIBRARY_PATH=/usr/local/MATLAB/R2024b/bin/glnxa64 \
-- uvx matlab-mcp-server
This uses local scope by default (private to you, only this project). For other scopes:
--scope project: Share with team (stores in .mcp.json, can be committed to git)--scope user: Available across all your projectsOption B: Manual .mcp.json file
Create .mcp.json in your project root directory:
{
"mcpServers": {
"matlab": {
"command": "uvx",
"args": ["matlab-mcp-server"],
"env": {
"DYLD_LIBRARY_PATH": "/Applications/MATLAB_R2025b.app/bin/maca64"
}
}
}
}
Replace the library path with your actual MATLAB path from step 1.
For Linux, use LD_LIBRARY_PATH instead of DYLD_LIBRARY_PATH.
That's it! When Claude Code starts, uvx will automatically:
matlab-mcp-server from PyPImatlabengine and all dependenciesRun the helper script to auto-detect MATLAB and display the config:
curl -fsSL https://raw.githubusercontent.com/subspace-lab/matlab-mcp-server/main/install-matlab-mcp.sh | bash
The script will:
.mcp.json file (in project root)If you prefer to install manually or the automated installer doesn't work:
# Navigate to your MATLAB Python engine directory
cd /Applications/MATLAB_R20XXx.app/extern/engines/python # macOS
# OR
cd /usr/local/MATLAB/R20XXx/extern/engines/python # Linux
# Install using uv
uv pip install .
Replace R20XXx with your MATLAB version (e.g., R2024a, R2024b, R2025a).
uv pip install matlab-mcp-server
Create .mcp.json in your project root directory:
macOS (Apple Silicon):
{
"mcpServers": {
"matlab": {
"command": "matlab-mcp",
"env": {
"DYLD_LIBRARY_PATH": "/Applications/MATLAB_R20XXx.app/bin/maca64"
}
}
}
}
macOS (Intel):
{
"mcpServers": {
"matlab": {
"command": "matlab-mcp",
"env": {
"DYLD_LIBRARY_PATH": "/Applications/MATLAB_R20XXx.app/bin/maci64"
}
}
}
}
Linux:
{
"mcpServers": {
"matlab": {
"command": "matlab-mcp",
"env": {
"LD_LIBRARY_PATH": "/usr/local/MATLAB/R20XXx/bin/glnxa64"
}
}
}
}
Replace R20XXx with your actual MATLAB version.
Note for Claude Desktop users: If you're using Claude Desktop (the desktop app) instead of Claude Code (CLI), the configuration file is located at:
~/Library/Application Support/Claude/claude_desktop_config.json%APPDATA%\Claude\claude_desktop_config.jsonThe server provides 8 MCP tools for interacting with MATLAB:
execute_matlab - Execute MATLAB code and get resultsworkspace - Manage workspace variables (get, set, list, clear)figure - Save, export, and manage MATLAB figures (PNG, SVG, PDF, etc.)data_io - Import/export data in various formats (CSV, JSON, XLSX, MAT files)env - Get MATLAB version and check installed toolboxesget_help - Access MATLAB documentation and search functionsroute_intent - Suggest appropriate tool mode (meta-tool)select_mode - Enable optional tool groups (meta-tool)For detailed documentation on each tool, see TOOLS.md or MATLAB_MCP_GUIDE.md.
If you get an error about MATLAB engine not being found:
Default MATLAB locations:
/Applications/MATLAB_R20XXx.app/usr/local/MATLAB/R20XXxC:\Program Files\MATLAB\R20XXxIf MATLAB is in a non-standard location, update the library path in your config.
MIT License
Contributions are welcome! Please see CONTRIBUTING.md for development setup and guidelines.
Выполни в терминале:
claude mcp add matlab-mcp-server -- npx Безопасность
Низкий рискАвтоматическая эвристика по публичным данным — не гарантия безопасности.