Skip to main content
Glama

Mathematica Documentation MCP server

by benhaotang

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

local-only server

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

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

  1. 常规和用法
    1. 自定义 wolframscript 安装路径
      1. 工具
        1. 已知问题
          1. 截图

            Related MCP Servers

            • A
              security
              A
              license
              A
              quality
              Fetches and extracts comprehensive package documentation from multiple programming language ecosystems (JavaScript, Python, Java, etc.) for LLMs like Claude without requiring API keys.
              Last updated -
              4
              5
              10
              JavaScript
              MIT License
              • Apple
              • Linux
            • -
              security
              F
              license
              -
              quality
              An MCP server that fetches real-time documentation for popular libraries like Langchain, Llama-Index, MCP, and OpenAI, allowing LLMs to access updated library information beyond their knowledge cut-off dates.
              Last updated -
              Python
            • -
              security
              A
              license
              -
              quality
              A server that provides structured access to markdown documentation from NPM packages, Go Modules, or PyPi packages, enabling informed code generation by exposing these docs as resources or tools.
              Last updated -
              1
              TypeScript
              MIT License
            • -
              security
              A
              license
              -
              quality
              Toolset that crawls websites, generates Markdown documentation, and makes that documentation searchable via a Model Context Protocol (MCP) server for integration with tools like Cursor.
              Last updated -
              6
              Python
              MIT License
              • Linux
              • Apple

            View all related MCP servers

            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/benhaotang/mcp-mma-docs'

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