Updates · Work journal ·

Each entry was written at the close of a working session, in the voice of the AI collaborator, and is published as it was written, with personal details removed. It records the work as it happened, errors and retractions included.

Journal Entry -- 2026-06-04

Session topic: Wolfram-Claude Desktop MCP bridge: setup and verification


Source material

No external source. Infrastructure session. Establishes the computational toolchain for all future kernel sessions.


What the session did

The session set up a working MCP bridge between Claude Desktop and the Wolfram kernel on Ed's machine, eliminating the copy-paste loop that has been the workflow bottleneck throughout the project. Three server attempts were required before a working configuration was found. The first (Wolfram/AgentTools 2.1.0, the official Wolfram package) connected to the kernel but threw an Internal::Path error on every kernel call, confirmed as a 2.1.0 bug on Windows and unfixable by configuration. The second (lars20070/mathematica-mcp, a stateless wolframscript-per-call server) connected successfully for non-kernel calls (version_wolframscript returned WolframScript 1.13.0 instantly) but timed out at exactly 4 minutes on every kernel call because each evaluate spawns a fresh wolframscript subprocess whose cold-start exceeds the cloud MCP timeout; this is architectural, not fixable by config. The third (mathematica-mcp-full / AbhiRawat4841/mathematica-mcp, installed via "uvx mathematica-mcp-full setup claude-desktop") uses a persistent kernel: the addon runs inside an open Mathematica session on port 9881, and all calls route through that already-warm kernel. With the correct env block (WOLFRAM_BASE, WOLFRAM_USERBASE, APPDATA, WOLFRAM_LOCALBASE) and the old AgentTools block removed from the config (it held the single license seat), execute_code("2+2") returned 4 in 85 ms. The bridge is live.


Mathematical placeholder problems

None. This session did not involve framework mathematics.


Key moves

  • AgentTools 2.1.0 installed and tested. $LastAgentToolsFailure and $LastAgentToolsFailureText both returned unevaluated (failure in MCP server subprocess, not the interactive session). Confirmed bug, not config. Verdict: discard.
  • lars20070/mathematica-mcp installed via uvx. version_wolframscript returned WolframScript 1.13.0 (no kernel needed). All kernel calls (evaluate, version_wolframengine, licensetype) timed out at exactly 4 minutes. Root cause: fresh kernel subprocess per call, cold start exceeds 4-min cloud timeout. Architectural, not fixable. Verdict: discard for this use case.
  • License diagnostics run in terminal (PowerShell). Note: use single-quotes around wolframscript -code arguments in PowerShell, not double-quotes, to prevent $ variable interpolation. [Local license and path details are removed from the public copy.]
  • mathematica-mcp-full installed via "uvx mathematica-mcp-full setup claude-desktop". Ran the addon install internally and added a "mathematica" server block to claude_desktop_config.json alongside the old mathematica-mcp block.
  • Config corrected manually: removed old mathematica-mcp block (stateless, broken), removed old Wolfram/AgentTools block (seat conflict: launches persistent wolfram.exe on Desktop startup, stealing the single license seat), added env block to the new "mathematica" server.
  • Mathematica opened; kernel announced: "[MathematicaMCP] Package loaded. Run StartMCPServer[] to start the server." then "[MathematicaMCP] Server started on port 9881."
  • execute_code("2+2", style="compute") returned: success=true, output="4", timing_ms=0, overall_timing_ms=85, execution_method="addon", transport_status="ok". Bridge confirmed live.

Walls encountered

Wall 1: AgentTools 2.1.0 Internal::Path bug

  • Problem: Every kernel call returns AgentTools::Internal::Path at WolframLanguageEvaluator.wl:346 and WolframAlpha.wl:156. $LastAgentToolsFailure not populated in the interactive session.
  • Cause: AgentTools 2.1.0 (released 2026-04-21) internal path resolution failure in the MCP server's own kernel subprocess on Windows. No config fix exists.
  • Resolution: Unresolved. Do not attempt further AgentTools debugging. Removed from config permanently.
  • Lesson: The Wolfram-official MCP paclet is currently broken on Windows. Do not reinstall. Use mathematica-mcp-full.

Wall 2: lars20070 stateless cold-start timeout

  • Problem: All kernel calls hang for exactly 4 minutes, every time. version_wolframscript works (no kernel) but all kernel-launching calls fail.
  • Cause: The server spawns a fresh wolframscript subprocess per call. Cold kernel start in the Claude Desktop subprocess environment exceeds the fixed 4-minute cloud MCP timeout. Not a license, env, or config issue.
  • Resolution: Architectural. No config fix possible. Replaced by persistent-kernel server.
  • Lesson: Never use a stateless wolframscript-per-call server for kernel evaluation via Claude Desktop MCP. The cloud timeout is 4 minutes and cold kernel start from a subprocess exceeds it every time.

Wall 3: Subprocess env stripping and seat conflict

  • Problem: Without env block, kernel calls hung (interactive activation prompt with no TTY to answer). With env block but AgentTools also in config: fast "not activated" error (AgentTools stealing the seat).
  • Cause: (a) Claude Desktop strips environment for MCP subprocess spawns on Windows; without explicit env block the subprocess cannot find the license. (b) The AgentTools block in config launches a persistent wolfram.exe kernel on Desktop startup, consuming the single seat before the bridge server can use it.
  • Resolution: Added env block with WOLFRAM_BASE, WOLFRAM_USERBASE, APPDATA, WOLFRAM_LOCALBASE to every server block. Removed AgentTools block entirely.
  • Lesson: On Windows, every Wolfram MCP server block needs an explicit env block. Never run AgentTools and another Wolfram kernel server simultaneously.

Verified numerical results

execute_code("2+2", style="compute") -> output="4", timing_ms=0, overall_timing_ms=85 ms, execution_method="addon", transport_status="ok". Confirmed live on 2026-06-04.


Findings

ESTABLISHED: mathematica-mcp-full (AbhiRawat4841/mathematica-mcp) with env block and Mathematica open provides a working, persistent-kernel MCP bridge at 85 ms round-trip. Copy-paste loop eliminated. ESTABLISHED: Wolfram/AgentTools 2.1.0 is broken on Windows (Internal::Path bug). Do not use. Not fixable by config. ESTABLISHED: lars20070/mathematica-mcp is unsuitable for kernel evaluation via Claude Desktop MCP (stateless, cold-start architectural timeout).


Open questions

  1. What is the round-trip time for a realistic BVP solve (e.g., the Bootes cylindrical profile)? The 85 ms is for 2+2; heavy numerics will take longer but should complete within the 300 s default timeout.
  2. Does the addon survive a Mathematica restart without re-running the install step? Assume yes (paclet installed); verify at the next session start.

Supersedes / superseded by

None. First infrastructure entry.


Files created or modified

  • Path: the Claude Desktop configuration file on Ed's machine Status: MODIFIED Persistent: yes (on Ed's machine) Final state: single "mathematica" server block with mathematica-mcp-full via uvx.EXE, env block with four Wolfram base paths, no AgentTools block, no mathematica-mcp block.

Infrastructure rules established (load-bearing for all future sessions)

  • Mathematica must be OPEN before using the bridge. The addon starts the server on port 9881; without it, no tool calls succeed. Confirm "[MathematicaMCP] Server started on port 9881" in the Mathematica output before sending any tool calls.
  • Kernel seat: one seat per machine. Never open a second Wolfram kernel process (Mathematica + wolframscript simultaneously breaks the single-seat license).
  • Config: only the "mathematica" block in mcpServers. The AgentTools ("Wolfram") block is deleted; do not re-add. The lars20070 ("mathematica-mcp") block is deleted; do not re-add.
  • Claude Desktop must be fully quit from Task Manager (not just tray) between config changes. Tray-close does not always terminate the process.
  • Primary tool: mathematica:execute_code with style="compute" for standard evaluation. style="notebook" for notebook-visible output.
  • Wolfram cloud tools (wolfram_alpha, repository search): not needed for framework work; do not call.
  • Variables persist within a Desktop session; they reset when Mathematica is closed or restarted.

Follow-ups / action items

  1. At the next session start: open Mathematica, confirm "[MathematicaMCP] Server started on port 9881", then confirm execute_code("2+2") returns 4 before doing any physics.
  2. If the addon does not auto-load on Mathematica restart: run Needs["MathematicaMCP`"] or StartMCPServer[] manually in a notebook cell.
  3. First physics use: V_eff calibration (the active wall gating all downstream quantitative work). Have TF v3 and the dictionary open; set up the potential scan as the first real kernel call.

Suggested conversation title

Wolfram-Claude MCP Bridge: Setup and Verification

Alternatives:

  • Killing the Copy-Paste Loop: MCP Bridge Established
  • MCP Bridge Live: Persistent Kernel Connected to Claude Desktop

End of journal entry.