TA

texra-ai/mcp-server-mathematica

开发工具

本页由 AI 翻译,技术细节请以原文为准。 查看原文

24 stars 6 forks 质量 72 趋势 10MIT

该仓库包含一个模型上下文协议(MCP)服务器,允许MCP客户端(如Cursor)通过wolframscript执行Mathematica代码并验证数学推导。

概览

该仓库包含一个模型上下文协议(MCP)服务器,允许MCP客户端(如Cursor)通过wolframscript执行Mathematica代码并验证数学推导。 该服务器作为桥梁,使支持 MCP 的应用程序能够利用本地 Mathematica 安装的强大功能完成以下任务: * 执行复杂的数学计算。* 验证由人类或人工智能模型提供的数学推导步骤。* 生成表达式的 LaTeX 或 Mathematica 字符串表示。 * Mathematica 必须安装在您的系统中。* wolframscript 命令行工具必须在系统 PATH 中提供。您可以通过在终端中运行 wolframscript -help 来测试。* Node.js(推荐:根据目标 ES2022 推断 v16 或更高版本tsconfig.json)。 1. 2.3. 该命令将 src/ 中的 TypeScript 源代码编译成 build/ 目录中的 JavaScript,并使主脚本成为可执行文件。

概述(AI 翻译)

该仓库包含一个模型上下文协议(MCP)服务器,允许MCP客户端(如Cursor)通过[wolframscript执行Mathematica代码并验证数学推导。

概述

该服务器作为桥梁,使支持 MCP 的应用程序能够利用本地 Mathematica 安装的强大功能完成以下任务:

  • 进行复杂的数学计算。
  • 验证由人类或人工智能模型提供的数学推导步骤。
  • 生成 LaTeX 或 Mathematica 字符串表示表达式。

先修条件

  • Mathematica 必须安装在您的系统中。
  • wolframscript 命令行工具必须在系统 PATH 中可用。您可以通过在终端中运行 wolframscript -help 来测试。
  • Node.js(推荐:v16或更高版本,可从tsconfig.json目标ES2022推断)。

安装

  1. 克隆仓库:

  2. 安装依赖:

  3. 搭建服务器:

该命令将 src/ 的 TypeScript 源代码编译成 build/ 目录中的 JavaScript,并使主脚本可执行。

运行服务器

要启动MCP服务器,请在终端中执行以下命令:

本页由 AI 翻译,技术细节请以原文为准。

README

以下为原文 README 节选,完整内容请查看原文。

Mathematica MCP Server

This repository contains a Model Context Protocol (MCP) server that allows MCP clients (like Cursor) to execute Mathematica code via wolframscript and verify mathematical derivations.

Overview

This server acts as a bridge, enabling applications that support MCP to leverage the power of a local Mathematica installation for tasks such as:

  • Performing complex mathematical calculations.
  • Verifying mathematical derivation steps provided by humans or AI models.
  • Generating LaTeX or Mathematica string representations of expressions.

Prerequisites

  • Mathematica must be installed on your system.
  • The wolframscript command-line utility must be available in your system’s PATH. You can test this by running wolframscript -help in your terminal.
  • Node.js (Recommended: v16 or later, as inferred from tsconfig.json target ES2022).

Installation

  1. Clone the repository:
    git clone 
    cd 
    
  2. Install dependencies:
    npm install
    
  3. Build the server:
    npm run build
    
    This command compiles the TypeScript source code from src/ into JavaScript in the build/ directory and makes the main script executable.

Running the Server

To start the MCP server, run the following command in your terminal:

node build/index.js

The server will start and listen for connections from MCP clients via standard input/output (stdio). Keep this terminal window open while you intend to use the server.

For more robust deployments, consider using a process manager like pm2 to run the server in the background and manage restarts.

Integration with MCP Clients (e.g., Cursor, Cline, Claude Desktop)

MCP clients generally discover and communicate with running MCP servers. The exact configuration steps can vary depending on the client application.

General Steps:

  1. Start the Mathematica MCP Server: Ensure the server is running in a terminal:
    node build/index.js
    
  2. Configure Your MCP Client: Add the server to your client’s configuration. This often involves editing a JSON settings file. See client-specific instructions below.
  3. Restart Your MCP Client: After starting the server or changing configuration, restart your client application to ensure it detects the Mathematica server.

Client-Specific Configuration:

  • Cline: According to the Cline MCP Server Development Protocol, you typically configure servers in a settings file (often settings.json within the Cline configuration directory). You would add an entry like this:

    {
      "mcpServers": {
        "mathematica-server": {
          "command": "node",
在 GitHub 查看完整 README

安装

This server does not publish a one-line install command.

Open the repository installation guide 新手?先看 mcpskill.org 教程 →

配置

{ "mcpServers": { "mathematica-server": { "command": "node", "args": ["/full/path/to/mcp-server-mathematica/build/index.js"], // Replace with the actual absolute path "disabled": false, "autoApprove": [] // Optional: Add tool names to auto-approve } // ... other servers ... } }