home / mcp / matlab mcp server
The MATLAB MCP server provides AI users with powerful scientific computing and data analysis capabilities. It allows users to execute MATLAB code directly in conversations, generate MATLAB scripts from natural language descriptions, and access MATLAB documentation.
Configuration
View docs{
"mcpServers": {
"williamcloudqi-matlab-mcp-server": {
"command": "node",
"args": [
"/path/to/matlab-server/build/index.js"
],
"env": {
"MATLAB_PATH": "/path/to/matlab/executable"
}
}
}
}You can run MATLAB code and generate MATLAB scripts directly through an MCP server that connects MATLAB with AI capabilities. Execute commands, generate executable scripts from natural language, and access MATLAB documentation within your AI conversations to accelerate your work.
Use this MCP server with an MCP client to execute MATLAB commands, run scripts, or generate new MATLAB code from plain language descriptions. You can have the server return results inline in your chat, save generated or executed scripts for later reuse, and access MATLAB documentation as needed.
# Prerequisites
- MATLAB must be installed on your system
- Node.js v14 or higher
# 1. Install the package globally
npm install -g matlab-mcp-server
# 2. Build the server (from source if you cloned it)
npm install
npm run build
# Optional for development with auto-rebuild
npm run watch
```
```json
{
"mcpServers": {
"matlab-server": {
"command": "node",
"args": ["/path/to/matlab-server/build/index.js"],
"env": {
"MATLAB_PATH": "/path/to/matlab/executable"
},
"disabled": false,
"autoApprove": []
}
}
}
```
Replace `/path/to/matlab/executable` with the path to your MATLAB executable. Typical defaults:
- Windows: `C:\Program Files\MATLAB\R2023b\bin\matlab.exe`
- macOS: `/Applications/MATLAB_R2023b.app/bin/matlab`
- Linux: `/usr/local/MATLAB/R2023b/bin/matlab`"}]} ,{On macOS:
~/Library/Application Support/Claude/claude_desktop_config.json
On Windows:
%APPDATA%/Claude/claude_desktop_config.json
```
This enables Claude Desktop to communicate with the MATLAB MCP Server you configured above. The server is then ready to accept and respond to MATLAB-related requests from your AI assistant.Notes and tips for smooth usage: - The server runs as a local stdio process. Keep the path to MATLAB and the server script accurate to avoid startup errors. - You can save generated MATLAB scripts for reuse and reference them in future conversations. - If you need to debug, you can use the MCP Inspector tooling to inspect interactions and outputs.
This MCP server exposes executable MATLAB code execution and code generation tools that you can call from your AI assistant.
Execute MATLAB commands or scripts and return results, with an option to save scripts for future reference.
Generate executable MATLAB code from natural language descriptions, with an option to save the generated scripts.