MatlabMCP
If you are the rightful owner of MatlabMCP and would like to certify it and/or have it hosted online, please leave a comment on the right or send an email to henry@mcphub.com.
This is an implementation of a Model Context Protocol (MCP) server for MATLAB, enabling interaction with MATLAB sessions via the MATLAB Engine API for Python.
The MATLAB MCP Integration server allows MCP clients, such as LLM agents or Claude Desktop, to interact with a shared MATLAB session. It leverages the MATLAB Engine API for Python to execute MATLAB code, retrieve variables, and manage communication in a structured format. The server supports asynchronous execution to prevent blocking and uses standard logging for visibility. It connects to an existing shared MATLAB session, facilitating seamless integration with MATLAB's computational capabilities.
Features
- Execute MATLAB Code: Run arbitrary MATLAB code snippets via the `runMatlabCode` tool.
- Retrieve Variables: Get the value of variables from the MATLAB workspace using the `getVariable` tool.
- 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_thread` to prevent blocking the server.
- Standard Logging: Uses Python's standard `logging` module, outputting to `stderr` for visibility in client logs.