MathCAD MCP Server
MathCAD MCP Server
hvkshetry
README
MathCAD MCP Server
A Model Context Protocol (MCP) server that provides integration with PTC MathCAD Prime, allowing AI assistants like Claude to interact with MathCAD worksheets through a standardized interface.
Features
- Worksheet Management: Open, close, and save MathCAD worksheets
- Input Control: Set numerical values, strings, and matrices with units
- Output Access: Retrieve calculation results with proper units
- Calculation Management: Pause, resume, and recalculate worksheets
- Export Options: Save worksheets as PDF, RTF, and XPS files
Requirements
- Windows operating system (required for MathCAD COM automation)
- Python 3.10 or higher
- PTC MathCAD Prime 3.0 or higher installed
- Dependencies: MathcadPy, pywin32, and MCP Python SDK (see requirements.txt)
Installation
Quick Installation with Claude Desktop
-
Install the required dependencies:
pip install -r requirements.txt
-
Run the installation script:
python install_standalone.py
Options:
- Use
--hide
flag to hide the MathCAD window when running:python install_standalone.py --hide
- Use
-
Restart Claude Desktop for the changes to take effect.
Manual Configuration
Edit your Claude Desktop configuration file at ~/Library/Application Support/Claude/claude_desktop_config.json
(Mac) or %APPDATA%\Claude\claude_desktop_config.json
(Windows):
{
"mcpServers": {
"mathcad": {
"command": "python",
"args": [
"path/to/mathcad-mcp/standalone.py"
],
"env": {
"MATHCAD_VISIBLE": "true"
}
}
}
}
Usage
Tools
The server exposes the following MCP tools:
list_mathcad_version
: Get the running MathCAD versionopen_worksheet
: Open a MathCAD worksheet from a file pathclose_worksheet
: Close a specific worksheetclose_all_worksheets
: Close all open worksheetsquit_mathcad
: Quit the MathCAD application entirelysave_worksheet
: Save a worksheet to a specified path and formatsave_worksheet_inplace
: Save the worksheet in placeactivate_worksheet
: Bring a worksheet to the frontset_real_input
: Set a numerical input with optional unitsset_string_input
: Set a string inputset_matrix_input
: Set a matrix input with optional unitsget_input
: Retrieve the current value of a designated input (real/string/matrix)get_matrix_input
: Retrieve the current value of a designated matrix inputcalculate_worksheet
: Recalculate a worksheetsync_worksheet
: Alias for calculating the worksheetpause_calculation
: Pause worksheet calculationresume_calculation
: Resume worksheet calculationget_output
: Get a designated output value (real, string, or matrix)get_real_output
: Get a numerical output value from a worksheetget_real_output_with_units
: Get a numerical output value with conversion to specified unitsget_matrix_output
: Get a matrix output from a worksheetget_matrix_output_with_units
: Get a matrix output with unit conversionsave_as_pdf
: Save the worksheet as a PDF file (Mathcad Prime 5+ only)save_as_rtf
: Save the worksheet as an RTF filesave_as_xps
: Save the worksheet as an XPS fileis_worksheet_readonly
: Check if a worksheet is read-onlyis_worksheet_modified
: Check if a worksheet has unsaved changesset_worksheet_modified
: Force-set the 'modified' status of a worksheet
Resources
The server exposes the following MCP resources:
mathcad://worksheets
: List all open worksheetsmathcad://worksheets/paths
: List worksheets with full file pathsmathcad://worksheet/{worksheet_name}/inputs
: List inputs in a worksheetmathcad://worksheet/{worksheet_name}/outputs
: List outputs in a worksheetmathcad://worksheet/{worksheet_name}/output/{output_name}
: Get a specific output valuemathcad://worksheet/{worksheet_name}/output/{output_name}/matrix
: Get a matrix outputmathcad://worksheet/{worksheet_name}/output/{output_name}/with_units/{units}
: Get an output with units conversionmathcad://worksheet/{worksheet_name}/info
: Get information about a worksheetmathcad://worksheet/{worksheet_name}/status
: Get the status of a worksheet
Prompt Templates
The server provides the following prompt templates to assist in MathCAD-related tasks:
solve_equation
: Template for solving mathematical equationsplot_function
: Template for plotting functionsanalyze_engineering_problem
: Template for analyzing engineering problemsunit_conversion
: Template for unit conversion taskscreate_worksheet_template
: Template for creating new worksheet templates
Example Workflows
Example 1: Solving a Physics Problem
1. Open an existing MathCAD worksheet:
"Can you open my physics worksheet at C:\Users\username\Documents\Physics\projectile_motion.mcdx?"
2. Set input parameters:
"Set the initial velocity to 50 m/s and the launch angle to 30 degrees."
3. Calculate the results:
"Now calculate the trajectory and show me the maximum height and distance."
4. Extract output values:
"What's the maximum height reached by the projectile?"
Example 2: Engineering Analysis
1. Open or create a worksheet for analysis:
"I need to analyze a beam deflection problem. Can you open the structural_analysis.mcdx worksheet?"
2. Configure the worksheet:
"Set the load P to 5000 N, beam length L to 2 m, Young's modulus E to 200 GPa, and moment of inertia I to 4×10⁻⁶ m⁴."
3. Run the calculation:
"Calculate the worksheet and tell me the maximum deflection."
4. Export the results:
"Save the worksheet as a PDF so I can include it in my report."
Environment Variables
MATHCAD_VISIBLE
: Set to "true" to show the MathCAD application window (default), or "false" to hide it.
Architecture
The server is built using the MCP Python SDK's FastMCP framework. The main components are:
standalone.py
: Self-contained server script with MathCAD integrationinstall_standalone.py
: Utility script to install the server in Claude Desktop
Troubleshooting
Common Issues
COM Automation Errors
If you encounter COM automation errors:
- Ensure MathCAD is installed and properly licensed
- Check that you're running on Windows
- Try restarting MathCAD and the MCP server
Worksheet Not Found
If worksheets can't be found:
- Use absolute paths, not relative paths
- Ensure file paths are correctly escaped
- Verify the file exists and is a valid
.mcdx
file
Unit Conversion Issues
If unit conversion fails:
- Check for compatibility between units (e.g., length can't convert to mass)
- Ensure that the right unit symbols are used (e.g., 'm' for meters)
- Try using standard unit formats (e.g., 'm/s' instead of 'm*s^(-1)')
License
This project is licensed under the MIT License - see the LICENSE file for details.
Acknowledgments
- MathcadPy - Python wrapper for the MathCAD Prime automation API
- Model Context Protocol - Protocol specification and SDK
Recommended Servers
Crypto Price & Market Analysis MCP Server
A Model Context Protocol (MCP) server that provides comprehensive cryptocurrency analysis using the CoinCap API. This server offers real-time price data, market analysis, and historical trends through an easy-to-use interface.
MCP PubMed Search
Server to search PubMed (PubMed is a free, online database that allows users to search for biomedical and life sciences literature). I have created on a day MCP came out but was on vacation, I saw someone post similar server in your DB, but figured to post mine.
dbt Semantic Layer MCP Server
A server that enables querying the dbt Semantic Layer through natural language conversations with Claude Desktop and other AI assistants, allowing users to discover metrics, create queries, analyze data, and visualize results.
mixpanel
Connect to your Mixpanel data. Query events, retention, and funnel data from Mixpanel analytics.

Sequential Thinking MCP Server
This server facilitates structured problem-solving by breaking down complex issues into sequential steps, supporting revisions, and enabling multiple solution paths through full MCP integration.

Nefino MCP Server
Provides large language models with access to news and information about renewable energy projects in Germany, allowing filtering by location, topic (solar, wind, hydrogen), and date range.
Vectorize
Vectorize MCP server for advanced retrieval, Private Deep Research, Anything-to-Markdown file extraction and text chunking.
Mathematica Documentation MCP server
A server that provides access to Mathematica documentation through FastMCP, enabling users to retrieve function documentation and list package symbols from Wolfram Mathematica.
kb-mcp-server
An MCP server aimed to be portable, local, easy and convenient to support semantic/graph based retrieval of txtai "all in one" embeddings database. Any txtai embeddings db in tar.gz form can be loaded
Research MCP Server
The server functions as an MCP server to interact with Notion for retrieving and creating survey data, integrating with the Claude Desktop Client for conducting and reviewing surveys.