Mathematica Documentation MCP server

local-only server

The server can only run on the client’s local machine because it depends on local resources.

Integrations

  • Provides access to Mathematica documentation, allowing users to retrieve documentation for functions, list symbols in packages, and access documentation for add-ons and package functions.

Mathematica 文档 MCP 服务器

常规和用法

使用mcp-python-sdk制作

[!重要的]
如果您仍在使用此 mcp 服务器的 FastMCP 版本,请考虑再次拉取此 repo 并更新到较新的版本,因为 FastMCP 已被弃用。

要求: pip install -r requirements.txt并安装 Mathematica(或至少可从终端调用wolframscript ,例如通过免费的开发人员 wolfram 引擎)。

运行mcp dev path/to/mcp-mma-doc.py初始化服务器。

运行mcp install path/to/mcp-mma-doc.py安装到 claude 或将以下内容添加到 claude/cline 配置中:

"mathematica-docs": { "command": "uv", "args": [ "run", "--with", "mcp", "mcp", "run", "/path/to/mcp-mma-doc.py" ] }

[!NOTE] 目前,将uvmcp一起使用似乎会破坏某些 Linux/macOS 版本的 Claude-desktop,您可能需要进行如下设置:

"mathematica-docs": { "command": "/path/to/mcp", "args": [ "run", "/path/to/mcp-mma-doc.py" ] }

相反,使用在终端中运行which mcp得到的/path/to/mcp

自定义 wolframscript 安装路径

如果您需要wolframscript的自定义路径,或者它不在系统路径中,您可以通过环境变量进行设置

export WOLFRAMSCRIPT_PATH="/usr/bin/wolframscript"

或者在 mcp 配置中设置为env

"mathematica-docs": { "command": ..., "args": .... "env": { "WOLFRAMSCRIPT_PATH": "/usr/bin/wolframscript" } }

工具

该插件提供以下命令:

  • get_docs:支持工厂函数、通过插件实现的函数和通过包实现的函数。
    • 基本用法:get_docs("Plot")
    • 使用包:get_docs("WeightSystem", packages=["LieART"])
    • 使用插件:get_docs("FCFeynmanParametrize", packages=["FeynCalc"], load_addons=["FeynArts"])
  • list_package_symbols:列出包中的所有符号/函数。
    • 基本用法:list_package_symbols("FeynCalc")

已知问题

  • 如果您在 cline 中看到类似INFO Processing request of type __init__.py:431 ListToolsRequest信息,您可以忽略它们,因为这不会影响 cline 的正常运行。这是因为 cline 会解析工具列表以及控制台调试信息,而当前的 python-sdk 无法禁用控制台消息。除了看到此警告之外,这不会影响任何函数调用部分。
  • 一些 MMA 文档可能包含复杂的样式格式,并且不容易用简单的正则表达式删除,您的 llm 可能会受到此影响,请指示它忽略样式格式并仅以 InputForm 形式写入。

截图

-
security - not tested
A
license - permissive license
-
quality - not tested

通过 FastMCP 提供对 Mathematica 文档的访问的服务器,使用户能够从 Wolfram Mathematica 中检索函数文档并列出包符号。

  1. General & Usage
    1. Custom wolframscript install path
      1. Tools
        1. Known issues
          1. Screenshots
            ID: wzz9ag7u06