
jigarbhoye04/matlabmcp
Developer tools이 페이지는 AI로 자동 번역되었습니다. 기술적인 세부 사항은 원문을 확인하세요. 원문 보기
MCP 서버는 Matlab Engine API를 통해 LLM에서 MATLAB 코드를 실행합니다.
개요
MATLAB의 Model Context Protocol (MCP) 서버의 구현입니다. 그것은 MCP 클라이언트 (LLM 에이전트 또는 Claude Desktop과 같은) 파이썬을위한 MATLAB 엔진 API를 사용하여 공유 MATLAB 세션과 상호 작용 할 수 있습니다. * RunMatlabCode 도구를 통해 arbitrary MATLAB 코드 스니펫을 실행하십시오. * getVariable 도구를 사용하여 MATLAB workspace에서 변수의 값을 가져옵니다. * 도구 반환 결과 및 오류는 클라이언트가 쉽게 프로그래밍 가능한 사용에 대한 JSON 구조화. * MATLAB 엔진 통화는 asyncio.to thread를 사용하여 서버 차단을 방지합니다. * Python의 표준 로깅 모듈을 사용하여 클라이언트 로그의 가시성을 위해 stderr로 출력합니다. * 기존 공유 MATLAB 세션에 연결합니다. DEVIN에 의해 MatlabMCP wikipedia. Checkout DeepWiki는 건축에 대한 자세한 설명과 정보를 제공합니다. * Python 3.12 이상 * MATLAB ( - Python 호환성을 위한 MATLAB Engine API를 체크) Python용 MATLAB Engine API를 설치했습니다. * numpy 파이썬 패키지. 2. 명세.
개요(AI 번역)
MATLAB의 Model Context Protocol (MCP) 서버의 구현입니다. 그것은 MCP 클라이언트 (LLM 에이전트 또는 Claude Desktop과 같은) 파이썬을위한 MATLAB 엔진 API를 사용하여 공유 MATLAB 세션과 상호 작용 할 수 있습니다.
특징
*Execute MATLAB Code: runMatlabCode] 도구를 통해 arbitrary MATLAB 코드 스니펫을 실행합니다.
*Retrieve 변수: getVariable] 도구를 사용하여 MATLAB workspace에서 변수의 값을 가져옵니다.
- **Structured 커뮤니케이션: ** 도구 반환 결과 및 오류는 클라이언트에 의해 더 쉬운 programmatic 사용에 대한 JSON 구조화.
- Non-Blocking Execution: MATLAB 엔진 호출은 서버 차단을 방지하기 위해
asyncio.to_thread]를 사용하여 비동기적으로 실행됩니다. - Standard Logging: Python의 표준
logging] 모듈을 사용하여 클라이언트 로그에 가시성을 위해stderr로 출력합니다. - ** 공유 세션: ** 기존 공유 MATLAB 세션에 연결.
[!팁] DEVIN의 MatlabMCP wikipedia. Checkout DeepWiki는 건축에 대한 자세한 설명과 정보를 제공합니다.
요구 사항
- Python 3.12 이상
- MATLAB (R2023a 이상 권장 - Python용 MATLAB Engine API를 Python용 MATLAB Engine API를 설치했습니다.
이 페이지는 AI로 자동 번역되었습니다. 기술적인 세부 사항은 원문을 확인하세요.
README
원문 README의 일부입니다. 원문 보기.
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.
[!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 MatlabMCP -
Set 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\activate -
Install dependencies:
uv pip sync -
Ensure 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" ]
설치
This server does not publish a one-line install command.
Open the repository installation guide MCP 초보자라면? mcpskill.org 가이드부터 시작하세요 →설정
{
"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
}
}