Skip to content

Commit 2eaa9a2

Browse files
HanSur94claude
andcommitted
docs: add PyPI/Docker to Installation, file reading examples, FAQ updates
- Installation.md: PyPI install option, Docker quickstart section - Examples.md: file reading examples (read_script, read_data, read_image) - FAQ.md: PyPI, Docker, and file reading tools Q&A Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
1 parent b983d2b commit 2eaa9a2

3 files changed

Lines changed: 97 additions & 0 deletions

File tree

wiki/Examples.md

Lines changed: 47 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -127,6 +127,53 @@ The agent gets a job ID immediately and can poll progress:
127127
- "Trial 500000/1000000 — 50%"
128128
- ...until complete.
129129

130+
## File Reading
131+
132+
The server provides tools to read files back from the session temp directory — useful for retrieving generated scripts, data, and plots.
133+
134+
### Read a MATLAB Script
135+
136+
> "Show me the contents of the script you just saved"
137+
138+
The agent calls `read_script`:
139+
```
140+
read_script(filename="analysis.m")
141+
```
142+
143+
Returns the `.m` file content as inline text.
144+
145+
### Read Data File Summary
146+
147+
> "What variables are in the results.mat file?"
148+
149+
The agent calls `read_data` in summary mode:
150+
```
151+
read_data(filename="results.mat", format="summary")
152+
```
153+
154+
Returns a table of variable names, sizes, and types (via MATLAB `whos`). Use `format="raw"` to get the raw base64-encoded file content instead.
155+
156+
### Read CSV Data
157+
158+
> "Show me the output CSV"
159+
160+
```
161+
read_data(filename="output.csv", format="summary")
162+
```
163+
164+
Returns the text content of the CSV file inline.
165+
166+
### View a Generated Plot
167+
168+
> "Show me the plot you just created"
169+
170+
The agent calls `read_image`:
171+
```
172+
read_image(filename="result.png")
173+
```
174+
175+
Returns the image as an inline content block — renders directly in Claude Desktop, Cursor, and other agent UIs. Supported formats: `.png`, `.jpg`, `.gif`.
176+
130177
## Configuration Examples
131178

132179
### Minimal (Single User)

wiki/FAQ.md

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,19 @@ Not currently. The server connects to locally-installed MATLAB via the Engine AP
1818

1919
Any agent that supports the Model Context Protocol (MCP): Claude Desktop, Claude Code, Cursor, GitHub Copilot (with MCP support), and custom agents built with MCP SDKs.
2020

21+
### Can I install it from PyPI?
22+
23+
Yes:
24+
```bash
25+
pip install matlab-mcp-python
26+
```
27+
28+
You still need to install the MATLAB Engine API separately from your MATLAB installation. See [[Installation]].
29+
30+
### Can I run it in Docker?
31+
32+
Yes. The project includes a `Dockerfile` and `docker-compose.yml`. The Docker image does **not** include MATLAB — you must mount your own MATLAB installation as a volume. See [[Installation]] for Docker setup instructions.
33+
2134
## Setup
2235

2336
### How do I install the MATLAB Engine API?
@@ -67,6 +80,15 @@ Yes! MATLAB figures are automatically converted to Plotly JSON, which renders as
6780

6881
Line, scatter, bar, histogram, surface, and image plots. Complex custom graphics may fall back to static PNG.
6982

83+
### Can I read files back from the session?
84+
85+
Yes, three tools are available:
86+
- **`read_script`** — read `.m` script files as text
87+
- **`read_data`** — read data files (`.mat`, `.csv`, `.json`, `.txt`, `.xlsx`) with summary or raw mode
88+
- **`read_image`** — read image files (`.png`, `.jpg`, `.gif`) as inline images that render in agent UIs
89+
90+
Use `list_files` first to see what files are available in your session.
91+
7092
## Performance
7193

7294
### How many engines should I run?

wiki/Installation.md

Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -38,6 +38,14 @@ eng.quit()
3838

3939
## Step 2: Install the MCP Server
4040

41+
### Option A: Install from PyPI
42+
43+
```bash
44+
pip install matlab-mcp-python
45+
```
46+
47+
### Option B: Install from source
48+
4149
```bash
4250
git clone https://github.com/HanSur94/matlab-mcp-server-python.git
4351
cd matlab-mcp-server-python
@@ -105,6 +113,26 @@ matlab-mcp --transport sse
105113

106114
Then point your client to `http://localhost:8765/sse`.
107115

116+
### Run with Docker
117+
118+
```bash
119+
# Build the image
120+
docker build -t matlab-mcp .
121+
122+
# Run with your MATLAB mounted
123+
docker run -p 8765:8765 -p 8766:8766 \
124+
-v /path/to/MATLAB:/opt/matlab:ro \
125+
-e MATLAB_MCP_POOL_MATLAB_ROOT=/opt/matlab \
126+
matlab-mcp
127+
128+
# Or use docker-compose (edit docker-compose.yml to set your MATLAB path)
129+
docker compose up
130+
```
131+
132+
> **Note:** The Docker image does not include MATLAB. You must mount your own MATLAB installation and ensure the MATLAB Engine API for Python is accessible inside the container.
133+
134+
> **Upgrading?** If you previously installed as `matlab-mcp-server`, uninstall first: `pip uninstall matlab-mcp-server && pip install matlab-mcp-python`
135+
108136
## Virtual Environment (Recommended)
109137

110138
```bash

0 commit comments

Comments
 (0)