You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: .claude-plugin/marketplace.json
+2-2Lines changed: 2 additions & 2 deletions
Original file line number
Diff line number
Diff line change
@@ -7,7 +7,7 @@
7
7
"plugins": [
8
8
{
9
9
"name": "toolkit",
10
-
"version": "0.2.0",
10
+
"version": "0.2.1",
11
11
"description": "Setup and management for the MATLAB Agentic Toolkit. Detects MATLAB, installs the MCP server, registers the Claude Code plugin, and verifies the environment.",
12
12
"author": {
13
13
"name": "MathWorks"
@@ -20,7 +20,7 @@
20
20
},
21
21
{
22
22
"name": "matlab-core",
23
-
"version": "0.2.0",
23
+
"version": "0.2.1",
24
24
"description": "MATLAB skills and MCP tools for AI coding agents. Testing, debugging, reviewing code, creating Live Scripts, building apps, and modernizing code.",
@@ -94,7 +94,7 @@ Setup writes two things: an MCP server configuration (so your agent can talk to
94
94
95
95
### Platform-Specific Notes
96
96
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.
98
98
99
99
**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").
100
100
@@ -308,6 +308,38 @@ The MCP server binary is released independently from the toolkit. To update it:
308
308
309
309
---
310
310
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.
| 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).
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.
Copy file name to clipboardExpand all lines: skills-catalog/toolkit/matlab-agentic-toolkit-setup/SKILL.md
+96-2Lines changed: 96 additions & 2 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -4,7 +4,7 @@ description: Install and configure the MATLAB Agentic Toolkit — detect MATLAB,
4
4
license: MathWorks BSD-3-Clause
5
5
metadata:
6
6
author: MathWorks
7
-
version: "1.0"
7
+
version: "1.1"
8
8
---
9
9
10
10
# MATLAB Agentic Toolkit Setup
@@ -17,6 +17,38 @@ Automated onboarding for the MATLAB Agentic Toolkit. Detects MATLAB, downloads a
17
17
18
18
This skill does NOT require the MATLAB MCP server — it uses shell commands for everything until the final verification step.
19
19
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
+
20
52
## When to Use
21
53
22
54
- 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
46
78
47
79
## Phase 1: Discovery
48
80
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
+
49
83
Run all of these checks silently — do not prompt the user during this phase. Collect all results for presentation in Phase 2.
50
84
51
85
### 1a. Detect platform
@@ -107,6 +141,12 @@ For other platforms, check if their global config files already have a `matlab`
107
141
108
142
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.
109
143
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
+
110
150
---
111
151
112
152
## Phase 2: Plan
@@ -135,6 +175,7 @@ Proposed actions:
135
175
MCP server: Download v0.7.0 to ~/.local/bin/matlab-mcp-core-server
136
176
Display mode: nodesktop (MATLAB runs headless; windows still open for plots)
137
177
Agent config: Configure MCP server globally (available in all sessions)
178
+
Migration: (none)
138
179
139
180
Proceed with this plan? You can adjust any choice:
140
181
- Pick a different MATLAB: "use 2" or provide a path
@@ -143,6 +184,8 @@ Proceed with this plan? You can adjust any choice:
143
184
- Configure a different agent: "use Cursor" or "use Amp"
144
185
```
145
186
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
+
146
189
For non-Claude platforms, clearly note "EXPERIMENTAL — untested, provided as-is" and that manual fallback will be provided if automated setup fails.
147
190
148
191
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
170
213
171
214
## Phase 3: Execute
172
215
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
+
173
218
Carry out the approved plan. Do NOT prompt the user during this phase — all decisions were made in Phase 2.
If download fails, provide the direct URL for manual download.
190
235
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
+
191
240
### 3b-shared. Register global skills (Copilot, Codex, Gemini)
192
241
193
242
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:
251
300
- File path: `~/.vscode/settings.json`
252
301
- MATLAB entry was added/updated
253
302
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
+
254
344
#### Other platforms
255
345
256
346
**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>`.
257
347
258
348
| Platform | Reference file |
259
349
|----------|---------------|
260
-
| Claude Code |`reference/claude-code-setup-guidance.md`|
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
+
293
385
---
294
386
295
387
## Phase 4: Verify
296
388
389
+
Print a brief status message: **"Setup is done — verifying the connection to MATLAB."**
Copy file name to clipboardExpand all lines: skills-catalog/toolkit/matlab-agentic-toolkit-setup/reference/claude-code-setup-guidance.md
+54-15Lines changed: 54 additions & 15 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -6,11 +6,11 @@ This reference file contains Claude Code-specific instructions for Phase 3b of t
6
6
7
7
## Overview
8
8
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 `claudemcp add` CLI command, which writes to the correct location automatically.
10
10
11
11
## Global Config Path
12
12
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.
14
14
15
15
## Phase 3b: Register Plugin
16
16
@@ -31,22 +31,19 @@ claude plugin install toolkit@matlab-agentic-toolkit
31
31
32
32
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.
33
33
34
-
### Step 3: Write MCP server config
34
+
### Step 3: Register MCP server
35
35
36
-
Write `~/.claude/.mcp.json` with the detected binary path and MATLAB root:
36
+
Use the `claudemcp add` CLI to register the MATLAB MCP server at user scope (available in all projects):
claude mcp add-json -s user matlab '{"command":"<MCP_SERVER_PATH>","args":["--matlab-root","<MATLAB_ROOT>","--matlab-display-mode","<DISPLAY_MODE>"]}'
47
40
```
48
41
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).
50
47
51
48
### Step 4: Verify plugin installation
52
49
@@ -62,7 +59,49 @@ If `claude` CLI commands fail (e.g., not available in the user's Claude Code ver
62
59
63
60
1. Report the error clearly
64
61
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`.
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)')
0 commit comments