Skip to main content

MATLAB MCP Server - A Model Context Protocol server for MATLAB integration (requires Python 3.11+)

Project description

MATLAB MCP Server

A Model Context Protocol (MCP) server that provides AI assistants with the ability to execute MATLAB code, create scripts and functions, and interact with MATLAB's computational environment.

Features

  • 🔧 Create and execute MATLAB scripts and functions
  • 📊 Capture MATLAB figures and visualizations
  • 📝 Open MATLAB editor for script editing
  • 🔍 Access workspace variables and outputs
  • 🚀 Seamless integration with AI assistants via MCP

Installation

Using uvx (Recommended)

uvx matlab-mcp

Using pip

pip install matlab-mcp

Prerequisites

  • MATLAB installation (R2024a or later recommended)
  • Python 3.11 or later
  • MATLAB Engine for Python (automatically installed if missing)

Configuration

Claude Desktop

Add the following to your Claude Desktop config file:

{
    "mcpServers": {
        "matlab": {
            "command": "uvx",
            "args": ["matlab-mcp"],
            "env": {
                "MATLAB_PATH": "/path/to/your/matlab/installation"
            }
        }
    }
}

Environment Variables

Set the MATLAB_PATH environment variable to your MATLAB installation directory:

  • Windows: C:\Program Files\MATLAB\R2024a
  • macOS: /Applications/MATLAB_R2024a.app
  • Linux: /usr/local/MATLAB/R2024a

Available Tools

  • create_matlab_script(script_name, code) - Create a new MATLAB script
  • create_matlab_function(function_name, code) - Create a new MATLAB function
  • execute_matlab_script(script_name, args) - Execute a MATLAB script
  • call_matlab_function(function_name, args) - Call a MATLAB function
  • open_matlab_editor(script_name) - Open MATLAB editor for a script

Example Usage

Ask your AI assistant to:

  • "Create a MATLAB script that plots a sine wave"
  • "Execute the MATLAB script with custom parameters"
  • "Create a function to calculate the mean of an array"
  • "Open the MATLAB editor to review the script"

License

MIT License - see LICENSE file for details.

Contributing

Contributions are welcome! Please feel free to submit a Pull Request.

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

matlab_mcp-0.1.1.tar.gz (5.7 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

matlab_mcp-0.1.1-py3-none-any.whl (6.8 kB view details)

Uploaded Python 3

File details

Details for the file matlab_mcp-0.1.1.tar.gz.

File metadata

  • Download URL: matlab_mcp-0.1.1.tar.gz
  • Upload date:
  • Size: 5.7 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.11.9

File hashes

Hashes for matlab_mcp-0.1.1.tar.gz
Algorithm Hash digest
SHA256 b5ba44d13bf2a31ba11f52531c912a9864cfad4f03064975931005dcd55ac9d4
MD5 3d167a26dea99dbcb72a594306d59525
BLAKE2b-256 9753bc82591ec69ee5490e165a609a4c435bfff4ad6753c34732c2b1d9c013f3

See more details on using hashes here.

File details

Details for the file matlab_mcp-0.1.1-py3-none-any.whl.

File metadata

  • Download URL: matlab_mcp-0.1.1-py3-none-any.whl
  • Upload date:
  • Size: 6.8 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.11.9

File hashes

Hashes for matlab_mcp-0.1.1-py3-none-any.whl
Algorithm Hash digest
SHA256 c11a75763fcb8345fc302cb0cadda8655f7abf14ce74bef5995e4cd52b9ad133
MD5 a535fdc89035161de850be90693e6cd5
BLAKE2b-256 0ce81cdac3e6d493fa51a483d053716429fb1f5c6951245dba595e296af90853

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page