matlab-mcp-tools MCP Server Integration

matlab-mcp-tools brings MATLAB automation to AI-enhanced workflows, enabling remote script execution, section runs, workspace inspection, and new script creation via MCP clients.

matlab-mcp-tools MCP Server Integration

What does “matlab-mcp-tools” MCP Server do?

The matlab-mcp-tools MCP Server is a Model Context Protocol (MCP) server designed to bridge AI assistants and development environments with MATLAB. It enables executing MATLAB scripts, managing workspace variables, running specific sections of MATLAB files, and creating new scripts directly from MCP-compatible clients such as Cline, Cursor, and others. By providing a set of standardized tools, this server empowers developers to automate, interact with, and streamline MATLAB development workflows, including capturing plots, maintaining context between executions, and leveraging cell-based execution for iterative code development. This integration significantly enhances productivity and enables seamless interoperability between AI-driven workflows and the MATLAB ecosystem.

List of Prompts

No prompt templates were listed in the repository or documentation.

List of Resources

No resources were explicitly described in the repository or documentation.

List of Tools

  • execute_script: Executes MATLAB code or a script file.
  • execute_script_section: Executes a specific section of a MATLAB script, supporting cell mode (%% delimited sections).
  • get_script_sections: Retrieves information about available sections within a MATLAB script.
  • create_matlab_script: Creates a new MATLAB script file.
  • get_workspace: Retrieves variables currently available in the MATLAB workspace.

Use Cases of this MCP Server

  • Automated MATLAB Script Execution: Run entire MATLAB scripts or code snippets programmatically from AI assistants or MCP clients, streamlining repetitive or long-running computations.
  • Section-based Code Exploration: Execute and test specific sections of MATLAB files using cell mode, enabling rapid prototyping and debugging for researchers and engineers.
  • Workspace Management: Inspect and manage MATLAB workspace variables remotely, providing better transparency and control over computational environments.
  • Script Creation Automation: Programmatically generate new MATLAB scripts from templates or AI-generated content, accelerating experiment setup and documentation.
  • Integration with Cline/Cursor: Seamlessly connect MATLAB workflows to popular AI-enhanced editors, improving developer ergonomics and workflow automation.

How to set it up

Windsurf

No specific Windsurf setup instructions found.

Claude

No specific Claude setup instructions found.

Cursor

  1. Ensure Python 3.10+, MATLAB with Python Engine, and uv package manager are installed.
  2. Clone the repository and install dependencies:
    git clone https://github.com/neuromechanist/matlab-mcp-tools
    cd matlab-mcp-tools
    ./setup-matlab-mcp.sh
    
  3. Set MATLAB_PATH environment variable if MATLAB is not in the default location.
  4. Copy the provided configuration file:
    cp mcp-config.json ~/.cursor/mcp.json
    
  5. Start the server with matlab-mcp-server or directly via the Python module.
  6. Example JSON configuration for Cursor:
    {
      "mcpServers": {
        "matlab": {
          "command": "matlab-mcp-server",
          "args": [],
          "env": {
            "MATLAB_PATH": "${MATLAB_PATH}",
            "PATH": "${MATLAB_PATH}/bin:${PATH}"
          },
          "disabled": false,
          "autoApprove": [
            "list_tools",
            "get_script_sections"
          ]
        }
      }
    }
    

Securing API Keys: Use the env field in your configuration to inject secrets or API keys as environment variables.

Cline

  1. Follow installation steps as for Cursor.
  2. Copy the configuration file to the appropriate directory for Cline (typically ~/.cline/mcp.json or as per documentation).
  3. Use the same JSON configuration as shown for Cursor, adjusting the path as needed.
  4. Start the server and verify in Cline.

Example JSON for env and inputs:

{
  "mcpServers": {
    "matlab": {
      "env": {
        "MATLAB_PATH": "${MATLAB_PATH}",
        "ANOTHER_SECRET": "${MY_SECRET_KEY}"
      },
      "inputs": {
        "someInput": "${SOME_INPUT_VALUE}"
      }
    }
  }
}

(Adjust as needed for your secrets and environment variables.)

How to use this MCP inside flows

Using MCP in FlowHunt

To integrate MCP servers into your FlowHunt workflow, start by adding the MCP component to your flow and connecting it to your AI agent:

FlowHunt MCP flow

Click on the MCP component to open the configuration panel. In the system MCP configuration section, insert your MCP server details using this JSON format:

{
  "matlab": {
    "transport": "streamable_http",
    "url": "https://yourmcpserver.example/pathtothemcp/url"
  }
}

Once configured, the AI agent is now able to use this MCP as a tool with access to all its functions and capabilities. Remember to change "matlab" to your MCP server name and update the URL accordingly.


Overview

SectionAvailabilityDetails/Notes
OverviewMATLAB-focused, workflow automation, MCP integration
List of PromptsNot found in repo
List of ResourcesNot found in repo
List of Toolsexecute_script, execute_script_section, etc.
Securing API KeysUses env in config
Sampling Support (less important in evaluation)Not documented

Based on the information available, matlab-mcp-tools provides solid core functionality for MATLAB integration with clear setup for Cursor and Cline, but lacks documented prompt templates, resource primitives, and sampling/roots support, which limits advanced MCP capabilities. Overall, it’s a focused but not comprehensive MCP server.


MCP Score

Has a LICENSE✅ BSD-3-Clause
Has at least one tool
Number of Forks1
Number of Stars3

Frequently asked questions

What is matlab-mcp-tools?

matlab-mcp-tools is an MCP server that bridges MATLAB with AI assistants and development tools, enabling automated script execution, workspace variable management, section-based code running, and new script creation from compatible clients.

Which tools does matlab-mcp-tools provide?

It provides tools to execute MATLAB scripts, run individual sections (cell mode), retrieve script sections, create new scripts, and inspect the MATLAB workspace remotely.

Which MCP clients are supported?

matlab-mcp-tools is documented to work with Cursor and Cline, and can be integrated wherever MCP protocol is supported, including FlowHunt.

How do I secure environment variables or API keys?

You should use the `env` field in your MCP server configuration to inject secrets and environment variables securely, keeping sensitive data out of your codebase.

Can I run just part of a MATLAB script?

Yes, using the execute_script_section tool, you can run any specific cell (delimited by %% in MATLAB) of your script, ideal for iterative development and debugging.

Is there a license for matlab-mcp-tools?

Yes, matlab-mcp-tools is released under the BSD-3-Clause license.

Supercharge MATLAB with AI and FlowHunt

Connect MATLAB to your favorite AI workflows and automate code execution, debugging, and development directly from FlowHunt or MCP-compatible clients.

Learn more