Repository navigation
Add WolframCommand option to InstallMCPServer - #239
Merged
Merged
Conversation
The "command" field of a generated client configuration comes from getWolframCommand, which is hard-wired to $InstallationDirectory for the current operating system. A new "WolframCommand" option overrides it, so a standalone executable can be launched in place of the local Wolfram kernel. The value is written verbatim into the JSON configuration, so it reaches every client format, including the Codex, Goose, Continue, AugmentCodeIDE and OpenCode writers, and the command line arguments are left untouched. - Kernel/MCPServerObject.wl: $wolframCommand (default Automatic) is consulted by getWolframCommand; the per-OS rules remain the fallback. A non-Automatic value is passed through unchecked and is still caught by the existing StringQ confirmation in makeJSONConfiguration - Kernel/InstallMCPServer.wl: "WolframCommand" option, bound in the install Block alongside the other install-scoped settings - Kernel/CommonSymbols.wl: declare $wolframCommand, which has to be shared because getWolframCommand and the option are read in different packages - docs/deploy-agent-tools.md: list the new option DeployAgentTools needs no change: it already admits and forwards any InstallMCPServer option, including through the DeployAgentTools[All] fan-out, and records it in the deployment. Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01D1dm438ywd6CbX53VM4m1z
Contributor
There was a problem hiding this comment.
Pull request overview
This PR extends the MCP server installation flow to allow callers to override the executable used to launch the server (“WolframCommand”) and to customize the command-line arguments written into generated MCP client configurations.
Changes:
- Add
InstallMCPServeroptions for"WolframCommand"and"CommandLineArguments", wiring them through to configuration generation. - Update MCP client JSON configuration generation to use an overridden
"args"list when provided. - Document the newly supported options in the deployment docs.
Reviewed changes
Copilot reviewed 4 out of 4 changed files in this pull request and generated 2 comments.
| File | Description |
|---|---|
| Kernel/MCPServerObject.wl | Adds override hooks for command/args and uses them when generating "JSONConfiguration". |
| Kernel/InstallMCPServer.wl | Introduces new options and plumbs them via Block into installation/config generation. |
| Kernel/CommonSymbols.wl | Declares shared symbols for the new override variables. |
| docs/deploy-agent-tools.md | Updates the list of forwarded InstallMCPServer options. |
Suppressed comments (2)
Kernel/InstallMCPServer.wl:77
- "WolframCommand" and "CommandLineArguments" are accepted and then passed through via $wolframCommand/$commandLineArguments without any option-value validation here. If a caller passes an unexpected type, the failure will surface later as an internal Confirm/Enclose failure (less actionable than a targeted option error). Consider validating these OptionValue results up front (and adding dedicated messages like InvalidWolframCommand / InvalidCommandLineArguments).
$installToolOptions = validateToolOptions[ OptionValue[ "ToolOptions" ], server ],
$installMCPServerName = OptionValue[ "MCPServerName" ],
$submitUsageData = validateSubmitUsageData @ OptionValue[ "SubmitUsageData" ],
$wolframCommand = OptionValue[ "WolframCommand" ],
$commandLineArguments = OptionValue[ "CommandLineArguments" ]
Kernel/InstallMCPServer.wl:44
- New options ("WolframCommand" / "CommandLineArguments") introduce new installation behavior, but the existing test suite for InstallMCPServer doesn’t get updated here to cover them. Adding a couple of unit tests that assert these options appear in Options[...] and are written into the resulting client config would prevent regressions.
InstallMCPServer // Options = {
"ApplicationName" -> Automatic,
"CommandLineArguments" -> Automatic,
"DevelopmentMode" -> False,
"EnableLLMKit" -> Automatic,
💡 Add a code-review agent skill for context-aware, tailored reviews. Learn more in the docs.
rhennigan
commented
Sep 1, 2026
InstallMCPServer now rejects a "WolframCommand" that is not a string or Automatic and a "CommandLineArguments" value that is not a list of strings or Automatic, issuing InvalidWolframCommand/InvalidCommandLineArguments before anything is written. makeJSONConfiguration also guards the resolved args with a ConfirmMatch so a bad value reaching it from elsewhere is an internal failure rather than a structurally invalid client configuration. Co-Authored-By: Claude Fable 5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01DcWBhrjm8U7H4GaTiSePrT
Describe "CommandLineArguments" alongside the other options in the InstallMCPServer header comment (expected shape, the empty-list case, and the precedence of "DevelopmentMode"), and give both "WolframCommand" and "CommandLineArguments" their own sections in docs/mcp-clients.md. Co-Authored-By: Claude Fable 5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01DcWBhrjm8U7H4GaTiSePrT
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
No description provided.