MatlabSAFE
Model Context Protocol server to let LLMs write and execute matlab scripts
Overview
From the repository's own README, as read at the audited commit. Badges and raw HTML are left out.
This Model Context Protocol (MCP) server provides integration with MATLAB, allowing you to create and execute MATLAB scripts and functions through Claude or other MCP clients.
Setup Requirements
- Python 3.11 (Python 3.13 and 3.12 are not currently supported by MATLAB Engine)
- MATLAB R2024a (or compatible version)
- uv package manager
Installation
- Create and set up the Python environment:
# Pin Python version uv python pin 3.11 # Create virtual environment uv venv # Activate virtual environment source .venv/bin/activate # Install MCP uv add "mcp[cli]"
- Install MATLAB Engine
The MATLAB Engine will be installed automatically when the server first runs, using the MATLAB installation specified in the MATLAB_PATH environment variable.
Directory Structure
matlab_server.py: The main MCP server implementationmatlab_scripts/: Directory where all MATLAB scripts and functions are saved (created automatically)pyproject.toml: Python project configuration.python-version: Specifies Python version for uv
Claude Desktop Integration
- Open your Claude Desktop configuration:
# On macOS code ~/Library/Application\ Support/Claude/claude_desktop_config.json
- Add the MATLAB server configuration:
{
"mcpServers": {
"matlab": {
"command": "uv",
"args": [
"--directory",
"/absolute/path/to/matlab-mcp",
"run",
"matlab_server.py"
],
"env": {
"MATLAB_PATH": "/Applications/MATLAB_R2024a.app"
}
}
}
}Make sure to:
- Replace
/absolute/path/to/matlab-mcpwith the actual path to your project directory - Verify the
MATLAB_PATHpoints to your MATLAB installation - Use absolute paths (not relative)
Features
The server provides several tools:
create_matlab_script: Create a new MATLAB script file- Scripts are saved
6dc7530395b7OBSERVED · 2026-10-08Connect
Built from this server's own package name, version and transport as found in its source — not copied from anyone's documentation, so it cannot drift against a page we do not control.
claude mcp add matlab-mcp -- uvx matlab-mcp
{
"mcpServers": {
"matlab-mcp": {
"command": "uvx",
"args": [
"matlab-mcp"
]
}
}
}Exposed tools (4)
1 read · 3 write · 0 destructive.
| Tool | Risk | Description |
|---|---|---|
call_matlab_function | read | Call a MATLAB function with arguments. |
create_matlab_function | write | Create a new MATLAB function file. |
create_matlab_script | write | Create a new MATLAB script file. |
execute_matlab_script | write | Execute a MATLAB script and return results. |
Trust audit
SAFEgrade B · trust 89/100 Nothing in the source contradicts what it says it does. Grade A is reserved for packages that have also passed the behavioural sandbox.
| Layer | What it checks | Result |
|---|---|---|
| L0 | Provenance & inventory | PASS |
| L1 | Static analysis of the code | PASS |
| L2 | Instruction surface (what it tells the agent) | PASS |
| L3 | Class-specific surface | PASS |
| L4 | Behavioural (sandbox) | SKIPPED |
What the source does
- Filesystem
- declared (4 observation(s))
- Network
- none-observed
- Shell
- none-observed
- Dependencies
- pinned
- Secrets in source
- none-found
Findings (1)
Gates applied: no_behavioural_pass, no_license.
6dc7530395b7full audit observations/trust-audit/mcp-server/tsuchijo__matlab.json · Report an issue / request a re-scanAudit history
Every audit this server has had. A grade with a past is a grade somebody is still checking.
| Date | Source | Verdict | Grade | Score | Change |
|---|---|---|---|---|---|
| 2026-10-08 | 6dc7530395b7 | SAFE | B | 89 | first audit |
Questions
What is the Matlab MCP server?
Model Context Protocol server to let LLMs write and execute matlab scripts
What tools does Matlab expose?
4 in total: 1 read-only, 3 that write, and 0 that can delete or overwrite. Every one is listed on this page with its risk.
Is Matlab safe to connect to an agent?
The audit found nothing in the source that contradicts what it says it does, and graded it B (89/100). Grade A is held back for packages that have also passed a sandboxed behavioural run, which is why a clean server reads B.
What credentials does Matlab need?
No credential environment variables were found in its source, so it appears to need none.
How does Matlab run?
It speaks stdio, so it runs as a local process your client starts. It is published on PyPI as matlab-mcp.
How current is this page?
The grade is for one exact copy of the source (6dc7530395b7), read on 2026-10-08. The repository is watched and re-audited when it changes.