|
13 | 13 | <a href="https://github.com/HanSur94/matlab-mcp-server-python/wiki">Wiki</a> |
14 | 14 | </p> |
15 | 15 |
|
| 16 | +<p align="center"> |
| 17 | + <a href="https://github.com/HanSur94/matlab-mcp-server-python/actions/workflows/ci.yml"> |
| 18 | + <img src="https://github.com/HanSur94/matlab-mcp-server-python/actions/workflows/ci.yml/badge.svg" alt="CI"> |
| 19 | + </a> |
| 20 | + <a href="https://pypi.org/project/matlab-mcp-python/"> |
| 21 | + <img src="https://img.shields.io/pypi/v/matlab-mcp-python" alt="PyPI"> |
| 22 | + </a> |
| 23 | + <a href="https://pypi.org/project/matlab-mcp-python/"> |
| 24 | + <img src="https://img.shields.io/pypi/pyversions/matlab-mcp-python" alt="Python"> |
| 25 | + </a> |
| 26 | +</p> |
| 27 | + |
16 | 28 | --- |
17 | 29 |
|
18 | 30 | A Python MCP server that connects **any AI agent** (Claude, Cursor, Copilot, custom agents) to a shared MATLAB installation. Execute code, discover toolboxes, check code quality, get interactive Plotly plots, and run long simulations — all through [MCP](https://modelcontextprotocol.io/). |
@@ -56,6 +68,10 @@ pip install . |
56 | 68 | ### Install the server |
57 | 69 |
|
58 | 70 | ```bash |
| 71 | +# Option 1: Install from PyPI |
| 72 | +pip install matlab-mcp-python |
| 73 | + |
| 74 | +# Option 2: Install from source |
59 | 75 | git clone https://github.com/HanSur94/matlab-mcp-server-python.git |
60 | 76 | cd matlab-mcp-server-python |
61 | 77 | pip install -e ".[dev]" |
@@ -105,6 +121,26 @@ Add to `.cursor/mcp.json` in your project: |
105 | 121 | } |
106 | 122 | ``` |
107 | 123 |
|
| 124 | +### Run with Docker |
| 125 | + |
| 126 | +```bash |
| 127 | +# Build the image |
| 128 | +docker build -t matlab-mcp . |
| 129 | + |
| 130 | +# Run with your MATLAB mounted |
| 131 | +docker run -p 8765:8765 -p 8766:8766 \ |
| 132 | + -v /path/to/MATLAB:/opt/matlab:ro \ |
| 133 | + -e MATLAB_MCP_POOL_MATLAB_ROOT=/opt/matlab \ |
| 134 | + matlab-mcp |
| 135 | + |
| 136 | +# Or use docker-compose (edit docker-compose.yml to set your MATLAB path) |
| 137 | +docker compose up |
| 138 | +``` |
| 139 | + |
| 140 | +> **Note:** The Docker image does not include MATLAB. You must mount your own MATLAB installation. |
| 141 | +
|
| 142 | +> **Upgrading?** If you previously installed as `matlab-mcp-server`, uninstall first: `pip uninstall matlab-mcp-server && pip install matlab-mcp-python` |
| 143 | +
|
108 | 144 | ## Examples |
109 | 145 |
|
110 | 146 | ### Basic: Run MATLAB Code |
@@ -235,6 +271,14 @@ Now the agent can call `analyze_signal` or `train_model` directly — with full |
235 | 271 | | `delete_file` | `filename: str` | Delete a session file | |
236 | 272 | | `list_files` | — | List files in the session directory | |
237 | 273 |
|
| 274 | +### File Reading |
| 275 | + |
| 276 | +| Tool | Parameters | Description | |
| 277 | +|------|-----------|-------------| |
| 278 | +| `read_script` | `filename: str` | Read a MATLAB `.m` script file as text | |
| 279 | +| `read_data` | `filename: str, format: str` | Read data files (`.mat`, `.csv`, `.json`, `.txt`, `.xlsx`). `format`: `summary` or `raw` | |
| 280 | +| `read_image` | `filename: str` | Read image files (`.png`, `.jpg`, `.gif`) — renders inline in agent UIs | |
| 281 | + |
238 | 282 | ### Admin |
239 | 283 |
|
240 | 284 | | Tool | Parameters | Description | |
@@ -558,7 +602,7 @@ AI Agent (Claude, Cursor, etc.) |
558 | 602 | ▼ |
559 | 603 | ┌──────────────────────────────────────────────────────────┐ |
560 | 604 | │ MCP Server (FastMCP 2.x) │ |
561 | | -│ 17 tools + custom tools │ |
| 605 | +│ 20 tools + custom tools │ |
562 | 606 | │ Session manager │ Security validator │ Formatter │ |
563 | 607 | └──────────┬───────────────────────────────┬───────────────┘ |
564 | 608 | │ │ |
|
0 commit comments