MATLAB MCP Server
Click on "Install Server".
Wait a few minutes for the server to deploy. Once ready, it will show a "Started" state.
In the chat, type
@followed by the MCP server name and your instructions, e.g., "@MATLAB MCP Serverplot sin(x) from 0 to 2*pi and label the axes"
That's it! The server will respond to your query, and you can continue using it as needed.
Here is a step-by-step guide with screenshots.
MATLAB MCP Integration
This is an implementation of a Model Context Protocol (MCP) server for MATLAB. It allows MCP clients (like LLM agents or Claude Desktop) to interact with a shared MATLAB session using the MATLAB Engine API for Python.
Features
Execute MATLAB Code: Run arbitrary MATLAB code snippets via the
runMatlabCodetool.Retrieve Variables: Get the value of variables from the MATLAB workspace using the
getVariabletool.Structured Communication: Tools return results and errors as structured JSON for easier programmatic use by clients.
Non-Blocking Execution: MATLAB engine calls are run asynchronously using
asyncio.to_threadto prevent blocking the server.Standard Logging: Uses Python's standard
loggingmodule, outputting tostderrfor visibility in client logs.Shared Session: Connects to an existing shared MATLAB session.
MatlabMCP wikipedia by DEVIN. CheckoutDeepWiki for more detailed and illustrative information about architecture.
Related MCP server: MATLAB MCP Server
Requirements
Python 3.12 or higher
MATLAB (R2023a or higher recommended - check MATLAB Engine API for Python compatibility) with the MATLAB Engine API for Python installed.
numpyPython package.
Installation
Clone this repository:
git clone https://github.com/jigarbhoye04/MatlabMCP.git cd MatlabMCPSet up a Python virtual environment (recommended):
# Install uv if you haven't already: https://github.com/astral-sh/uv uv init uv venv source .venv/bin/activate # On Windows use: .venv\Scripts\activateInstall dependencies:
uv pip syncEnsure MATLAB is installed and the MATLAB Engine API for Python is configured for your Python environment. See MATLAB Documentation.
Start MATLAB and share its engine: Run the following command in the MATLAB Command Window:
matlab.engine.shareEngineYou can verify it's shared by running
matlab.engine.isEngineSharedin MATLAB (it should returntrueor1). The MCP server needs this shared engine to connect.
Configuration (for Claude Desktop)
To use this server with Claude Desktop:
Go to Claude Desktop -> Settings -> Developer -> Edit Config.
This will open
claude_desktop_config.json. Add or modify themcpServerssection to include theMatlabMCPconfiguration:{ "mcpServers": { "MatlabMCP": { "command": "C:\\Users\\username\\.local\\bin\\uv.exe", // Path to your uv executable "args": [ "--directory", "C:\\Users\\username\\Desktop\\MatlabMCP\\", // ABSOLUTE path to the cloned repository directory "run", "main.py" ] // Optional: Add environment variables if needed // "env": { // "MY_VAR": "value" // } } // Add other MCP servers here if you have them } }IMPORTANT: Replace
C:\\Users\\username\\...paths with the correct absolute paths for your system.Save the file and restart Claude Desktop.
Logging: Server logs (from Python's
loggingmodule) will appear in Claude Desktop's MCP log files (accessible viatail -f ~/Library/Logs/Claude/mcp-server-MatlabMCP.logon macOS or checking%APPDATA%\Claude\logs\on Windows).
Development
Project Structure:
MatlabMCP/
├── .venv/ # Virtual environment created by uv
├── Docs/
│ └── Images/
│ └── Updates.md # Documentation for updates and changes
├── main.py # The MCP server script
├── pyproject.toml # Project metadata and dependencies
├── README.md # This file
└── uv.lock # Lock file for dependenciesDocumentation
Check out Updates for detailed documentation on the server's features, usage, and development notes.
Contributing
Contributions are welcome! If you have any suggestions or improvements, feel free to open an issue or submit a pull request.
Let's make this even better together!
This server cannot be installed
Maintenance
Resources
Unclaimed servers have limited discoverability.
Looking for Admin?
If you are the server author, to access and configure the admin panel.
Related MCP Servers
- Flicense-qualityDmaintenanceAllows interaction with MATLAB by creating and executing scripts and functions through Claude or other MCP clients, supporting script management and execution result retrieval with environment configuration capabilities.Last updated39
- AlicenseBqualityFmaintenanceIntegrates MATLAB with AI to execute code, generate scripts from natural language, and access MATLAB documentation seamlessly.Last updated255Apache 2.0
- Alicense-qualityDmaintenanceEnables interactive MATLAB development by allowing users to execute scripts and specific code sections, manage workspace variables, and capture generated plots. It integrates with the MATLAB Python Engine to provide persistent execution context for MCP-compatible clients.Last updated18BSD 3-Clause
- AlicenseAqualityBmaintenanceMCP server that connects any AI agent to MATLAB — execute code, async jobs, interactive Plotly plots, custom tools, and monitoring dashboardLast updated205MIT
Related MCP Connectors
Persistent memory and cross-session learning for AI coding assistants (hosted remote MCP).
Hosted Amazon Seller Central and Amazon Ads MCP server for Claude, ChatGPT, Cursor, and agents.
Cross-agent artifact workspace with provenance across Claude Code, Codex, Cursor, LangGraph.
Latest Blog Posts
- Who's Calling? MCP Hosts Are an Identity Blind Spot (And the Spec Knows It)By Om-Shree-0709 on .mcpAgent IdentityOAuth 2.1
- Your AI Chatbot Just Exposed Your CEO's Salary to an InternBy Om-Shree-0709 on .Agent IdentityMCP SecurityOAuth Delegation
- Why MCP Servers Need Execution Sandboxing (And Why Your Current Stack Isn't Enough)By Om-Shree-0709 on .Agentic AiPrompt InjectionWebAssembly
MCP directory API
We provide all the information about MCP servers via our MCP API.
curl -X GET 'https://glama.ai/api/mcp/v1/servers/jigarbhoye04/MatlabMCP'
If you have feedback or need assistance with the MCP directory API, please join our Discord server