matlab-simulink-mcp 0.1.0__py3-none-any.whl → 0.1.1__py3-none-any.whl
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- matlab_simulink_mcp-0.1.1.dist-info/METADATA +95 -0
- {matlab_simulink_mcp-0.1.0.dist-info → matlab_simulink_mcp-0.1.1.dist-info}/RECORD +6 -5
- matlab_simulink_mcp-0.1.1.dist-info/licenses/LICENSE +21 -0
- matlab_simulink_mcp-0.1.0.dist-info/METADATA +0 -169
- {matlab_simulink_mcp-0.1.0.dist-info → matlab_simulink_mcp-0.1.1.dist-info}/WHEEL +0 -0
- {matlab_simulink_mcp-0.1.0.dist-info → matlab_simulink_mcp-0.1.1.dist-info}/entry_points.txt +0 -0
- {matlab_simulink_mcp-0.1.0.dist-info → matlab_simulink_mcp-0.1.1.dist-info}/top_level.txt +0 -0
@@ -0,0 +1,95 @@
|
|
1
|
+
Metadata-Version: 2.4
|
2
|
+
Name: matlab-simulink-mcp
|
3
|
+
Version: 0.1.1
|
4
|
+
Summary: An MCP server for allowing LLMs to interact with MATLAB and Simulink
|
5
|
+
Author: Rohail
|
6
|
+
License: MIT
|
7
|
+
Classifier: Development Status :: 3 - Alpha
|
8
|
+
Classifier: Intended Audience :: Developers
|
9
|
+
Classifier: License :: OSI Approved :: MIT License
|
10
|
+
Classifier: Programming Language :: Python :: 3
|
11
|
+
Classifier: Programming Language :: Python :: 3.10
|
12
|
+
Classifier: Programming Language :: Python :: 3.11
|
13
|
+
Classifier: Programming Language :: Python :: 3.12
|
14
|
+
Classifier: Topic :: Scientific/Engineering
|
15
|
+
Classifier: Topic :: Software Development :: Libraries :: Python Modules
|
16
|
+
Requires-Python: <3.13,>=3.10
|
17
|
+
Description-Content-Type: text/markdown
|
18
|
+
License-File: LICENSE
|
19
|
+
Requires-Dist: fastmcp>=2.12.2
|
20
|
+
Requires-Dist: platformdirs>=4.4.0
|
21
|
+
Dynamic: license-file
|
22
|
+
|
23
|
+
# MATLAB Simulink MCP Server
|
24
|
+
|
25
|
+
This Model Context Protocol (MCP) server allows MCP clients (such as Claude Desktop or other LLM-based agents) to interact with **MATLAB** and **Simulink** in real time. It runs locally, is built on top of the [FastMCP 2.0](https://gofastmcp.com/getting-started/welcome) library, and uses MATLAB Engine for Python API to communicate with MATLAB and Simulink.
|
26
|
+
|
27
|
+
## Features
|
28
|
+
|
29
|
+
- Read, write, and run MATLAB code and scripts
|
30
|
+
- Parse and interact with Simulink files
|
31
|
+
- Access MATLAB workspace variables and outputs (including visualizations)
|
32
|
+
- Basic safety layer to prevent execution of unsafe commands (configurable)
|
33
|
+
- Non-blocking execution (async MATLAB engine calls)
|
34
|
+
- Automatic installation of MATLAB Engine package if unavailable
|
35
|
+
|
36
|
+
## Requirements
|
37
|
+
|
38
|
+
- **MATLAB** R2022b or later
|
39
|
+
- **Python** 3.10–3.12 (check MATLAB's [supported versions](https://www.mathworks.com/support/requirements/python-compatibility.html))
|
40
|
+
|
41
|
+
## Installation
|
42
|
+
|
43
|
+
1. Install using:
|
44
|
+
|
45
|
+
```bash
|
46
|
+
uv pip install matlab-simulink-mcp
|
47
|
+
# or
|
48
|
+
pip install matlab-simulink-mcp
|
49
|
+
```
|
50
|
+
|
51
|
+
2. On the first run, if the MATLAB Engine is not installed, the server will open a console window and guide you through installation.
|
52
|
+
|
53
|
+
- This requires admin permission and the server will request for it.
|
54
|
+
- If you prefer to install manually, install a [matching PyPi version](https://pypi.org/project/matlabengine/#history) or from your [MATLAB installation](https://www.mathworks.com/help/matlab/matlab_external/install-the-matlab-engine-for-python.html).
|
55
|
+
|
56
|
+
## Configuration (Claude Desktop)
|
57
|
+
|
58
|
+
1. Install [Claude Desktop](https://claude.ai/download).
|
59
|
+
|
60
|
+
2. Open Settings → Developer → Edit Config.
|
61
|
+
|
62
|
+
3. In the `claude_desktop_config.json`, add or update:
|
63
|
+
|
64
|
+
```json
|
65
|
+
{
|
66
|
+
"mcpServers": {
|
67
|
+
"MATLAB_Simulink_MCP": {
|
68
|
+
"command": "absolute-path-to/.venv/Scripts/python.exe", // absolute path to your venv/global environment executable
|
69
|
+
"args": ["-m", "matlab_simulink_mcp"]
|
70
|
+
}
|
71
|
+
}
|
72
|
+
}
|
73
|
+
```
|
74
|
+
|
75
|
+
On macOS/Linux, use `absolute-path-to/.venv/bin/python` in `command`.
|
76
|
+
|
77
|
+
**Note**: Only use `/` or `\\` in the paths, not `\`.
|
78
|
+
|
79
|
+
4. Save and restart Claude Desktop. (Ensure it is fully closed in Task Manager/Activity Monitor.)
|
80
|
+
|
81
|
+
5. On first launch, the server may open multiple consoles to install MATLAB Engine. Interact with one, complete installation, then restart Claude if needed.
|
82
|
+
|
83
|
+
6. Check running status in Settings → Developer, or click the equalizer button in Claude's chat box.
|
84
|
+
|
85
|
+
7. The server logs outputs and errors to both Claude's and its own log file. To keep a log file tracking console open, add `--console` in Claude config args.
|
86
|
+
|
87
|
+
- Claude MCP logs (Windows): `%APPDATA%\Claude\logs\mcp-server-MatlabMCP.log`
|
88
|
+
- Claude MCP logs (macOS): `~/Library/Logs/Claude/mcp-server-MatlabMCP.log`
|
89
|
+
- Server logs: written to your user log directory (or configured via `.env`).
|
90
|
+
|
91
|
+
## Debugging
|
92
|
+
|
93
|
+
FastMCP 2.0 includes an MCP Inspector for manual testing without an LLM client. It launches a UI to send dummy requests directly to the server.
|
94
|
+
|
95
|
+
To use it, import `mcp` from `matlab_simulink_mcp.server` into a script and run the script using `fastmcp dev script_name.py`
|
@@ -12,8 +12,9 @@ matlab_simulink_mcp/installer/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5N
|
|
12
12
|
matlab_simulink_mcp/installer/installer.py,sha256=0SHMTaqZjSvb9zKx4in67bS5xT4JcnsO2U2vYvmb968,5949
|
13
13
|
matlab_simulink_mcp/installer/launcher.py,sha256=aGuxkXnLcb1OZ4P6rHvXFi8KZsDUZVQlo0rNvjdmFqA,1438
|
14
14
|
matlab_simulink_mcp/installer/win_elevate.py,sha256=LyHHUh4vWmIlIXxrM9tOhQUvVeMxcVdXMzkC3vbGm3A,514
|
15
|
-
matlab_simulink_mcp-0.1.
|
16
|
-
matlab_simulink_mcp-0.1.
|
17
|
-
matlab_simulink_mcp-0.1.
|
18
|
-
matlab_simulink_mcp-0.1.
|
19
|
-
matlab_simulink_mcp-0.1.
|
15
|
+
matlab_simulink_mcp-0.1.1.dist-info/licenses/LICENSE,sha256=qxK38PIeAkpnIu0mX7Re5nGKlHEx1Ez4p_4Yg4-3-Hw,1090
|
16
|
+
matlab_simulink_mcp-0.1.1.dist-info/METADATA,sha256=fA8SHhzZyrCMsgm86TKMcHtMSezn14B9DP-IduVpaUc,4125
|
17
|
+
matlab_simulink_mcp-0.1.1.dist-info/WHEEL,sha256=_zCd3N1l69ArxyTb8rzEoP9TpbYXkqRFSNOD5OuxnTs,91
|
18
|
+
matlab_simulink_mcp-0.1.1.dist-info/entry_points.txt,sha256=0ba8PFlQcaWyAqKXRIVDfDvrifeD5LY60lV7i6ak9oE,74
|
19
|
+
matlab_simulink_mcp-0.1.1.dist-info/top_level.txt,sha256=90gv-RNCWWS7E-JMiqwUf2TjB_B8Zb2B-crAeXaABqU,20
|
20
|
+
matlab_simulink_mcp-0.1.1.dist-info/RECORD,,
|
@@ -0,0 +1,21 @@
|
|
1
|
+
MIT License
|
2
|
+
|
3
|
+
Copyright (c) 2025 Rohail Malik
|
4
|
+
|
5
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
6
|
+
of this software and associated documentation files (the "Software"), to deal
|
7
|
+
in the Software without restriction, including without limitation the rights
|
8
|
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
9
|
+
copies of the Software, and to permit persons to whom the Software is
|
10
|
+
furnished to do so, subject to the following conditions:
|
11
|
+
|
12
|
+
The above copyright notice and this permission notice shall be included in all
|
13
|
+
copies or substantial portions of the Software.
|
14
|
+
|
15
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
16
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
17
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
18
|
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
19
|
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
20
|
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
21
|
+
SOFTWARE.
|
@@ -1,169 +0,0 @@
|
|
1
|
-
Metadata-Version: 2.4
|
2
|
-
Name: matlab-simulink-mcp
|
3
|
-
Version: 0.1.0
|
4
|
-
Summary: An MCP server for allowing LLMs to interact with MATLAB and Simulink
|
5
|
-
Author: Rohail
|
6
|
-
License: MIT
|
7
|
-
Classifier: Programming Language :: Python :: 3
|
8
|
-
Classifier: License :: OSI Approved :: MIT License
|
9
|
-
Classifier: Operating System :: OS Independent
|
10
|
-
Requires-Python: <3.13,>=3.10
|
11
|
-
Description-Content-Type: text/markdown
|
12
|
-
Requires-Dist: fastmcp>=2.12.2
|
13
|
-
Requires-Dist: platformdirs>=4.4.0
|
14
|
-
|
15
|
-
# MATLAB Simulink MCP Server
|
16
|
-
|
17
|
-
[](https://pypi.org/project/matlab-simulink-mcp/)
|
18
|
-
[](https://pypi.org/project/matlab-simulink-mcp/)
|
19
|
-
|
20
|
-
This [Model Context Protocol (MCP)](https://github.com/modelcontextprotocol) server allows MCP clients (such as Claude Desktop or other LLM-based agents) to interact with **MATLAB** and **Simulink** in real time. It runs locally and is built on top of the [FastMCP 2.0](https://gofastmcp.com/getting-started/welcome) library.
|
21
|
-
|
22
|
-
## Features
|
23
|
-
|
24
|
-
- Read, write, and run MATLAB code and scripts
|
25
|
-
- Parse and interact with Simulink files
|
26
|
-
- Access MATLAB workspace variables and outputs (including visualizations)
|
27
|
-
- Basic safety layer to prevent execution of unsafe commands (configurable)
|
28
|
-
- Non-blocking execution (async MATLAB engine calls)
|
29
|
-
- Automatic installation of MATLAB Engine package if unavailable
|
30
|
-
|
31
|
-
## Requirements
|
32
|
-
|
33
|
-
- **MATLAB** R2022b or later
|
34
|
-
- **Python** 3.10–3.12 (check MATLAB's [supported versions](https://www.mathworks.com/support/requirements/python-compatibility.html))
|
35
|
-
|
36
|
-
## Installation
|
37
|
-
|
38
|
-
### Option 1 — Download Binary (MATLAB R2025a only)
|
39
|
-
|
40
|
-
If you don’t want to interact with Python at all, you can download a prebuilt **exe/app** from the [Releases](../../releases) page and run it directly. In that case you can skip the steps below.
|
41
|
-
|
42
|
-
### Option 2 — From Source
|
43
|
-
|
44
|
-
1. Clone the repository:
|
45
|
-
|
46
|
-
```bash
|
47
|
-
git clone https://github.com/rohailamalik/matlab-simulink-mcp
|
48
|
-
cd matlab-simulink-mcp
|
49
|
-
|
50
|
-
2. Create a Python virtual environment (recommended: [uv](https://pypi.org/project/uv/0.1.32/)):
|
51
|
-
|
52
|
-
```bash
|
53
|
-
uv venv --python 3.12 # match Python to your MATLAB-supported version
|
54
|
-
source .venv/Scripts/activate # on macOS/Linux: source .venv/bin/activate
|
55
|
-
uv sync
|
56
|
-
```
|
57
|
-
|
58
|
-
Without uv, first download a Python version manually:
|
59
|
-
|
60
|
-
```bash
|
61
|
-
python3.12 -m venv .venv
|
62
|
-
source .venv/bin/activate
|
63
|
-
pip install -r requirements.txt
|
64
|
-
pip install .
|
65
|
-
```
|
66
|
-
|
67
|
-
3. Alternatively, skip step 1, create virtual environment and install directly via PyPI:
|
68
|
-
|
69
|
-
```bash
|
70
|
-
uv pip install matlab-simulink-mcp
|
71
|
-
# or
|
72
|
-
pip install matlab-simulink-mcp
|
73
|
-
```
|
74
|
-
|
75
|
-
4. On first run, if the MATLAB Engine is not installed, the server will open a console window and guide you through installation.
|
76
|
-
|
77
|
-
- This requires admin permission and the server will request for it.
|
78
|
-
- If you prefer to install manually, install a [matching PyPi version](https://pypi.org/project/matlabengine/#history) or from your [MATLAB installation](https://www.mathworks.com/help/matlab/matlab_external/install-the-matlab-engine-for-python.html).
|
79
|
-
|
80
|
-
## Configuration (Claude Desktop)
|
81
|
-
|
82
|
-
1. Install [Claude Desktop](https://claude.ai/download).
|
83
|
-
|
84
|
-
2. Open Settings → Developer → Edit Config.
|
85
|
-
|
86
|
-
3. In the `claude_desktop_config.json`, add or update:
|
87
|
-
|
88
|
-
```json
|
89
|
-
{
|
90
|
-
"mcpServers": {
|
91
|
-
"MATLAB_Simulink_MCP": {
|
92
|
-
"command": "C:/Data/Research/Doctoral/src/matlab-simulink-mcp/.venv/Scripts/python.exe",
|
93
|
-
"args": ["-m", "matlab_simulink_mcp"]
|
94
|
-
}
|
95
|
-
}
|
96
|
-
}
|
97
|
-
```
|
98
|
-
|
99
|
-
On macOS/Linux, use `absolute-path-to/.venv/bin/python` in `command`.
|
100
|
-
|
101
|
-
If using the standalone exe/app, just put absolute path to it in `command` and omit args.
|
102
|
-
|
103
|
-
**Note**: Only use `/` or `\\` in the paths, not `\`.
|
104
|
-
|
105
|
-
4. Save and restart Claude Desktop. (Ensure it is fully closed in Task Manager/Activity Monitor.)
|
106
|
-
|
107
|
-
5. On first launch, the server may open multiple consoles to install MATLAB Engine. Interact with one, complete installation, then restart Claude if needed.
|
108
|
-
|
109
|
-
6. Check running status in Settings → Developer, or click the equalizer button in the chat box.
|
110
|
-
|
111
|
-
7. The server logs outputs and errors to both Claude's and its own log file. To keep a log file tracking console open, add `--console` in Claude config args.
|
112
|
-
|
113
|
-
- Claude MCP logs (Windows): `%APPDATA%\Claude\logs\mcp-server-MatlabMCP.log`
|
114
|
-
- Claude MCP logs (macOS): `~/Library/Logs/Claude/mcp-server-MatlabMCP.log`
|
115
|
-
- Server logs: written to your user log directory (or configured via `.env`).
|
116
|
-
|
117
|
-
## Debugging
|
118
|
-
|
119
|
-
FastMCP 2.0 includes an MCP Inspector for manual testing without an LLM client. This launches a UI to send dummy requests directly to the server.
|
120
|
-
|
121
|
-
```bash
|
122
|
-
cd scripts
|
123
|
-
fastmcp dev debugger.py
|
124
|
-
```
|
125
|
-
|
126
|
-
## Repository Structure
|
127
|
-
|
128
|
-
```txt
|
129
|
-
|
130
|
-
matlab-simulink-mcp/
|
131
|
-
├─ scripts
|
132
|
-
│ ├─ debugger.py # Entry point for MCP inspector
|
133
|
-
├─ src/matlab_simulink_mcp/
|
134
|
-
│ ├─ data/ # Data files and resources
|
135
|
-
│ ├─ installer/ # MATLAB Engine installer
|
136
|
-
│ │ ├─ installer.py
|
137
|
-
│ │ ├─ launcher.py
|
138
|
-
│ │ └─ win_elevate.py
|
139
|
-
│ ├─ functions.py # Baseline MCP tool functions
|
140
|
-
│ ├─ log_utils.py # Logging utilities
|
141
|
-
│ ├─ security.py # Safety layer for code execution
|
142
|
-
│ ├─ server.py # Main server script
|
143
|
-
│ ├─ state.py # Server lifespan objects (logger, engine)
|
144
|
-
│ ├─ __main__.py # Main entry point
|
145
|
-
├─ .env # Optional config (e.g. LOG_DIR)
|
146
|
-
├─ pyproject.toml # Project metadata and dependencies
|
147
|
-
├─ requirements.txt # Package dependencies for pip
|
148
|
-
├─ uv.lock # Package dependencies for uv
|
149
|
-
└─ README.md # This file
|
150
|
-
|
151
|
-
```
|
152
|
-
|
153
|
-
## FAQ
|
154
|
-
|
155
|
-
Q: Which Python version should I install?
|
156
|
-
|
157
|
-
A: Match it to the highest Python version supported by your MATLAB release (see MathWorks docs).
|
158
|
-
|
159
|
-
Q: The console disappears too quickly!
|
160
|
-
|
161
|
-
A: Add `--console` in your Claude config args to keep the server console open.
|
162
|
-
|
163
|
-
Q: Multiple installer consoles opened on first run.
|
164
|
-
|
165
|
-
A: This is expected if Claude sends multiple startup requests. Complete one installation, then restart Claude Desktop.
|
166
|
-
|
167
|
-
## Contributing
|
168
|
-
|
169
|
-
Pull requests are welcome! Feel free to submit one or open an issue.
|
File without changes
|
{matlab_simulink_mcp-0.1.0.dist-info → matlab_simulink_mcp-0.1.1.dist-info}/entry_points.txt
RENAMED
File without changes
|
File without changes
|