MatlabMCP
БесплатноНе проверенMCP server to run MATLAB code from LLM via the Matlab Engine API.
Описание
MCP server to run MATLAB code from LLM via the Matlab Engine API.
README
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.
[!TIP] MatlabMCP wikipedia by DEVIN. Checkout DeepWiki for more detailed and illustrative information about architecture.
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 dependencies
Documentation
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!
Установка MatlabMCP
У этого сервера нет опубликованного пакета — он собирается из исходников. Открой репозиторий и следуй инструкции в README.
▸ github.com/jigarbhoye04/MatlabMCPFAQ
MatlabMCP MCP бесплатный?
Да, MatlabMCP MCP бесплатный — установка в пару кликов через Unyly без оплаты.
Нужен ли API-ключ для MatlabMCP?
Нет, MatlabMCP работает без API-ключей и переменных окружения.
MatlabMCP — hosted или self-hosted?
Self-hosted: сервер запускается локально на твоей машине командой из раздела установки.
Как установить MatlabMCP в Claude Desktop, Claude Code или Cursor?
Открой MatlabMCP на unyly.org, выбери вкладку своего клиента (Claude Desktop, Claude Code, Cursor) и нажми Install — конфиг сгенерируется автоматически, без правки JSON.
Похожие MCP
GitHub
PRs, issues, code search, CI status
автор: GitHubFilesystem
Secure file operations with configurable access controls.
Memory
Knowledge graph-based persistent memory system.
Template MCP Server
A CLI tool to create a new Model Context Protocol server project with TypeScript support, dual transport options, and an extensible structure
автор: mcpdotdirectCompare MatlabMCP with
Не уверен что выбрать?
Найди свой стек за 60 секунд
Автор?
Embed-бейдж для README
Похожее
Все в категории development
