Skip to content

Commit d85677e

Browse files
authored
Merge pull request #170 from WolframResearch/feature/rename-server-to-toolset
Add "Toolset" as canonical deployment property
2 parents 6335fad + e394529 commit d85677e

5 files changed

Lines changed: 164 additions & 96 deletions

File tree

Kernel/DeployAgentTools.wl

Lines changed: 12 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -49,6 +49,7 @@ $deploymentProperties = {
4949
"Skills",
5050
"Target",
5151
"Timestamp",
52+
"Toolset",
5253
"Tools",
5354
"UUID"
5455
};
@@ -117,11 +118,19 @@ getDeploymentProperty[ data_Association, "Target" ] := data[ "MCP", "Target"
117118
getDeploymentProperty[ data_Association, "Server" ] := data[ "MCP", "Server" ];
118119
getDeploymentProperty[ data_Association, "ConfigFile" ] := data[ "MCP", "ConfigFile" ];
119120

121+
(* Toolset: canonical name with fallback through legacy MCP/Server *)
122+
getDeploymentProperty[ data_Association, "Toolset" ] :=
123+
FirstCase[
124+
{ data[ "Toolset" ], data[ "MCP", "Server" ] },
125+
_String? StringQ,
126+
Missing[ "NotAvailable" ]
127+
];
128+
120129
(* Derived properties *)
121130
getDeploymentProperty[ data_Association, "Data" ] := data;
122131
getDeploymentProperty[ data_Association, "LLMConfiguration" ] := getDeploymentProperty[ data, "MCPServerObject" ][ "LLMConfiguration" ];
123132
getDeploymentProperty[ data_Association, "Location" ] := deploymentDirectory[ data[ "MCP", "ClientName" ], data[ "UUID" ] ];
124-
getDeploymentProperty[ data_Association, "MCPServerObject" ] := MCPServerObject @ data[ "MCP", "Server" ];
133+
getDeploymentProperty[ data_Association, "MCPServerObject" ] := MCPServerObject @ getDeploymentProperty[ data, "Toolset" ];
125134
getDeploymentProperty[ data_Association, "Properties" ] := $deploymentProperties;
126135
getDeploymentProperty[ data_Association, "Scope" ] := getDeploymentScope @ data[ "MCP", "Target" ];
127136
getDeploymentProperty[ data_Association, "Tools" ] := getDeploymentProperty[ data, "MCPServerObject" ][ "Tools" ];
@@ -198,7 +207,7 @@ deleteDeployment[ dep_AgentToolsDeployment ] := Enclose[
198207
Normal @ dep[ "MCP", "Options" ],
199208
Options @ UninstallMCPServer
200209
];
201-
catchAlways @ UninstallMCPServer[ dep[ "ConfigFile" ], dep[ "Server" ], Sequence @@ options ];
210+
catchAlways @ UninstallMCPServer[ dep[ "ConfigFile" ], dep[ "Toolset" ], Sequence @@ options ];
202211

203212
(* Remove deployment directory *)
204213
uuid = ConfirmBy[ dep[ "UUID" ], StringQ, "UUID" ];
@@ -305,6 +314,7 @@ deployAgentTools[ target_, server_MCPServerObject, opts0: $$deployAgentToolsOpti
305314
"Timestamp" -> Now,
306315
"PacletVersion" -> $pacletVersion,
307316
"CreatedBy" -> "DeployAgentTools",
317+
"Toolset" -> server[ "Name" ],
308318
"MCP" -> <|
309319
"ClientName" -> clientName,
310320
"Target" -> normalizedTarget,

Kernel/Formatting.wl

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -133,7 +133,7 @@ makeDeploymentSummaryRows // beginDefinition;
133133

134134
makeDeploymentSummaryRows[ dep_ ] := Flatten @ {
135135
summaryItem[ "ClientName", dep[ "ClientName" ] ],
136-
summaryItem[ "Server" , dep[ "Server" ] ]
136+
summaryItem[ "Toolset" , dep[ "Toolset" ] ]
137137
};
138138

139139
makeDeploymentSummaryRows // endDefinition;

Specs/DeployAgentTools.md

Lines changed: 7 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -184,6 +184,7 @@ AgentToolsDeployment[ <|
184184
"Timestamp" -> DateObject[ ... ],
185185
"PacletVersion" -> "1.8.0",
186186
"CreatedBy" -> "DeployAgentTools",
187+
"Toolset" -> "WolframLanguage",
187188
"MCP" -> <|
188189
"ClientName" -> "ClaudeDesktop",
189190
"Target" -> "ClaudeDesktop",
@@ -204,10 +205,11 @@ AgentToolsDeployment[ <|
204205
| `"Timestamp"` | `DateObject` recording when the deployment was created. |
205206
| `"PacletVersion"` | Paclet version string at the time of deployment. |
206207
| `"CreatedBy"` | Always `"DeployAgentTools"`. |
208+
| `"Toolset"` | Toolset name string (e.g. `"WolframLanguage"`). The canonical top-level name for the deployed MCP server. |
207209
| `"MCP"` | MCP server component data. |
208210
| `"MCP"/"ClientName"` | The canonical or inferred client name used for grouping and filtering (e.g. `"ClaudeDesktop"`). Falls back to `"Unknown"` when no client can be inferred. |
209211
| `"MCP"/"Target"` | The normalized user-facing target: a canonical client name string (e.g. `"ClaudeDesktop"`), a `{name, dir}` pair for project-level deployments (e.g. `{"ClaudeCode", "/path/to/project"}`), or `File[...]` for direct file targets. |
210-
| `"MCP"/"Server"` | Server name string (e.g. `"WolframLanguage"`). |
212+
| `"MCP"/"Server"` | Legacy toolset name key. Retained for backward compatibility with deployments written before the `"Toolset"` rename; new deployments keep writing this alongside the top-level `"Toolset"`. |
211213
| `"MCP"/"ConfigFile"` | `File[...]` pointing to the client's configuration file that was modified. This is the canonical identity used when checking for existing deployments. |
212214
| `"MCP"/"Options"` | The `InstallMCPServer` options that were used, stored for use by `DeleteObject`. |
213215
| `"Skills"` | Reserved for phase 2. Empty association in phase 1. |
@@ -230,7 +232,8 @@ dep["MCP", "Options"]
230232
| `"UUID"` | UUID string | `data["UUID"]` |
231233
| `"ClientName"` | Canonical or inferred client name string | `data["MCP", "ClientName"]` |
232234
| `"Target"` | Client name string or `File` | `data["MCP", "Target"]` |
233-
| `"Server"` | Server name string | `data["MCP", "Server"]` |
235+
| `"Toolset"` | Toolset name string | `data["Toolset"]`, falling back to legacy `data["MCP", "Server"]` |
236+
| `"Server"` | Legacy toolset name (alias for `"Toolset"`, retained for backward compatibility) | `data["MCP", "Server"]` |
234237
| `"ConfigFile"` | `File[...]` | `data["MCP", "ConfigFile"]` |
235238
| `"Scope"` | `"Global"`, `File[...]`, or `Missing["Unknown"]` | Derived from `data["MCP", "Target"]` |
236239
| `"Timestamp"` | `DateObject` | `data["Timestamp"]` |
@@ -261,15 +264,15 @@ AgentToolsDeployment /: DeleteObject[dep_AgentToolsDeployment] := catchTop[
261264

262265
The `deleteDeployment` function:
263266

264-
1. Calls `UninstallMCPServer[dep["ConfigFile"], dep["Server"], <filtered options>]` using `FilterRules[dep["MCP", "Options"], Options[UninstallMCPServer]]` to pass only `UninstallMCPServer`-valid options (e.g. `"ApplicationName"`, `"MCPServerName"`). This is wrapped in `catchAlways` to tolerate cases where the config has already been manually modified or removed.
267+
1. Calls `UninstallMCPServer[dep["ConfigFile"], dep["Toolset"], <filtered options>]` using `FilterRules[dep["MCP", "Options"], Options[UninstallMCPServer]]` to pass only `UninstallMCPServer`-valid options (e.g. `"ApplicationName"`, `"MCPServerName"`). This is wrapped in `catchAlways` to tolerate cases where the config has already been manually modified or removed.
265268
2. Deletes the deployment directory: `DeleteDirectory[deploymentDirectory[dep["UUID"]], DeleteContents -> True]`.
266269
3. Returns `Null`.
267270

268271
### Formatting
269272

270273
`MakeBoxes` is defined via an UpValue using ``BoxForm`ArrangeSummaryBox``:
271274

272-
- **Summary rows**: ClientName, Server
275+
- **Summary rows**: ClientName, Toolset
273276
- **Hidden rows**: Scope, ConfigFile, Tools
274277

275278
---

0 commit comments

Comments
 (0)