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.4.tar.gz (5.8 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.4-py3-none-any.whl (6.8 kB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: matlab_mcp-0.1.4.tar.gz
  • Upload date:
  • Size: 5.8 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.4.tar.gz
Algorithm Hash digest
SHA256 40d155c216aa7300ffd95964a1a0de82208d9fef011aafe2c4f303ce5377d11b
MD5 0cf2a3bf44b9d4f9c52a7b408eb82fac
BLAKE2b-256 ab1f9743f2f964e8286a23e683aa829525e52f1b87e7fee95471fbb98ce95069

See more details on using hashes here.

File details

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

File metadata

  • Download URL: matlab_mcp-0.1.4-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.4-py3-none-any.whl
Algorithm Hash digest
SHA256 5e2cd9b56cbac66f1daae52f3df4a679b68b0b320b2a4e083e475c892df7c5c2
MD5 d852af26c15b1576363eddab6fe18052
BLAKE2b-256 302b36366be71c09996c058c662d811b6c65fe8e8186ae899f24912337317ae7

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