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.0.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.0-py3-none-any.whl (6.8 kB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: matlab_mcp-0.1.0.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.0.tar.gz
Algorithm Hash digest
SHA256 2ece4aab959f4d2198eb2c197de0da4385c368d947ca506cf2a5a8e4d151035a
MD5 de662b1ea30e1b33d3bcc84f9710b11b
BLAKE2b-256 427f3f2c350d34164be30a272c755ba0a6d889d813df8523a2a087b758450028

See more details on using hashes here.

File details

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

File metadata

  • Download URL: matlab_mcp-0.1.0-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.0-py3-none-any.whl
Algorithm Hash digest
SHA256 1a55b0d9a74648057e4740b36eb390cd63bd2aaf75877ae52d4bb78f68d97d5c
MD5 74ca247af9ecbe0742ccbff68492421d
BLAKE2b-256 6bf69792627cf4445261bfcfb729cb4e536402d60546833a9d5ad52517f6788d

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