MCP Directory

How to add MATLAB MCP Server to Windsurf

MathWorks' official server that lets agents start MATLAB, write and run code, lint scripts, and execute test files. Paste the config into ~/.codeium/windsurf/mcp_config.json and restart Windsurf.

Last updated June 14, 2026 · 1.1k · stdio · no auth · official

Windsurf config for MATLAB MCP Server

claude mcp add --transport stdio matlab -- /fullpath/to/matlab-mcp-server-binary
{
  "mcpServers": {
    "matlab-mcp-server": {
      "command": "/fullpath/to/matlab-mcp-server-binary",
      "args": []
    }
  }
}

Setup steps

  1. 1Open Windsurf → Cascade → the hammer/MCP icon → Configure (or edit ~/.codeium/windsurf/mcp_config.json).
  2. 2Paste the MATLAB MCP Server config below.
  3. 3Fill in placeholder secrets, then save.
  4. 4Click Refresh in the MCP panel.
  5. 5MATLAB MCP Server's tools become available to Cascade.

Before you start

  • MATLAB R2021a or later installed and on the system PATH (releases from the past five years supported)
  • The matlab-mcp-server binary from GitHub Releases (macOS: curl the arm64/x64 build and chmod +x), or `go install github.com/matlab/matlab-mcp-server/cmd/matlab-mcp-server@latest`
  • For attaching to existing sessions: run `./matlab-mcp-server --setup-matlab` once, then `shareMATLABSession()` in MATLAB (R2023a+)
  • Claude Desktop only: the matlab-mcp-server.mcpb bundle plus Anthropic's Filesystem extension

What MATLAB MCP Server can do in Windsurf

detect_matlab_toolboxes

Report installed MATLAB version and toolboxes.

check_matlab_code

Read-only static analysis of a .m file: style, potential errors, deprecated functions, performance issues.

evaluate_matlab_code

Evaluate a string of MATLAB code in a project directory and return the output.

run_matlab_file

Execute a .m script by absolute path and return the output.

run_matlab_test_file

Run a MATLAB unit-test file and return comprehensive results.

Security

evaluate_matlab_code and run_matlab_file execute arbitrary code in a local MATLAB session with your user's permissions — MathWorks itself says to review every tool call before approving. Anonymized telemetry is on by default (opt out with --disable-telemetry=true), and usage must follow the MathWorks Software License Agreement: the server must not be shared by multiple users.

MATLAB MCP Server + Windsurf FAQ

Where is the Windsurf config file?

Windsurf reads MCP servers from ~/.codeium/windsurf/mcp_config.json. Paste the MATLAB MCP Server config there under the "mcpServers" key and restart the client.

Is MATLAB MCP Server safe to use with Windsurf?

evaluate_matlab_code and run_matlab_file execute arbitrary code in a local MATLAB session with your user's permissions — MathWorks itself says to review every tool call before approving. Anonymized telemetry is on by default (opt out with --disable-telemetry=true), and usage must follow the MathWorks Software License Agreement: the server must not be shared by multiple users.

Is the MATLAB MCP Server free?

The server itself is a free download from MathWorks' GitHub, but it is useless without a licensed MATLAB R2021a+ installation — it launches the real product. MathWorks' license also forbids sharing one server across multiple users, so it is strictly a per-developer tool.

Can it use the MATLAB session I already have open?

Yes — that is the default 'auto' mode's first choice. Install the MATLAB MCP Server Toolbox once with ./matlab-mcp-server --setup-matlab, run shareMATLABSession() in your MATLAB (R2023a or newer), and the server attaches to that session instead of starting a new one.

Does it send my code or data to MathWorks?

Your code runs locally in your MATLAB; what MathWorks collects is fully anonymized usage telemetry, enabled by default. Set --disable-telemetry=true (or the MW_MCP_SERVER_DISABLE_TELEMETRY env var) to opt out.

View repo Full MATLAB MCP Server page