Skip to content

Add WolframCommand option to InstallMCPServer - #239

Merged
rhennigan merged 6 commits into
mainfrom
feature/wolfram-command-option
Sep 1, 2026
Merged

rhennigan merged 6 commits into
mainfrom
feature/wolfram-command-option

Conversation

@rhennigan

Copy link
Copy Markdown
Member

No description provided.

cc-wr and others added 4 commits August 26, 2026 08:45
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
Copilot AI lite review requested due to automatic review settings September 1, 2026 11:21

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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 InstallMCPServer options 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.

Comment thread Kernel/InstallMCPServer.wl Outdated
Comment thread Kernel/MCPServerObject.wl
Comment thread Kernel/InstallMCPServer.wl Outdated
rhennigan and others added 2 commits September 1, 2026 13:16
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

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Copilot reviewed 6 out of 7 changed files in this pull request and generated no new comments.

@rhennigan
rhennigan merged commit 0f311d6 into main Sep 1, 2026
1 of 2 checks passed
@rhennigan
rhennigan deleted the feature/wolfram-command-option branch September 1, 2026 16:18
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants