mma-mcp
This server enables AI assistants to execute Wolfram Language expressions via two MCP tools:
evaluate– Returns results as text in a chosen format:TeXForm(default),OutputForm,InputForm,StandardForm, orTraditionalForm.evaluate_image– Returns results as a PNG image, ideal for plots, graphics, and visualizations.
Together they provide full Wolfram Language access for symbolic math, numerical analysis, data visualization, and general computation. Execution is secured through pre-kernel filtering (blacklist/whitelist with 29 capability groups), role-based access control, and isolated kernel processes per request. Supports both stdio and Streamable HTTP transports, with client management via OAuth 2.1, per-client credentials, and RBAC.
Enables HTTPS configuration for HTTP transport mode through Caddyfile generation, allowing secure web-based client connections to the Wolfram kernel.
Wraps a local Wolfram Engine to provide comprehensive mathematical computation, symbolic algebra, data analysis, and visualization capabilities through Wolfram Language evaluation.
Provides full access to Wolfram Language capabilities including symbolic mathematics, numerical computation, data analysis, and visualization through expression evaluation tools.
Click on "Install Server".
Wait a few minutes for the server to deploy. Once ready, it will show a "Started" state.
In the chat, type
@followed by the MCP server name and your instructions, e.g., "@mma-mcpsolve x^2 + 3x - 4 = 0"
That's it! The server will respond to your query, and you can continue using it as needed.
Here is a step-by-step guide with screenshots.
mma-mcp
This project is deprecated and no longer maintained. The code is kept on GitHub for reference only.
1. Wolfram 15 ships an official MCP server. Mathematica / Wolfram 15 includes the Wolfram/AgentTools paclet, which starts a local stdio MCP server exposing WolframLanguageEvaluator (with per-call timeConstraint, persistent session, and a sandboxed Method -> "Local" mode), WolframContext, notebook read/write, CodeInspector, TestReport and more. For local use this covers most of what mma-mcp was built for — and it does it inside the kernel, rather than through an external wrapper. See the official documentation for usage.
2. The MCP protocol and SDK have moved on. This project targets the v1 Python SDK, including private APIs such as mcp._mcp_server and a hand-written stdio transport, and declares its dependency as mcp[cli]>=1.0 with no upper bound. Now that mcp 2.x is the default install, a fresh install is likely to fail at import time. The embedded OAuth 2.1 server and the session handling in particular no longer match the current MCP authorization model.
3. Security caveat if you run it anyway. The capability-group JSON files are generated locally and are gitignored. If mma-mcp setup has not been run successfully, the default blacklist resolves to an empty set and the expression filter blocks nothing at all — including Run, file I/O and networking. Never point this at untrusted input in that state.
What's next: we are building a separate, much smaller tool focused on reaching your own workstation's Mathematica / Wolfram Engine from a phone, via Claude or ChatGPT over HTTPS. Stay tuned.
A Model Context Protocol (MCP) server that wraps a local Wolfram Engine, enabling AI assistants (Claude, ChatGPT, etc.) to perform symbolic math, numerical analysis, and data visualization via Wolfram Language.
Disclaimer: This is an unofficial, independent, personal project. It is not affiliated with, sponsored by, endorsed by, or certified by Wolfram Research, Inc. "Wolfram", "Wolfram Language", "Wolfram Engine", "Mathematica", and related marks are trademarks of Wolfram Research.
This software does not include any Wolfram Engine / Mathematica binaries, activation keys, license files, or other proprietary materials. Users must independently obtain and properly license their own copy of the Wolfram Engine or Mathematica in accordance with Wolfram's licensing terms.
The sole purpose of this project is to allow a licensed individual to invoke their own, locally-installed Wolfram kernel through AI assistants on their own machine, within the scope permitted by their license. Redistribution of Wolfram Engine access to third parties is not an intended use case and may violate Wolfram's licensing terms.
Features
MCP Tools:
evaluate(text) andevaluate_image(PNG, experimental) — all Wolfram Language capabilities through two universal toolsTransports: stdio (local) and Streamable HTTP
Security: Pre-kernel expression filtering with blacklist/whitelist modes and 29 capability groups
Client RBAC: Per-client credentials, per-role tool and security policy control — for isolating different AI clients on the same machine
OAuth 2.1: Authorization server for web-based MCP clients (Claude.ai, ChatGPT)
Config-driven: Single TOML file controls all behavior
Related MCP server: MCP Mathematics
Prerequisites
Python 3.11+
Wolfram Engine or Mathematica (properly licensed)
uv package manager
Quick Start
# Clone and install
git clone https://github.com/siqiliu-tsinghua/mma-mcp.git
cd mma-mcp
uv sync
# Graphics export dependencies (headless servers only — desktops already have these)
sudo apt-get install -y libfontconfig1 libgl1 libasound2t64 libxkbcommon0 libegl1
# Generate default config
uv run mma-mcp init
# Generate security group files (requires Wolfram kernel, ~1 min)
uv run mma-mcp setup
# Start server (stdio, for local MCP clients)
uv run mma-mcp serveClient Configuration
Claude Code / VS Code (stdio)
Add to your .mcp.json:
{
"mcpServers": {
"mma-mcp": {
"command": "uv",
"args": ["--directory", "/path/to/mma-mcp", "run", "mma-mcp"]
}
}
}Claude Desktop (stdio)
Add to your claude_desktop_config.json (Settings -> Developer -> Edit Config):
{
"mcpServers": {
"mma-mcp": {
"command": "/path/to/mma-mcp/.venv/bin/mma-mcp"
}
}
}On macOS/Linux, find the config at
~/Library/Application Support/Claude/claude_desktop_config.jsonor~/.config/Claude/claude_desktop_config.json.
HTTP Transport
uv run mma-mcp serve --transport http --host 127.0.0.1 --port 8000Configuration
All settings live in mma_mcp.toml (or pyproject.toml under [tool.mma-mcp]).
uv run mma-mcp init # generates mma_mcp.toml with commentsKey sections:
Section | Description |
| Wolfram kernel path, timeout, output format |
| Transport mode, host, port |
| Blacklist/whitelist mode, capability groups |
| Which MCP tools to expose |
| Domain and DNS provider for HTTPS (Caddy) |
| Client identity and role-based access control |
Security
Expressions are filtered before reaching the Wolfram kernel. Symbols are extracted via regex and checked against the active policy.
Blacklist mode (default): blocks dangerous groups (system_exec, file I/O, networking, dynamic eval).
Whitelist mode: only allows symbols from explicitly enabled groups.
29 capability groups (22 safe + 7 dangerous) cover ~6000 Wolfram Language symbols. Regenerate from your local kernel:
uv run mma-mcp setup # required after cloning (generates from your local kernel)
uv run mma-mcp setup --force # force regeneration (e.g., after Wolfram Engine upgrade)Client Identity & Roles
When using HTTP transport, you can configure per-client credentials and roles to isolate different AI clients (e.g., Claude and ChatGPT) connecting to the same kernel:
# Generate password hash
uv run mma-mcp hash-password
# Generate TOML snippet for a new client
uv run mma-mcp add-client alice --role adminEach client is bound to a role that controls which tools it can access, which Wolfram symbols it can use, and resource limits (timeout, result size). Concurrent clients are isolated via a kernel worker pool — each tool call runs in an exclusive kernel process with a temporary WL context.
See the [auth] section in mma_mcp.toml for configuration details.
Development
# Run tests
uv run pytest tests/ -v
# Inspect MCP tools interactively
uv run mcp dev src/mma_mcp/server.pyCLI Commands
Command | Description |
| Start the MCP server (default) |
| Generate default |
| Generate security group JSONs from local kernel |
| Generate Caddyfile for HTTPS |
| Hash a password for config |
| Generate TOML snippet for a new AI client |
Client Compatibility
Client | Long computations | Notes |
Claude.ai | ✔ Supported | Sends |
ChatGPT | ✘ May timeout | Does not send |
Claude Desktop / Claude Code | Not tested | Local stdio transport |
License
MIT — applies only to the code in this repository. Use of Wolfram Engine / Mathematica is governed by Wolfram Research's own license terms.
Available Tools
2 toolsevaluateA
Evaluate a Wolfram Language expression and return the result as text.
Args: expression: A valid Wolfram Language expression string. form: Output format — TeXForm (default), OutputForm, InputForm, StandardForm, or TraditionalForm.
| Name | Required | Description | Default |
|---|---|---|---|
| expression | Yes | ||
| form | No |
TDQS
Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?
With no annotations provided, the description carries full burden. It discloses the core behavior (evaluates expressions, returns text results) and mentions format options, but doesn't cover important behavioral aspects like error handling, computational limits, authentication requirements, or rate limits. The description adds value beyond what would be in annotations but leaves significant gaps.
Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.
Is the description appropriately sized, front-loaded, and free of redundancy?
The description is perfectly structured and front-loaded: the first sentence states the core purpose, followed by a clean parameter section. Every sentence earns its place, with zero wasted words. The formatting with 'Args:' section enhances readability without verbosity.
Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.
Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?
Given the tool's moderate complexity (expression evaluation), no annotations, and no output schema, the description does well but has gaps. It thoroughly documents parameters and purpose, but doesn't describe return value format beyond 'text' or potential error conditions. For a computational tool with no structured safety hints, more behavioral context would be beneficial.
Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.
Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?
With 0% schema description coverage, the description fully compensates by providing comprehensive parameter documentation. It clearly explains both parameters: 'expression' as 'a valid Wolfram Language expression string' and 'form' with its five possible values and default. This adds substantial meaning beyond the bare schema.
Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.
Does the description clearly state what the tool does and how it differs from similar tools?
The description clearly states the tool's purpose with specific verb ('evaluate') and resource ('Wolfram Language expression'), and distinguishes it from sibling tool 'evaluate_image' by specifying it returns text rather than image results. The phrase 'return the result as text' explicitly differentiates it from the image-focused sibling.
Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.
Does the description explain when to use this tool, when not to, or what alternatives exist?
The description provides clear context about when to use this tool (for evaluating Wolfram Language expressions to get text results) and implies when not to use it (when image results are needed, suggesting 'evaluate_image' as an alternative). However, it doesn't explicitly state exclusion criteria or name the alternative tool directly in the main description.
Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.
evaluate_imageA
Evaluate a Wolfram Language expression and return the result as a PNG image.
Useful for Plot, Graphics, or any expression with visual output.
Args: expression: A valid Wolfram Language expression string.
| Name | Required | Description | Default |
|---|---|---|---|
| expression | Yes |
TDQS
Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?
No annotations are provided, so the description carries the full burden of behavioral disclosure. While it mentions the tool evaluates expressions and returns PNG images, it lacks critical behavioral details such as error handling, performance characteristics, rate limits, authentication requirements, or what happens with invalid expressions. This leaves significant gaps in understanding how the tool behaves in practice.
Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.
Is the description appropriately sized, front-loaded, and free of redundancy?
The description is perfectly concise and well-structured. It starts with the core purpose, provides usage guidelines, then clearly documents the parameter. Every sentence earns its place with no redundant information, making it easy to scan and understand quickly.
Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.
Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?
Given the tool's moderate complexity (evaluating Wolfram Language expressions with visual output), no annotations, no output schema, and 0% schema description coverage, the description provides adequate basics but lacks completeness. It covers the purpose and parameter semantics well, but misses important behavioral context about how the tool operates, what errors might occur, and what the PNG output contains.
Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.
Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?
The description adds meaningful context for the single parameter: 'expression: A valid Wolfram Language expression string.' This clarifies what type of input is expected beyond the schema's basic 'string' type. Since schema description coverage is 0% and there's only one parameter, the description adequately compensates by specifying the parameter's purpose and format requirements.
Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.
Does the description clearly state what the tool does and how it differs from similar tools?
The description clearly states the tool's purpose: 'Evaluate a Wolfram Language expression and return the result as a PNG image.' It specifies both the action (evaluate) and the resource (Wolfram Language expression), and distinguishes it from the sibling tool 'evaluate' by mentioning the visual output format (PNG image).
Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.
Does the description explain when to use this tool, when not to, or what alternatives exist?
The description provides clear context on when to use this tool: 'Useful for Plot, Graphics, or any expression with visual output.' This gives guidance on appropriate use cases. However, it doesn't explicitly state when NOT to use it or name alternatives (like the sibling 'evaluate' tool for non-visual results), which prevents a perfect score.
Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.
Tool Schema Changelog
Recent tool additions, removals, and schema changes observed during successful MCP inspections. Dates show when Glama detected each change.
2 tool updates
v0.1.0- First observed
evaluate - First observed
evaluate_image
TDQS
The two tools have clearly distinct purposes: evaluate returns text output in various formats, while evaluate_image returns PNG images for visual output. There is no overlap or ambiguity between them, as each targets a different output type for Wolfram Language expressions.
Both tools follow a consistent verb_noun pattern with 'evaluate' as the verb and descriptive suffixes ('_image') to differentiate them. The naming is predictable and aligned, making it easy to understand their relationship and functionality.
With only two tools, this server feels too thin for its apparent scope of evaluating Wolfram Language expressions. It covers text and image output but lacks other essential operations like querying Wolfram Alpha, handling errors, or managing sessions, which limits its utility in broader workflows.
The tool surface is severely incomplete for a Wolfram Language server. It only provides evaluation with text or image output, missing critical functionality such as data import/export, symbolic computation queries, step-by-step solutions, or integration with Wolfram Cloud services, leading to significant gaps in agent capabilities.
Maintenance
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
- ZapierOAuthcom.zapier
Hosted MCP server connecting AI assistants to 9,000+ apps and 40,000+ actions via Zapier.
MCP server for secureFlows: token-free URL builders and integration-linting tools for AI agents.
MCP server for building and testing AI agents with multi-model experimentation and insights.
A comprehensive Model Context Protocol (MCP) server that enables AI assistants to interact with yo…
Related MCP Servers
- AlicenseAqualityCmaintenanceAn MCP server that integrates the MathJS library to provide AI models with advanced calculation capabilities, including support for complex numbers, matrices, and unit conversions. It supports both stdio and HTTP transports for seamless integration with clients like Claude Desktop and GitHub Copilot.110MIT
- AlicenseCqualityCmaintenanceA comprehensive MCP server that turns any AI assistant into a powerful mathematical computation engine, providing 52 advanced functions, 158 unit conversions, financial calculations, and secure AST-based evaluation.1814MIT
- AlicenseAqualityDmaintenanceA symbolic mathematics MCP server supporting calculus, linear algebra, number theory, statistics, and unit conversion via natural language.8MIT
- AlicenseNot gradedqualityDmaintenanceMCP server for scientific computing with multiple backends (Mathematica, Octave, Python, R, SageMath, etc.) enabling mathematical computation and visualization through AI coding assistants.5-
Latest Blog Posts
- Who's Calling? MCP Hosts Are an Identity Blind Spot (And the Spec Knows It)By Om-Shree-0709 on .mcpAgent IdentityOAuth 2.1
- Your AI Chatbot Just Exposed Your CEO's Salary to an InternBy Om-Shree-0709 on .Agent IdentityMCP SecurityOAuth Delegation
- Why MCP Servers Need Execution Sandboxing (And Why Your Current Stack Isn't Enough)By Om-Shree-0709 on .Agentic AiPrompt InjectionWebAssembly
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/siqiliu-tsinghua/mma-mcp'
If you have feedback or need assistance with the MCP directory API, please join our Discord server