Skip to main content
Glama

mma-mcp

Chinese / 中文版

로컬 Wolfram Engine을 래핑하여 AI 어시스턴트(Claude, ChatGPT 등)가 Wolfram Language를 통해 기호 수학, 수치 해석 및 데이터 시각화를 수행할 수 있도록 하는 Model Context Protocol (MCP) 서버입니다.

면책 조항: 이 프로젝트는 비공식적이고 독립적인 개인 프로젝트입니다. Wolfram Research, Inc.와 제휴, 후원, 보증 또는 인증을 받지 않았습니다. "Wolfram", "Wolfram Language", "Wolfram Engine", "Mathematica" 및 관련 마크는 Wolfram Research의 상표입니다.

이 소프트웨어에는 Wolfram Engine / Mathematica 바이너리, 활성화 키, 라이선스 파일 또는 기타 독점 자료가 포함되어 있지 않습니다. 사용자는 Wolfram의 라이선스 약관에 따라 자신의 Wolfram Engine 또는 Mathematica 사본을 독립적으로 획득하고 적절하게 라이선스를 취득해야 합니다.

이 프로젝트의 유일한 목적은 라이선스를 보유한 개인이 자신의 라이선스 범위 내에서 자신의 컴퓨터에 로컬로 설치된 Wolfram 커널을 AI 어시스턴트를 통해 호출할 수 있도록 하는 것입니다. 제3자에게 Wolfram Engine 액세스를 재배포하는 것은 의도된 사용 사례가 아니며 Wolfram의 라이선스 약관을 위반할 수 있습니다.

기능

  • MCP 도구: evaluate (텍스트) 및 evaluate_image (PNG, 실험적) — 두 가지 범용 도구를 통한 모든 Wolfram Language 기능

  • 전송: stdio (로컬) 및 스트리밍 가능한 HTTP

  • 보안: 블랙리스트/화이트리스트 모드 및 29개의 기능 그룹을 갖춘 커널 이전 표현식 필터링

  • 클라이언트 RBAC: 클라이언트별 자격 증명, 역할별 도구 및 보안 정책 제어 — 동일한 컴퓨터에서 서로 다른 AI 클라이언트를 격리하기 위함

  • OAuth 2.1: 웹 기반 MCP 클라이언트(Claude.ai, ChatGPT)를 위한 인증 서버

  • 구성 기반: 단일 TOML 파일로 모든 동작 제어

Related MCP server: MCP Mathematics

사전 요구 사항

  • Python 3.11+

  • Wolfram Engine 또는 Mathematica (적절한 라이선스 보유)

  • uv 패키지 관리자

빠른 시작

# 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 serve

클라이언트 구성

Claude Code / VS Code (stdio)

.mcp.json에 추가:

{
  "mcpServers": {
    "mma-mcp": {
      "command": "uv",
      "args": ["--directory", "/path/to/mma-mcp", "run", "mma-mcp"]
    }
  }
}

Claude Desktop (stdio)

claude_desktop_config.json에 추가 (설정 -> 개발자 -> 구성 편집):

{
  "mcpServers": {
    "mma-mcp": {
      "command": "/path/to/mma-mcp/.venv/bin/mma-mcp"
    }
  }
}

macOS/Linux의 경우 ~/Library/Application Support/Claude/claude_desktop_config.json 또는 ~/.config/Claude/claude_desktop_config.json에서 구성을 찾으십시오.

HTTP 전송

uv run mma-mcp serve --transport http --host 127.0.0.1 --port 8000

구성

모든 설정은 mma_mcp.toml (또는 [tool.mma-mcp] 하위의 pyproject.toml)에 있습니다.

uv run mma-mcp init  # generates mma_mcp.toml with comments

주요 섹션:

섹션

설명

[kernel]

Wolfram 커널 경로, 타임아웃, 출력 형식

[server]

전송 모드, 호스트, 포트

[security]

블랙리스트/화이트리스트 모드, 기능 그룹

[tools]

노출할 MCP 도구

[tls]

HTTPS를 위한 도메인 및 DNS 제공업체 (Caddy)

[auth]

클라이언트 ID 및 역할 기반 액세스 제어

보안

표현식은 Wolfram 커널에 도달하기 전에 필터링됩니다. 기호는 정규식을 통해 추출되며 활성 정책에 따라 확인됩니다.

블랙리스트 모드 (기본값): 위험한 그룹(system_exec, 파일 I/O, 네트워킹, 동적 평가)을 차단합니다.

화이트리스트 모드: 명시적으로 활성화된 그룹의 기호만 허용합니다.

29개의 기능 그룹(22개의 안전한 그룹 + 7개의 위험한 그룹)이 약 6000개의 Wolfram Language 기호를 다룹니다. 로컬 커널에서 다시 생성하십시오:

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)

클라이언트 ID 및 역할

HTTP 전송을 사용할 때 클라이언트별 자격 증명 및 역할을 구성하여 동일한 커널에 연결하는 서로 다른 AI 클라이언트(예: Claude 및 ChatGPT)를 격리할 수 있습니다:

# Generate password hash
uv run mma-mcp hash-password

# Generate TOML snippet for a new client
uv run mma-mcp add-client alice --role admin

각 클라이언트는 액세스할 수 있는 도구, 사용할 수 있는 Wolfram 기호 및 리소스 제한(타임아웃, 결과 크기)을 제어하는 역할에 바인딩됩니다. 동시 클라이언트는 커널 작업자 풀을 통해 격리됩니다. 각 도구 호출은 임시 WL 컨텍스트가 있는 전용 커널 프로세스에서 실행됩니다.

구성 세부 정보는 mma_mcp.toml[auth] 섹션을 참조하십시오.

개발

# Run tests
uv run pytest tests/ -v

# Inspect MCP tools interactively
uv run mcp dev src/mma_mcp/server.py

CLI 명령

명령

설명

mma-mcp serve

MCP 서버 시작 (기본값)

mma-mcp init

기본 mma_mcp.toml 생성

mma-mcp setup

로컬 커널에서 보안 그룹 JSON 생성

mma-mcp caddyfile

HTTPS를 위한 Caddyfile 생성

mma-mcp hash-password

구성을 위한 비밀번호 해시

mma-mcp add-client

새로운 AI 클라이언트를 위한 TOML 스니펫 생성

클라이언트 호환성

클라이언트

긴 계산

참고

Claude.ai

✔ 지원됨

progressToken 전송; 서버 하트비트가 연결을 유지함

ChatGPT

✘ 타임아웃 가능

progressToken을 전송하지 않음; 서버 하트비트와 무관하게 하드 타임아웃(약 60초)이 있음

Claude Desktop / Claude Code

테스트되지 않음

로컬 stdio 전송

라이선스

MIT — 이 저장소의 코드에만 적용됩니다. Wolfram Engine / Mathematica의 사용은 Wolfram Research의 자체 라이선스 약관에 따릅니다.

Available Tools

2 tools
evaluateA

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.

ParametersJSON Schema
NameRequiredDescriptionDefault
expressionYes
formNo

TDQS

A4.3/5.0
Behavior3/5

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.

Conciseness5/5

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.

Completeness4/5

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.

Parameters5/5

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.

Purpose5/5

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.

Usage Guidelines4/5

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.

ParametersJSON Schema
NameRequiredDescriptionDefault
expressionYes

TDQS

A3.9/5.0
Behavior2/5

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.

Conciseness5/5

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.

Completeness3/5

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.

Parameters4/5

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.

Purpose5/5

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.

Usage Guidelines4/5

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.

  1. 2 tool updatesv0.1.0
    • First observedevaluate
    • First observedevaluate_image

TDQS

A3.9/5.0

Scored across 2 tools

Disambiguation5/5

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.

Naming Consistency5/5

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.

Tool Count2/5

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.

Completeness2/5

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

ActivitySlowing
ResponsivenessNo issues

Related MCP Connectors

Related MCP Servers

  • A
    license
    A
    quality
    B
    maintenance
    An 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.
    1
    39 npm
    MIT
  • A
    license
    C
    quality
    D
    maintenance
    A 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.
    18
    16
    MIT