WolframMCP

sw1sh/WolframMCP

3.3

If you are the rightful owner of WolframMCP and would like to certify it and/or have it hosted online, please leave a comment on the right or send an email to henry@mcphub.com.

The Wolfram MCP Server is a Model Context Protocol server that integrates the Wolfram Engine for programmatic creation and editing of Wolfram Notebooks.

Tools
9
Resources
0
Prompts
0

Wolfram MCP Server

This project implements a Model Context Protocol (MCP) server that integrates the Wolfram Engine for creating and editing Wolfram Notebooks programmatically.

Features (Planned / Initial)

  • Evaluate Wolfram Language expressions via Wolfram Engine
  • Create new Wolfram Notebooks (.nb) with initial content
  • Append new cells to an existing notebook
  • Edit (replace) content of specific cells by index
  • List cells / export notebook as plain text or JSON structure

Requirements

  • Python 3.10+
  • Wolfram Engine installed and accessible via the wolframscript command (or set WOLFRAMSCRIPT_PATH)
  • mcp Python package

Installation

python -m pip install -e .[dev]

Running the Server

# stdio transport (default) - suitable for integration with MCP-aware clients
wolfram-mcp --kernel-path /Applications/Wolfram\ Engine/Contents/MacOS/WolframKernel --transport stdio

# or start an HTTP (Server-Sent Events) transport
wolfram-mcp --transport sse

If --kernel-path is omitted the Wolfram client will attempt to auto-discover a kernel. In stdio mode do not background the process; the client will own the stdio streams.

MCP Tools Exposed

ToolDescriptionArgs
evaluateEvaluate a Wolfram Language expressioncode (string)
create_notebookCreate a new notebook filepath, cells (optional list of cell contents)
append_cellAppend a new cell to existing notebookpath, cell
replace_cellReplace content of a notebook cell (by index)path, index, cell
list_cellsReturn JSON array of cell stringspath
export_notebookExport notebook to a given format (e.g. Plaintext, JSON)path, format
create_function_docCreate starter documentation notebook for a symbolsymbol, out_dir?
create_paclet_doc_skeletonScaffold paclet doc directory & guide notebookpaclet_name, out_dir?
pingHealth check(none)

Notebook Handling Strategy

We manipulate notebooks using Wolfram Language expressions invoked in batch mode via wolframscript. Edits are performed by importing the notebook, transforming the Cell[...] expressions, and exporting.

Security Considerations

Evaluating arbitrary code in Wolfram Engine is powerful; consider sandboxing or restricting input in production deployments.

Development

ruff check .
black .
pytest -q

License

MIT