home / mcp / mathematica documentation mcp server

Mathematica Documentation MCP Server

MCP server for checking Mathematica documentation via local MMA installation

Installation
Add the following to your MCP client configuration file.

Configuration

View docs
{
  "mcpServers": {
    "benhaotang-mcp-mma-docs": {
      "command": "uv",
      "args": [
        "run",
        "--with",
        "mcp",
        "mcp",
        "run",
        "/path/to/mcp-mma-doc.py"
      ],
      "env": {
        "WOLFRAMSCRIPT_PATH": "/usr/bin/wolframscript"
      }
    }
  }
}

You can run the Mathematica Documentation MCP Server to expose Mathematica documentation data and tooling through the MCP framework. This server lets you query docs, list package symbols, and generate or augment documentation via built-in tools, all accessible from MCP clients and workflows.

How to use

Start the server using the MCP command-line interface you already have installed. The server is designed to be invoked via the MCP runner so you can integrate it with your existing tooling. Once running, you can use your MCP client to request documentation data (for functions and packages) and to enumerate symbols in Mathematica-related packages. You can also leverage the tooling to obtain or parametrize documentation snippets for your own workflows.

How to install

Prerequisites you need before installing and running this MCP server:

  • Python 3.x installed on your system
  • pip (for installing dependencies)
  • Wolfram product installed or wolframscript callable from terminal

Install Python dependencies from the project requirements file, then prepare to run or install this MCP server in your environment.

Typical steps to get the server up and running in your environment include initializing or installing the server using the MCP CLI and then starting it with the appropriate runtime command. Follow these concrete steps to set up the server in your environment.

Additional sections

Configuration and runtime notes help you tailor how the server runs within your environment.

Environment variable for custom wolframscript path is supported. If wolframscript is not in your system path, you can point the server to its location using an environment variable or your MCP config.

Known issues and considerations are included to help you anticipate common edge cases and understand the behavior of the MCP client tooling during use.

{
  "mcpServers": [
    {
      "type": "stdio",
      "name": "mathematica_docs",
      "command": "uv",
      "args": [
        "run",
        "--with",
        "mcp",
        "mcp",
        "run",
        "/path/to/mcp-mma-doc.py"
      ],
      "env": []
    },
    {
      "type": "stdio",
      "name": "mathematica_docs_local",
      "command": "/path/to/mcp",
      "args": [
        "run",
        "/path/to/mcp-mma-doc.py"
      ],
      "env": []
    }
  ],
  "envVars": [
    {
      "name": "WOLFRAMSCRIPT_PATH",
      "description": "Path to wolframscript if not in system PATH",
      "required": true,
      "example": "/usr/bin/wolframscript"
    }
  ]
}

Troubleshooting and tips

If you encounter non-blocking console messages during request processing, you can generally ignore informational debug lines that do not affect function calls. These messages originate from the CLI parsing layer and may appear alongside normal operation.

Available tools

get_docs

Fetch documentation for a symbol or function. Supports factory functions, addon-backed functions, and package-backed functions. Basic usage: get_docs("Plot"). With package: get_docs("WeightSystem", packages=["LieART"]). With addon: get_docs("FCFeynmanParametrize", packages=["FeynCalc"], load_addons=["FeynArts"])

list_package_symbols

List all symbols/functions in a given package. Basic usage: list_package_symbols("FeynCalc").