
texra-ai/mcp-server-mathematica
Developer toolsこのページは AI により自動翻訳されています。技術的な詳細は原文をご確認ください。 原文を見る
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.
概要
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. 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. * 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). 1. 2. 3. This command compiles the TypeScript source code from src/ into JavaScript in the build/ directory and makes the main script executable.
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
wolframscriptcommand-line utility must be available in your system’s PATH. You can test this by runningwolframscript -helpin your terminal. - Node.js (Recommended: v16 or later, as inferred from
tsconfig.jsontargetES2022).
Installation
- Clone the repository:
git clone cd - Install dependencies:
npm install - Build the server:
This command compiles the TypeScript source code fromnpm run buildsrc/into JavaScript in thebuild/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:
- Start the Mathematica MCP Server: Ensure the server is running in a terminal:
node build/index.js - 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.
- 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.jsonwithin the Cline configuration directory). You would add an entry like this:{ "mcpServers": { "mathematica-server": { "command": "node",
インストール
This server does not publish a one-line install command.
Open the repository installation guide MCP 初心者?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 ...
}
}