Skip to content

Commit a08de46

Browse files
author
Michelle Hirsch
committed
2026.04.10 release
1 parent e5d5f49 commit a08de46

5 files changed

Lines changed: 187 additions & 22 deletions

File tree

.claude-plugin/marketplace.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77
"plugins": [
88
{
99
"name": "toolkit",
10-
"version": "0.2.0",
10+
"version": "0.2.1",
1111
"description": "Setup and management for the MATLAB Agentic Toolkit. Detects MATLAB, installs the MCP server, registers the Claude Code plugin, and verifies the environment.",
1212
"author": {
1313
"name": "MathWorks"
@@ -20,7 +20,7 @@
2020
},
2121
{
2222
"name": "matlab-core",
23-
"version": "0.2.0",
23+
"version": "0.2.1",
2424
"description": "MATLAB skills and MCP tools for AI coding agents. Testing, debugging, reviewing code, creating Live Scripts, building apps, and modernizing code.",
2525
"author": {
2626
"name": "MathWorks"

GETTING_STARTED.md

Lines changed: 34 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -80,7 +80,7 @@ Setup writes two things: an MCP server configuration (so your agent can talk to
8080

8181
| Platform | MCP Configuration | Skills Delivery | How To Update Toolkit |
8282
|----------|------------------|-----------------|-------------------|
83-
| Claude Code | `~/.claude/.mcp.json` | Plugin cache | Re-run setup or reinstall plugin |
83+
| Claude Code | `~/.claude/settings.json` | Plugin cache | Re-run setup or reinstall plugin |
8484
| GitHub Copilot | `~/.vscode/settings.json` | `~/.agents/skills/` symlinks | `git pull` in toolkit repo, re-run setup |
8585
| OpenAI Codex | `~/.codex/config.toml` | `~/.agents/skills/` symlinks | `git pull` in toolkit repo, re-run setup |
8686
| Gemini CLI | `~/.gemini/settings.json` | `~/.agents/skills/` symlinks | `git pull` in toolkit repo, re-run setup |
@@ -94,7 +94,7 @@ Setup writes two things: an MCP server configuration (so your agent can talk to
9494

9595
### Platform-Specific Notes
9696

97-
**Claude Code** — Setup registers the toolkit via the plugin marketplace and writes MCP config to `~/.claude/.mcp.json`. Skills are cached by the plugin system. To re-run setup, use `/matlab-setup` or ask Claude to set up the toolkit.
97+
**Claude Code** — Setup registers the toolkit via the plugin marketplace and uses `claude mcp add -s user` to register the MCP server globally. Skills are cached by the plugin system. To re-run setup, use `/matlab-setup` or ask Claude to set up the toolkit.
9898

9999
**GitHub Copilot** — Setup writes global MCP config to `~/.vscode/settings.json` and creates skill symlinks in `~/.agents/skills/`. Reload VS Code after setup completes (Cmd/Ctrl + Shift + P, then "Developer: Reload Window").
100100

@@ -308,6 +308,38 @@ The MCP server binary is released independently from the toolkit. To update it:
308308
309309
---
310310

311+
## Per-Project Configuration
312+
313+
Automated setup configures the toolkit **globally** — MATLAB tools and skills are available in every session regardless of which project you open. Global configuration is the easiest way to get started since it just works whenever you create or open a project.
314+
315+
You can also configure the MCP server at the project level. This keeps your tools and skills scoped to the projects that need them, and it helps teams — when the config is committed to version control, anyone who clones the repo gets the MATLAB connection automatically (provided they have the MCP server binary installed; see [Installing the MCP Server Manually](#installing-the-mcp-server-manually)).
316+
317+
### Template files
318+
319+
The [`templates/`](templates/) directory contains starter configurations for each platform. Copy the appropriate template into the root folder of your project, update the paths, and commit it to version control.
320+
321+
| Platform | Template | Project location |
322+
|----------|----------|-----------------|
323+
| GitHub Copilot | `templates/vscode-mcp.json` | `.vscode/mcp.json` |
324+
| Cursor | `templates/mcp.json` | `.cursor/mcp.json` |
325+
| Sourcegraph Amp | `templates/amp-settings.json` | `.amp/settings.json` |
326+
| OpenAI Codex | `templates/codex-mcp.json` | `.codex/config.json` in project root |
327+
328+
> **Claude Code** uses `claude plugin install` with scope selection (per-project, per-user, or global) rather than a project config file. See [Adding Skills Only](#adding-skills-only).
329+
330+
### Example: GitHub Copilot
331+
332+
```bash
333+
mkdir -p .vscode
334+
cp /path/to/matlab-agentic-toolkit/templates/vscode-mcp.json .vscode/mcp.json
335+
```
336+
337+
Then edit `.vscode/mcp.json` to replace the placeholder paths with your actual MCP server binary and MATLAB root paths.
338+
339+
> **Note:** Per-project configs contain absolute paths to the MCP server binary and MATLAB root, which vary across machines. If your team uses different OS platforms or install locations, consider documenting the expected paths in your project README.
340+
341+
---
342+
311343
## Troubleshooting
312344

313345
| Problem | Likely Cause | Fix |

skills-catalog/toolkit/matlab-agentic-toolkit-setup/SKILL.md

Lines changed: 96 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ description: Install and configure the MATLAB Agentic Toolkit — detect MATLAB,
44
license: MathWorks BSD-3-Clause
55
metadata:
66
author: MathWorks
7-
version: "1.0"
7+
version: "1.1"
88
---
99

1010
# MATLAB Agentic Toolkit Setup
@@ -17,6 +17,38 @@ Automated onboarding for the MATLAB Agentic Toolkit. Detects MATLAB, downloads a
1717
1818
This skill does NOT require the MATLAB MCP server — it uses shell commands for everything until the final verification step.
1919

20+
## Welcome Message
21+
22+
Before doing any work, print a welcome message to the user. This sets expectations for what's about to happen and why they may be asked to approve actions. Use a friendly, personal tone with "I" statements. The message should cover:
23+
24+
```
25+
Welcome! My goal is to get you set up with the MATLAB Agentic Toolkit so you
26+
can use MATLAB tools and skills with your agent for your projects.
27+
28+
Here's what I'll do:
29+
30+
1. Look around your computer to find your MATLAB installation(s) and check
31+
whether the MCP server is already installed. Depending on your permissions
32+
settings, you may be asked to approve some of these steps — I'm just
33+
reading system info, not changing anything yet.
34+
35+
2. Come back to you with a plan showing what I found and what I'd like to
36+
configure. You'll have a chance to adjust any choices before I make changes.
37+
38+
3. Once you approve, I'll install the MCP server (if needed), configure your
39+
agent to use it for your other projects, and verify the connection to MATLAB.
40+
41+
This setup configures everything globally — once it's done, MATLAB tools and
42+
skills will be available in every session, regardless of which project you're
43+
working in. This is the easiest way to get started. If you later want to scope
44+
the configuration to specific projects, the Getting Started guide covers that.
45+
46+
If you'd rather set things up manually, the Getting Started guide has
47+
step-by-step instructions: GETTING_STARTED.md
48+
```
49+
50+
Adapt the wording naturally — don't recite it verbatim — but cover all three points. After printing the welcome message, proceed directly to Phase 1 without waiting for a response.
51+
2052
## When to Use
2153

2254
- User runs `/matlab-setup` or asks to set up the MATLAB Agentic Toolkit
@@ -46,6 +78,8 @@ The goal is to ask the user **once** for all decisions, then execute without fur
4678

4779
## Phase 1: Discovery
4880

81+
Print a brief status message before starting: **"Scanning your system for MATLAB installations and checking the current setup. You may be asked to approve some read-only commands — I'm just gathering information, not making any changes yet."**
82+
4983
Run all of these checks silently — do not prompt the user during this phase. Collect all results for presentation in Phase 2.
5084

5185
### 1a. Detect platform
@@ -107,6 +141,12 @@ For other platforms, check if their global config files already have a `matlab`
107141

108142
Check environment and CLI tools: `claude --version` (Claude Code), `$CURSOR_TRACE` (Cursor), `codex --version` (Codex), `amp --version` (Amp), `gemini --version` (Gemini CLI), `$VSCODE_*` (Copilot). If ambiguous, ask the user.
109143

144+
### 1g. Check for legacy artifacts
145+
146+
Read the platform-specific reference file and check for any items listed in its **Legacy Artifacts** section (if present). Record what was found — these will be shown in the plan and cleaned up during Phase 3.
147+
148+
**Reference file resolution:** On re-runs (when `~/.matlab-agentic-toolkit/config.json` exists), resolve reference files from `toolkitRoot` in that config (e.g., `<toolkitRoot>/skills-catalog/toolkit/matlab-agentic-toolkit-setup/reference/<filename>`), not from the skill's base directory. This avoids reading stale cached versions when the skill is loaded from a plugin cache.
149+
110150
---
111151

112152
## Phase 2: Plan
@@ -135,6 +175,7 @@ Proposed actions:
135175
MCP server: Download v0.7.0 to ~/.local/bin/matlab-mcp-core-server
136176
Display mode: nodesktop (MATLAB runs headless; windows still open for plots)
137177
Agent config: Configure MCP server globally (available in all sessions)
178+
Migration: (none)
138179
139180
Proceed with this plan? You can adjust any choice:
140181
- Pick a different MATLAB: "use 2" or provide a path
@@ -143,6 +184,8 @@ Proceed with this plan? You can adjust any choice:
143184
- Configure a different agent: "use Cursor" or "use Amp"
144185
```
145186

187+
The **Migration** row shows legacy artifacts found in Phase 1g. If none were found, show `(none)`. If artifacts were found, list what will be cleaned up, e.g., `Remove ~/.claude/.mcp.json (migrated to claude mcp add)`.
188+
146189
For non-Claude platforms, clearly note "EXPERIMENTAL — untested, provided as-is" and that manual fallback will be provided if automated setup fails.
147190

148191
For OpenAI Codex specifically, the plan must cover **both**:
@@ -170,6 +213,8 @@ Once the user confirms — move to Phase 3. If they adjust choices, update the p
170213

171214
## Phase 3: Execute
172215

216+
Print a brief status message before starting: **"Great — executing the plan now. I'll be downloading, writing config files, and registering skills. You may be asked to approve some of these actions depending on your permissions settings."**
217+
173218
Carry out the approved plan. Do NOT prompt the user during this phase — all decisions were made in Phase 2.
174219

175220
### 3a. Install MCP server (if needed)
@@ -188,6 +233,10 @@ Verify: `~/.local/bin/matlab-mcp-core-server --version`
188233

189234
If download fails, provide the direct URL for manual download.
190235

236+
### 3b-migrate. Clean up legacy artifacts
237+
238+
If Phase 1g found any legacy artifacts, clean them up now according to the instructions in the platform reference file's **Legacy Artifacts** section. Only remove artifacts after the new configuration has been written successfully (i.e., run this after 3b-platform, not before).
239+
191240
### 3b-shared. Register global skills (Copilot, Codex, Gemini)
192241

193242
For platforms that discover skills from `~/.agents/skills/` — GitHub Copilot, OpenAI Codex, and Gemini CLI — create symlinks pointing back to the toolkit repo. This only needs to run once, even if multiple platforms are configured.
@@ -251,13 +300,53 @@ Echo back:
251300
- File path: `~/.vscode/settings.json`
252301
- MATLAB entry was added/updated
253302

303+
#### Claude Code
304+
305+
Uses `claude mcp add` CLI to register the MCP server globally. Do NOT write `~/.claude/.mcp.json` manually — that file is not read by Claude Code.
306+
307+
**Step 1: Add the marketplace**
308+
309+
```bash
310+
claude plugin marketplace add "https://github.com/matlab/matlab-agentic-toolkit"
311+
```
312+
313+
If already registered, this is a no-op.
314+
315+
**Step 2: Install plugins**
316+
317+
```bash
318+
claude plugin install matlab-core@matlab-agentic-toolkit
319+
claude plugin install toolkit@matlab-agentic-toolkit
320+
```
321+
322+
Claude's native prompt will ask the user to choose scope. Do NOT implement your own scope selection.
323+
324+
**Step 3: Register MCP server**
325+
326+
```bash
327+
claude mcp add-json -s user matlab '{"command":"<MCP_SERVER_PATH>","args":["--matlab-root","<MATLAB_ROOT>","--matlab-display-mode","<DISPLAY_MODE>"]}'
328+
```
329+
330+
This registers the server at user scope (available in all projects). If a `matlab` entry already exists, it is overwritten. MCP tools become available in the next session.
331+
332+
**Step 4: Verify plugin installation**
333+
334+
```bash
335+
claude plugin list 2>&1
336+
```
337+
338+
If `claude` CLI plugin commands fail, skip plugin installation — skills can be used by reading SKILL.md files directly. The MCP registration (Step 3) works independently via `claude mcp add`, which is a core CLI command.
339+
340+
Echo back the `claude mcp add-json` command that was run and confirm it succeeded.
341+
342+
See `reference/claude-code-setup-guidance.md` for legacy artifact cleanup and additional troubleshooting details.
343+
254344
#### Other platforms
255345

256346
**Read** the platform-specific reference file (located in the `reference/` directory next to this skill file) and follow its instructions exactly. Use the toolkit root to resolve the path: `<TOOLKIT_ROOT>/skills-catalog/toolkit/matlab-agentic-toolkit-setup/reference/<filename>`.
257347

258348
| Platform | Reference file |
259349
|----------|---------------|
260-
| Claude Code | `reference/claude-code-setup-guidance.md` |
261350
| Cursor | `reference/cursor-setup-guidance.md` |
262351
| OpenAI Codex | `reference/codex-setup-guidance.md` |
263352
| Sourcegraph Amp | `reference/amp-setup-guidance.md` |
@@ -286,14 +375,19 @@ mkdir -p ~/.matlab-agentic-toolkit
286375
"mcpServerVersion": "<VERSION>",
287376
"displayMode": "<DISPLAY_MODE>",
288377
"configuredPlatforms": ["<PLATFORM>"],
378+
"setupSkillVersion": "<SKILL_VERSION>",
289379
"lastSetup": "<ISO_8601_TIMESTAMP>"
290380
}
291381
```
292382

383+
The `setupSkillVersion` field records the skill `metadata.version` from the YAML front matter of this file. This allows future runs to detect when the skill has been updated and whether migration steps may apply.
384+
293385
---
294386

295387
## Phase 4: Verify
296388

389+
Print a brief status message: **"Setup is done — verifying the connection to MATLAB."**
390+
297391
Verification depends on the agent platform.
298392

299393
### Claude Code

skills-catalog/toolkit/matlab-agentic-toolkit-setup/manifest.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
schema_version: 1
33
license: MathWorks BSD-3-Clause
44
scope: cross-product
5-
version: "2.0"
5+
version: "2.1"
66
matlab-release: ">=R2020b"
77
requires-tools: []
88
requires-skills: []

skills-catalog/toolkit/matlab-agentic-toolkit-setup/reference/claude-code-setup-guidance.md

Lines changed: 54 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -6,11 +6,11 @@ This reference file contains Claude Code-specific instructions for Phase 3b of t
66

77
## Overview
88

9-
Claude Code uses a plugin system with a marketplace. The `matlab-core` plugin delivers MATLAB skills but does **not** ship MCP server configuration (MCP config is system-specific and can't be meaningfully defaulted). The setup skill writes `~/.claude/.mcp.json` with absolute paths for the binary and MATLAB root.
9+
Claude Code uses a plugin system with a marketplace. The `matlab-core` plugin delivers MATLAB skills but does **not** ship MCP server configuration (MCP config is system-specific and can't be meaningfully defaulted). The setup skill registers the MCP server using the `claude mcp add` CLI command, which writes to the correct location automatically.
1010

1111
## Global Config Path
1212

13-
MCP server config: `~/.claude/.mcp.json` (user-level, written by setup skill).
13+
MCP server config is managed by the `claude mcp add -s user` command, which writes to `~/.claude/settings.json` under the `mcpServers` key. Do NOT write MCP config files manually — always use the CLI.
1414

1515
## Phase 3b: Register Plugin
1616

@@ -31,22 +31,19 @@ claude plugin install toolkit@matlab-agentic-toolkit
3131

3232
Claude's native prompt will ask the user to choose scope for each plugin. Do NOT implement your own scope selection — let Claude Code handle it.
3333

34-
### Step 3: Write MCP server config
34+
### Step 3: Register MCP server
3535

36-
Write `~/.claude/.mcp.json` with the detected binary path and MATLAB root:
36+
Use the `claude mcp add` CLI to register the MATLAB MCP server at user scope (available in all projects):
3737

38-
```json
39-
{
40-
"mcpServers": {
41-
"matlab": {
42-
"command": "<MCP_SERVER_PATH>",
43-
"args": ["--matlab-root", "<MATLAB_ROOT>", "--matlab-display-mode", "<DISPLAY_MODE>"]
44-
}
45-
}
46-
}
38+
```bash
39+
claude mcp add-json -s user matlab '{"command":"<MCP_SERVER_PATH>","args":["--matlab-root","<MATLAB_ROOT>","--matlab-display-mode","<DISPLAY_MODE>"]}'
4740
```
4841

49-
Replace `<MCP_SERVER_PATH>`, `<MATLAB_ROOT>`, and `<DISPLAY_MODE>` with the values from the setup plan. The MCP tools become available in the next session (or immediately if the session is restarted).
42+
Replace `<MCP_SERVER_PATH>`, `<MATLAB_ROOT>`, and `<DISPLAY_MODE>` with the values from the setup plan.
43+
44+
**Important:** This command must run at the system terminal (via the Bash tool), not as an inline Claude Code command. If a `matlab` entry already exists, the command will overwrite it.
45+
46+
The MCP tools become available in the next session (or immediately if the session is restarted).
5047

5148
### Step 4: Verify plugin installation
5249

@@ -62,7 +59,49 @@ If `claude` CLI commands fail (e.g., not available in the user's Claude Code ver
6259

6360
1. Report the error clearly
6461
2. Skip plugin installation — skills can be used by reading SKILL.md files directly from the repo
65-
3. The MCP config (Step 3) still works independently of the plugin system
62+
3. The MCP server registration (Step 3) still works independently of the plugin system — `claude mcp add` is a core CLI command available in all versions that support MCP
63+
64+
## Legacy Artifacts
65+
66+
Check for these artifacts from previous setup approaches. If found during Phase 1g, record them for the plan and clean them up during Phase 3b-migrate.
67+
68+
### `~/.claude/.mcp.json` with `matlab` entry
69+
70+
Earlier versions of the setup skill wrote MCP config directly to `~/.claude/.mcp.json`. This file is no longer used — MCP servers are now registered via `claude mcp add -s user`, which writes to `~/.claude/settings.json`.
71+
72+
**Detection (Phase 1g):**
73+
74+
```bash
75+
cat ~/.claude/.mcp.json 2>/dev/null | grep -l matlab
76+
```
77+
78+
If the file exists and contains a `matlab` entry, flag it as a legacy artifact.
79+
80+
**Cleanup (Phase 3b-migrate):**
81+
82+
1. Confirm that the new MCP config has been written successfully (Step 3 of Phase 3b completed).
83+
2. Remove the `matlab` entry from `~/.claude/.mcp.json`. If `matlab` was the only entry, delete the file entirely. If other entries exist, remove only the `matlab` key and preserve the rest.
84+
85+
```bash
86+
# Check if matlab is the only server entry
87+
python3 -c "
88+
import json, os, sys
89+
p = os.path.expanduser('~/.claude/.mcp.json')
90+
with open(p) as f:
91+
data = json.load(f)
92+
servers = data.get('mcpServers', {})
93+
if 'matlab' in servers:
94+
del servers['matlab']
95+
if not servers:
96+
os.remove(p)
97+
print('Removed ~/.claude/.mcp.json (matlab was the only entry)')
98+
else:
99+
data['mcpServers'] = servers
100+
with open(p, 'w') as f:
101+
json.dump(data, f, indent=2)
102+
print('Removed matlab entry from ~/.claude/.mcp.json (preserved other entries)')
103+
"
104+
```
66105

67106
## Verification
68107

0 commit comments

Comments
 (0)