matlab-simulink-mcp 0.1.0__tar.gz → 0.1.1__tar.gz

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.
Files changed (29) hide show
  1. matlab_simulink_mcp-0.1.1/LICENSE +21 -0
  2. matlab_simulink_mcp-0.1.1/PKG-INFO +95 -0
  3. {matlab_simulink_mcp-0.1.0 → matlab_simulink_mcp-0.1.1}/README.md +16 -16
  4. matlab_simulink_mcp-0.1.1/README_pypi.md +73 -0
  5. matlab_simulink_mcp-0.1.1/pyproject.toml +49 -0
  6. matlab_simulink_mcp-0.1.1/src/matlab_simulink_mcp.egg-info/PKG-INFO +95 -0
  7. {matlab_simulink_mcp-0.1.0 → matlab_simulink_mcp-0.1.1}/src/matlab_simulink_mcp.egg-info/SOURCES.txt +2 -0
  8. matlab_simulink_mcp-0.1.0/PKG-INFO +0 -169
  9. matlab_simulink_mcp-0.1.0/pyproject.toml +0 -33
  10. matlab_simulink_mcp-0.1.0/src/matlab_simulink_mcp.egg-info/PKG-INFO +0 -169
  11. {matlab_simulink_mcp-0.1.0 → matlab_simulink_mcp-0.1.1}/setup.cfg +0 -0
  12. {matlab_simulink_mcp-0.1.0 → matlab_simulink_mcp-0.1.1}/src/matlab_simulink_mcp/__init__.py +0 -0
  13. {matlab_simulink_mcp-0.1.0 → matlab_simulink_mcp-0.1.1}/src/matlab_simulink_mcp/__main__.py +0 -0
  14. {matlab_simulink_mcp-0.1.0 → matlab_simulink_mcp-0.1.1}/src/matlab_simulink_mcp/data/__init__.py +0 -0
  15. {matlab_simulink_mcp-0.1.0 → matlab_simulink_mcp-0.1.1}/src/matlab_simulink_mcp/data/blacklist.txt +0 -0
  16. {matlab_simulink_mcp-0.1.0 → matlab_simulink_mcp-0.1.1}/src/matlab_simulink_mcp/data/simlib_db.json +0 -0
  17. {matlab_simulink_mcp-0.1.0 → matlab_simulink_mcp-0.1.1}/src/matlab_simulink_mcp/functions.py +0 -0
  18. {matlab_simulink_mcp-0.1.0 → matlab_simulink_mcp-0.1.1}/src/matlab_simulink_mcp/installer/__init__.py +0 -0
  19. {matlab_simulink_mcp-0.1.0 → matlab_simulink_mcp-0.1.1}/src/matlab_simulink_mcp/installer/installer.py +0 -0
  20. {matlab_simulink_mcp-0.1.0 → matlab_simulink_mcp-0.1.1}/src/matlab_simulink_mcp/installer/launcher.py +0 -0
  21. {matlab_simulink_mcp-0.1.0 → matlab_simulink_mcp-0.1.1}/src/matlab_simulink_mcp/installer/win_elevate.py +0 -0
  22. {matlab_simulink_mcp-0.1.0 → matlab_simulink_mcp-0.1.1}/src/matlab_simulink_mcp/log_utils.py +0 -0
  23. {matlab_simulink_mcp-0.1.0 → matlab_simulink_mcp-0.1.1}/src/matlab_simulink_mcp/security.py +0 -0
  24. {matlab_simulink_mcp-0.1.0 → matlab_simulink_mcp-0.1.1}/src/matlab_simulink_mcp/server.py +0 -0
  25. {matlab_simulink_mcp-0.1.0 → matlab_simulink_mcp-0.1.1}/src/matlab_simulink_mcp/state.py +0 -0
  26. {matlab_simulink_mcp-0.1.0 → matlab_simulink_mcp-0.1.1}/src/matlab_simulink_mcp.egg-info/dependency_links.txt +0 -0
  27. {matlab_simulink_mcp-0.1.0 → matlab_simulink_mcp-0.1.1}/src/matlab_simulink_mcp.egg-info/entry_points.txt +0 -0
  28. {matlab_simulink_mcp-0.1.0 → matlab_simulink_mcp-0.1.1}/src/matlab_simulink_mcp.egg-info/requires.txt +0 -0
  29. {matlab_simulink_mcp-0.1.0 → matlab_simulink_mcp-0.1.1}/src/matlab_simulink_mcp.egg-info/top_level.txt +0 -0
@@ -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.
@@ -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`
@@ -3,7 +3,7 @@
3
3
  [![PyPI version](https://img.shields.io/pypi/v/matlab-simulink-mcp.svg)](https://pypi.org/project/matlab-simulink-mcp/)
4
4
  [![Python versions](https://img.shields.io/pypi/pyversions/matlab-simulink-mcp.svg)](https://pypi.org/project/matlab-simulink-mcp/)
5
5
 
6
- 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.
6
+ 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.
7
7
 
8
8
  ## Features
9
9
 
@@ -33,7 +33,7 @@ If you don’t want to interact with Python at all, you can download a prebuilt
33
33
  git clone https://github.com/rohailamalik/matlab-simulink-mcp
34
34
  cd matlab-simulink-mcp
35
35
 
36
- 2. Create a Python virtual environment (recommended: [uv](https://pypi.org/project/uv/0.1.32/)):
36
+ 2. Create a Python virtual environment ([uv](https://pypi.org/project/uv/0.1.32/) is recommended):
37
37
 
38
38
  ```bash
39
39
  uv venv --python 3.12 # match Python to your MATLAB-supported version
@@ -41,11 +41,11 @@ If you don’t want to interact with Python at all, you can download a prebuilt
41
41
  uv sync
42
42
  ```
43
43
 
44
- Without uv, first download a Python version manually:
44
+ Without uv, first download a Python version manually, then run:
45
45
 
46
46
  ```bash
47
- python3.12 -m venv .venv
48
- source .venv/bin/activate
47
+ python3.12 -m venv .venv # match Python to your MATLAB-supported version
48
+ source .venv/Scripts/activate # on macOS/Linux: source .venv/bin/activate
49
49
  pip install -r requirements.txt
50
50
  pip install .
51
51
  ```
@@ -58,7 +58,7 @@ If you don’t want to interact with Python at all, you can download a prebuilt
58
58
  pip install matlab-simulink-mcp
59
59
  ```
60
60
 
61
- 4. On first run, if the MATLAB Engine is not installed, the server will open a console window and guide you through installation.
61
+ 4. On the first run, if the MATLAB Engine is not installed, the server will open a console window and guide you through installation.
62
62
 
63
63
  - This requires admin permission and the server will request for it.
64
64
  - 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).
@@ -75,7 +75,7 @@ If you don’t want to interact with Python at all, you can download a prebuilt
75
75
  {
76
76
  "mcpServers": {
77
77
  "MATLAB_Simulink_MCP": {
78
- "command": "C:/Data/Research/Doctoral/src/matlab-simulink-mcp/.venv/Scripts/python.exe",
78
+ "command": "absolute-path-to/.venv/Scripts/python.exe", // absolute path to your venv/global environment executable
79
79
  "args": ["-m", "matlab_simulink_mcp"]
80
80
  }
81
81
  }
@@ -92,7 +92,7 @@ If you don’t want to interact with Python at all, you can download a prebuilt
92
92
 
93
93
  5. On first launch, the server may open multiple consoles to install MATLAB Engine. Interact with one, complete installation, then restart Claude if needed.
94
94
 
95
- 6. Check running status in Settings → Developer, or click the equalizer button in the chat box.
95
+ 6. Check running status in Settings → Developer, or click the equalizer button in Claude's chat box.
96
96
 
97
97
  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.
98
98
 
@@ -102,7 +102,7 @@ If you don’t want to interact with Python at all, you can download a prebuilt
102
102
 
103
103
  ## Debugging
104
104
 
105
- 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.
105
+ 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.
106
106
 
107
107
  ```bash
108
108
  cd scripts
@@ -138,17 +138,17 @@ matlab-simulink-mcp/
138
138
 
139
139
  ## FAQ
140
140
 
141
- Q: Which Python version should I install?
142
-
143
- A: Match it to the highest Python version supported by your MATLAB release (see MathWorks docs).
141
+ - Q: Which Python version should I install?
142
+
143
+ - A: Match it to the highest Python version supported by your MATLAB release (see MathWorks docs).
144
144
 
145
- Q: The console disappears too quickly!
145
+ - Q: The console disappears too quickly!
146
146
 
147
- A: Add `--console` in your Claude config args to keep the server console open.
147
+ - A: Add `--console` in your Claude config args to keep the server console open.
148
148
 
149
- Q: Multiple installer consoles opened on first run.
149
+ - Q: Multiple installer consoles opened on first run.
150
150
 
151
- A: This is expected if Claude sends multiple startup requests. Complete one installation, then restart Claude Desktop.
151
+ - A: This is expected if Claude sends multiple startup requests. Complete one installation, then restart Claude Desktop.
152
152
 
153
153
  ## Contributing
154
154
 
@@ -0,0 +1,73 @@
1
+ # MATLAB Simulink MCP Server
2
+
3
+ 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.
4
+
5
+ ## Features
6
+
7
+ - Read, write, and run MATLAB code and scripts
8
+ - Parse and interact with Simulink files
9
+ - Access MATLAB workspace variables and outputs (including visualizations)
10
+ - Basic safety layer to prevent execution of unsafe commands (configurable)
11
+ - Non-blocking execution (async MATLAB engine calls)
12
+ - Automatic installation of MATLAB Engine package if unavailable
13
+
14
+ ## Requirements
15
+
16
+ - **MATLAB** R2022b or later
17
+ - **Python** 3.10–3.12 (check MATLAB's [supported versions](https://www.mathworks.com/support/requirements/python-compatibility.html))
18
+
19
+ ## Installation
20
+
21
+ 1. Install using:
22
+
23
+ ```bash
24
+ uv pip install matlab-simulink-mcp
25
+ # or
26
+ pip install matlab-simulink-mcp
27
+ ```
28
+
29
+ 2. On the first run, if the MATLAB Engine is not installed, the server will open a console window and guide you through installation.
30
+
31
+ - This requires admin permission and the server will request for it.
32
+ - 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).
33
+
34
+ ## Configuration (Claude Desktop)
35
+
36
+ 1. Install [Claude Desktop](https://claude.ai/download).
37
+
38
+ 2. Open Settings → Developer → Edit Config.
39
+
40
+ 3. In the `claude_desktop_config.json`, add or update:
41
+
42
+ ```json
43
+ {
44
+ "mcpServers": {
45
+ "MATLAB_Simulink_MCP": {
46
+ "command": "absolute-path-to/.venv/Scripts/python.exe", // absolute path to your venv/global environment executable
47
+ "args": ["-m", "matlab_simulink_mcp"]
48
+ }
49
+ }
50
+ }
51
+ ```
52
+
53
+ On macOS/Linux, use `absolute-path-to/.venv/bin/python` in `command`.
54
+
55
+ **Note**: Only use `/` or `\\` in the paths, not `\`.
56
+
57
+ 4. Save and restart Claude Desktop. (Ensure it is fully closed in Task Manager/Activity Monitor.)
58
+
59
+ 5. On first launch, the server may open multiple consoles to install MATLAB Engine. Interact with one, complete installation, then restart Claude if needed.
60
+
61
+ 6. Check running status in Settings → Developer, or click the equalizer button in Claude's chat box.
62
+
63
+ 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.
64
+
65
+ - Claude MCP logs (Windows): `%APPDATA%\Claude\logs\mcp-server-MatlabMCP.log`
66
+ - Claude MCP logs (macOS): `~/Library/Logs/Claude/mcp-server-MatlabMCP.log`
67
+ - Server logs: written to your user log directory (or configured via `.env`).
68
+
69
+ ## Debugging
70
+
71
+ 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.
72
+
73
+ To use it, import `mcp` from `matlab_simulink_mcp.server` into a script and run the script using `fastmcp dev script_name.py`
@@ -0,0 +1,49 @@
1
+ [build-system]
2
+ requires = ["setuptools>=61.0", "wheel"]
3
+ build-backend = "setuptools.build_meta"
4
+
5
+ [project]
6
+ name = "matlab-simulink-mcp"
7
+ version = "0.1.1"
8
+ description = "An MCP server for allowing LLMs to interact with MATLAB and Simulink"
9
+ authors = [
10
+ { name = "Rohail"}
11
+ ]
12
+ license = { text = "MIT" }
13
+ classifiers = [
14
+ "Development Status :: 3 - Alpha",
15
+ "Intended Audience :: Developers",
16
+ "License :: OSI Approved :: MIT License",
17
+ "Programming Language :: Python :: 3",
18
+ "Programming Language :: Python :: 3.10",
19
+ "Programming Language :: Python :: 3.11",
20
+ "Programming Language :: Python :: 3.12",
21
+ "Topic :: Scientific/Engineering",
22
+ "Topic :: Software Development :: Libraries :: Python Modules"
23
+ ]
24
+ readme = { file = "README_pypi.md", content-type = "text/markdown" }
25
+ requires-python = ">=3.10,<3.13"
26
+ dependencies = [
27
+ "fastmcp>=2.12.2",
28
+ "platformdirs>=4.4.0",
29
+ ]
30
+
31
+ [tool.setuptools.packages.find]
32
+ where = ["src"]
33
+
34
+ [tool.setuptools.package-data]
35
+ "matlab_simulink_mcp" = ["data/*.txt", "data/*.json", "data/helpers/*.py"]
36
+
37
+ [project.scripts]
38
+ matlab_simulink_mcp = "matlab_simulink_mcp.__main__:main"
39
+
40
+ [[tool.uv.index]]
41
+ name = "pypi"
42
+ url = "https://pypi.org/simple"
43
+ publish-url = "https://upload.pypi.org/legacy/"
44
+
45
+ [[tool.uv.index]]
46
+ name = "testpypi"
47
+ url = "https://test.pypi.org/simple"
48
+ publish-url = "https://test.pypi.org/legacy/"
49
+
@@ -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`
@@ -1,4 +1,6 @@
1
+ LICENSE
1
2
  README.md
3
+ README_pypi.md
2
4
  pyproject.toml
3
5
  src/matlab_simulink_mcp/__init__.py
4
6
  src/matlab_simulink_mcp/__main__.py
@@ -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
- [![PyPI version](https://img.shields.io/pypi/v/matlab-simulink-mcp.svg)](https://pypi.org/project/matlab-simulink-mcp/)
18
- [![Python versions](https://img.shields.io/pypi/pyversions/matlab-simulink-mcp.svg)](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.
@@ -1,33 +0,0 @@
1
- [build-system]
2
- requires = ["setuptools>=61.0", "wheel"]
3
- build-backend = "setuptools.build_meta"
4
-
5
- [project]
6
- name = "matlab-simulink-mcp"
7
- version = "0.1.0"
8
- description = "An MCP server for allowing LLMs to interact with MATLAB and Simulink"
9
- authors = [
10
- { name = "Rohail"}
11
- ]
12
- license = { text = "MIT" }
13
- classifiers = [
14
- "Programming Language :: Python :: 3",
15
- "License :: OSI Approved :: MIT License",
16
- "Operating System :: OS Independent"
17
- ]
18
-
19
- readme = { file = "README.md", content-type = "text/markdown" }
20
- requires-python = ">=3.10,<3.13"
21
- dependencies = [
22
- "fastmcp>=2.12.2",
23
- "platformdirs>=4.4.0",
24
- ]
25
-
26
- [tool.setuptools.packages.find]
27
- where = ["src"]
28
-
29
- [tool.setuptools.package-data]
30
- "matlab_simulink_mcp" = ["data/*.txt", "data/*.json", "data/helpers/*.py"]
31
-
32
- [project.scripts]
33
- matlab_simulink_mcp = "matlab_simulink_mcp.__main__:main"
@@ -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
- [![PyPI version](https://img.shields.io/pypi/v/matlab-simulink-mcp.svg)](https://pypi.org/project/matlab-simulink-mcp/)
18
- [![Python versions](https://img.shields.io/pypi/pyversions/matlab-simulink-mcp.svg)](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.