Skip to main content
Glama

Mathematica MCP Server

codecov Build Python Version License PyPI version

MCP server that wraps Mathematica's wolframscript command-line interface. It provides tools to evaluate Wolfram Language code and retrieve information about the Wolfram Engine installation.

Tool

Description

evaluate

Evaluates a Wolfram Language script

version_wolframscript

Returns version of wolframscript

version_wolframengine

Returns version of Wolfram Engine

licensetype

Returns license type of Wolfram Engine

Background

  • Wolfram Language: symbolic programming language e.g. Integrate[x*Sin[x], x]

  • Wolfram Engine: kernel for running Wolfram Language code

  • WolframScript: command-line interface to Wolfram Engine

  • Mathematica: notebook interface to Wolfram Engine

Both Wolfram Engine and WolframScript are freely available for personal use.

Related MCP server: Mathematica MCP Server

Installation

  1. Please ensure WolframScript is installed and activated on your system.

wolframscript -version
wolframscript -activate
wolframscript -code "Integrate[x*Sin[x], x]"
  1. Install the uv package manager.

curl -LsSf https://astral.sh/uv/install.sh | sh
  1. Edit the Claude Desktop config file and add the mathematica-mcp server. Note that uvx sets up an environment, installs the mathematica-mcp package, and runs the server by calling the mathematica-mcp entry point defined in pyproject.toml. No cloning of the repository is necessary. The logs are written to the default user log directory, e.g. ~/Library/Logs/mathematica_mcp/mathematica_mcp.log on macOS.

{
  "mcpServers": {
    "mathematica-mcp": {
      "command": "uvx",
      "args": [
        "mathematica-mcp"
      ]
    }
  }
}

Claude Desktop config file on macOS: ~/Library/Application Support/Claude/claude_desktop_config.json

  1. Alternatively, you can clone the repository and then modify or extend the MCP server code. In this case, make sure to update the path to the local repository in the Claude Desktop config file.

{
  "mcpServers": {
    "mathematica-mcp": {
      "command": "uv",
      "args": [
        "--directory",
        "/Users/lars/Code/mathematica-mcp",
        "run",
        "mathematica-mcp"
      ]
    }
  }
}

Claude Desktop config file on macOS: ~/Library/Application Support/Claude/claude_desktop_config.json

Available Tools

4 tools
evaluateA

Evaluate a Wolfram Language script by running the wolframscript -print -file <script> command.

Documentation for Wolfram Language: https://context7.com/websites/reference_wolfram_language/llms.txt

IMPORTANT: The tool is returning the result of the last line executed in the script, and any expression printed explicitly with Print[].

Arguments: script (str): Wolfram Language script to execute.

Returns: str: The result of the Wolfram Language script as a string.

ParametersJSON Schema
NameRequiredDescriptionDefault
scriptYes

Output Schema

ParametersJSON Schema
NameRequiredDescription
resultYes

TDQS

A4.2/5.0
Behavior4/5

Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?

Discloses that it runs wolframscript command, returns last line of execution and Print[] outputs. No annotations provided, so description carries burden, and it does so adequately though it omits potential side effects or error handling.

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness3/5

Is the description appropriately sized, front-loaded, and free of redundancy?

Includes multiple examples and documentation link, which are helpful but make the description longer than necessary. Could be more concise while retaining clarity.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness4/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

Covers the essential behavior for a single-parameter tool with a string return. Lacks details on error handling or timeouts, but is sufficient given the tool's simplicity and presence of an output schema (though not shown explicitly).

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters4/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

The single 'script' parameter is explained as a Wolfram Language script, with examples illustrating usage. Schema description coverage is 0%, so description adds significant value beyond the schema.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose5/5

Does the description clearly state what the tool does and how it differs from similar tools?

The description clearly states it evaluates a Wolfram Language script by running a specific command, distinguishing it from sibling tools (licensetype, version_*) that handle license/version queries.

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines4/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

Provides clear guidance on output behavior (last line result and Print[] outputs) and includes a documentation link. Does not explicitly state when not to use or compare to alternatives, but siblings are distinct enough.

Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.

licensetypeA

Get the license type of the Wolfram Engine.

Returns: str: License type of the Wolfram Engine e.g. 'Professional'.

ParametersJSON Schema
NameRequiredDescriptionDefault

No parameters

Output Schema

ParametersJSON Schema
NameRequiredDescription
resultYes

TDQS

A4.5/5.0
Behavior4/5

Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?

No annotations are provided, so the description carries the burden of behavioral disclosure. It states the return type (str) and implies a read-only operation, but lacks explicit mention of side effects like destructive behavior. However, for a simple getter, it is sufficiently transparent.

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness5/5

Is the description appropriately sized, front-loaded, and free of redundancy?

The description is extremely concise with only two sentences, front-loading the purpose. Every sentence is informative and without unnecessary detail.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness5/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

Given the simplicity of the tool (no parameters, no nested objects), the description is complete. An output schema exists, but the description already specifies the return type, making it fully informative.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters4/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

The input schema has no parameters, and schema coverage is 100%. The description adds no parameter details because none are needed. It is concise and provides no gaps.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose5/5

Does the description clearly state what the tool does and how it differs from similar tools?

Description clearly states 'Get the license type of the Wolfram Engine' with a specific verb and resource, and it is distinct from sibling tools like evaluate, version_wolframengine, and version_wolframscript.

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines4/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

The description implicitly indicates when to use this tool (when needing the license type). While it does not explicitly state when not to use it or provide alternatives, the context is clear enough for an agent to differentiate.

Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.

version_wolframengineA

Get the version of the Wolfram Engine.

Returns: str: Version of the Wolfram Engine.

ParametersJSON Schema
NameRequiredDescriptionDefault

No parameters

Output Schema

ParametersJSON Schema
NameRequiredDescription
resultYes

TDQS

A4.1/5.0
Behavior3/5

Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?

No annotations provided, so description carries full burden. It states the return type (str) but does not disclose potential behaviors like network requirements, error states, or side effects. For a version check, this is minimally adequate.

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness5/5

Is the description appropriately sized, front-loaded, and free of redundancy?

The description is extremely concise with two sentences, front-loading the action and then stating the return format. No wasted text.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness5/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

For a simple tool with no parameters and an output schema, the description completely covers its purpose and return value. No further information is necessary.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters4/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

No parameters exist in the input schema, so schema coverage is 100%. The description adds no additional parameter information because none is needed. Baseline for zero parameters is 4.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose5/5

Does the description clearly state what the tool does and how it differs from similar tools?

The description clearly states 'Get the version of the Wolfram Engine', using a specific verb and resource. The sibling version_wolframscript suggests differentiation between engine and script versions, making it easy to select the correct tool.

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines3/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

No explicit guidance on when to use this tool versus alternatives like evaluate or licensetype, but the purpose is simple and self-explanatory. Implied usage for checking the engine version.

Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.

version_wolframscriptA

Get the version of the wolframscript tool.

Returns: str: Version of the wolframscript tool.

ParametersJSON Schema
NameRequiredDescriptionDefault

No parameters

Output Schema

ParametersJSON Schema
NameRequiredDescription
resultYes

TDQS

A4.6/5.0
Behavior4/5

Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?

No annotations are provided, so the description carries full burden for behavioral disclosure. It states that the tool returns a version string, implying a read-only, non-destructive operation. While minimal, it adds sufficient context for safe invocation.

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness5/5

Is the description appropriately sized, front-loaded, and free of redundancy?

The description is exceptionally concise with two sentences: the first defines the purpose, the second specifies the return type. It is front-loaded and every sentence adds value with no extraneous text.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness5/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

Given the tool's low complexity and the presence of an output schema (as indicated by context signals), the description is complete. It adequately covers the tool's action and return value without needing to elaborate further.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters5/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

The tool has zero parameters, and the schema coverage is 100% (vacuously). The description adds no param details, which is appropriate since there are none. No additional semantic burden is required.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose5/5

Does the description clearly state what the tool does and how it differs from similar tools?

The description clearly states the tool retrieves the version of the wolframscript tool. It distinguishes itself from siblings like evaluate (execution), licensetype (license type), and version_wolframengine (engine version), making its specific purpose unambiguous.

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines4/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

The description does not provide explicit guidance on when to use this tool versus alternatives, but its purpose is self-evident as a simple version query. No exclusionary context is needed given the straightforward nature.

Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.

TDQS

A4.1/5.0
Disambiguation5/5

Each tool has a clearly distinct purpose: evaluate executes scripts, licensetype returns license info, and the two version tools return specific version strings. There is no overlap.

Naming Consistency3/5

Tool names mix conventions: evaluate is a verb, licensetype is a compound noun without underscore, and version_wolframengine/script use noun_verb pattern. Inconsistency in verb usage and separators.

Tool Count4/5

With 4 tools, the server covers core evaluation and basic information retrieval. Slightly thin but reasonable for a focused Mathematica evaluation server.

Completeness3/5

The server provides the essential evaluate tool but lacks auxiliary capabilities like error handling, file management, or interactive sessions. Some gaps for advanced use cases.

Maintenance

ActivityInactive
ResponsivenessSyncing

Resources

Unclaimed servers have limited discoverability.

Looking for Admin?

If you are the server author, to access and configure the admin panel.

Related MCP Connectors

Related MCP Servers

Latest Blog Posts

MCP directory API

We provide all the information about MCP servers via our MCP API.

curl -X GET 'https://glama.ai/api/mcp/v1/servers/lars20070/mathematica-mcp'

If you have feedback or need assistance with the MCP directory API, please join our Discord server