Add EnableLLMKit option to InstallMCPServer#209
Merged
Conversation
Temporarily sets (or, with value None, unsets) a process environment
variable for the duration of an evaluation, restoring the previous value
afterward via WithCleanup. Unlike Block[{Environment}, ...], it sets the
real variable so every Environment[...] read under the evaluation behaves
naturally.
Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
The new "EnableLLMKit" option (default Automatic, equivalent to True) controls whether the LLMKit-backed features of the context tools (WolframContext, WolframAlphaContext, WolframLanguageContext) are enabled for an installed server. Setting it to False injects LLMKIT_ENABLED=false into the MCP config's env block, mirroring the EnableMCPApps / MCP_APPS_ENABLED pattern. At runtime, llmKitEnabledQ reads the variable and gates the no-argument llmKitSubscribedQ, so the context tools behave as if the user has no LLMKit subscription -- returning unfiltered documentation and omitting the Wolfram|Alpha section -- while suppressing the subscription warnings and short-circuiting before any cloud lookup. At install time the requirement check is skipped so a server with an LLMKit-required tool installs without a subscription failure. Includes tests and documentation (README, docs/mcp-clients.md, and the InstallMCPServer reference page). Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Contributor
There was a problem hiding this comment.
Pull request overview
This PR introduces an "EnableLLMKit" option to InstallMCPServer to control whether LLMKit-backed context-tool behavior is enabled for an installed server by injecting LLMKIT_ENABLED=false into the server environment, mirroring the existing "EnableMCPApps" pattern.
Changes:
- Added runtime gating via
llmKitEnabledQ[]and updatedllmKitSubscribedQ[]to short-circuit when LLMKit is disabled. - Updated context-tool behavior to suppress subscription warnings/WA section when disabled.
- Added/updated tests and documentation for the new option and environment variable.
Reviewed changes
Copilot reviewed 10 out of 11 changed files in this pull request and generated 3 comments.
Show a summary per file
| File | Description |
|---|---|
| Tests/Utilities.wlt | Adds tests for llmKitEnabledQ and llmKitSubscribedQ short-circuit behavior. |
| Tests/Tools.wlt | Adds coverage for context-tool output when LLMKit is disabled vs genuinely unsubscribed. |
| Tests/InstallMCPServer.wlt | Adds tests for "EnableLLMKit" env injection and requirement-check guarding (but currently contains widespread syntax corruption in TestID lines). |
| Tests/Common.wl | Adds environmentBlock helper to set/unset real process environment variables during tests. |
| README.md | Documents "EnableLLMKit" option in the InstallMCPServer options table. |
| Kernel/Utilities.wl | Implements llmKitEnabledQ[] and gates llmKitSubscribedQ[] on enablement. |
| Kernel/Tools/Context.wl | Suppresses Wolfram |
| Kernel/InstallMCPServer.wl | Adds "EnableLLMKit" option, install-time guard, and env-var injection logic. |
| Kernel/CommonSymbols.wl | Declares llmKitEnabledQ as a shared symbol. |
| Documentation/English/ReferencePages/Symbols/InstallMCPServer.nb | Updates reference-page options table to include EnableLLMKit. |
| docs/mcp-clients.md | Documents LLMKIT_ENABLED env var and "EnableLLMKit" option behavior. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
rhennigan
commented
Jul 3, 2026
Replace the manual StringQ/StringMatchQ check with
Interpreter["Boolean"][Environment["LLMKIT_ENABLED"]] =!= False, per PR
review. Preserves all existing behavior (unset -> enabled, "false"
case-insensitive -> disabled, "true"/"1" -> enabled) and additionally
treats other falsy values ("no", "0", ...) as disabling. Update docs and
add tests for the broadened semantics.
Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
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.
Summary
Adds an
"EnableLLMKit"option toInstallMCPServer, following the existing"EnableMCPApps"pattern: the option sets anLLMKIT_ENABLEDenvironment variable in the MCP config, which is checked at runtime.Automatic(default)True— no env var injected; LLMKit works as beforeTrueFalseLLMKIT_ENABLED=false. The context tools (WolframContext,WolframAlphaContext,WolframLanguageContext) then behave as if the user has no LLMKit subscription — unfiltered documentation, no Wolfram|Alpha semantic results — but with no subscription warnings, and the install-time subscription check is skippedImplementation
llmKitEnabledQ[](Utilities.wl, declared inCommonSymbols.wl) readsLLMKIT_ENABLED, mirroringmcpAppsEnabledQ. The no-argllmKitSubscribedQ[]now short-circuits toFalsewhen disabled, so it never even makes the cloud lookup and every context tool takes the unsubscribed path.relatedWolframAlphaPrompt[…, False]returns""when LLMKit is disabled (vs. the subscribe-here message when genuinely unsubscribed), so the combined tool just omits the Wolfram|Alpha section.$enableLLMKitconfig var +Blockbindings;addEnvironmentVariablesinjects the env var onFalse; a guard clause oncheckLLMKitRequirementsreturnsNonewhen disabled. Injection is centralized, so all client formats (Codex, Goose, Continue, Augment, generic) get it.Test plan
All tests pass (100%) across the affected suites (run via the
TestReportMCP tool /wolframscript -f Scripts/TestPaclet.wls Tests/<file>.wlt). New tests cover:llmKitEnabledQ— env-var truth table (unset → enabled;false/False/FALSE→ disabled; other values → enabled).llmKitSubscribedQgating — returnsFalsewhen disabled and short-circuits beforegetLLMKitInfo[](no cloud lookup).LLMKIT_ENABLED=falsepresent forEnableLLMKit -> False; absent for default /True/Automatic.EnableLLMKit -> False,checkLLMKitRequirementsreturnsNonewithout consultingllmKitSubscribedQ(a WolframAlpha-required tool installs without a subscription failure).environmentBlocktest helper — self-test confirms it sets and restores the real process environment.CodeInspectoris clean on all modified source files.Docs
Updated
README.md,docs/mcp-clients.md(env-var table + option section), and theInstallMCPServerreference page.Related issue
None.
🤖 Generated with Claude Code