Built for teaching math concepts through Claude, this exposes 17 tools split across basic calculations, matrix operations, and matplotlib visualizations. You get persistent workspace storage so students can save and reload their work between sessions, plus structured tutoring prompts and formula explainers. The eval safety model whitelists math module functions only. Includes statistical analysis (mean, median, variance), unit conversions, compound interest calculators, and full matrix ops (multiply, transpose, determinant, eigenvalues). Ships with cloud hosting at math-mcp.fastmcp.app or runs locally via uvx. Designed for educational workflows where you want Claude to walk through problem solving with actual computation and visual output, not just explanation.
Public tool metadata for what this MCP can expose to an agent.
calculateSafely evaluate mathematical expressions with support for basic operations and math functions. Supported operations: +, -, *, /, **, () Supported functions: sin, cos, tan, log, sqrt, abs, pow Note: Use this tool to evaluate a single mathematical expression. To compute descript...1 paramsSafely evaluate mathematical expressions with support for basic operations and math functions. Supported operations: +, -, *, /, **, () Supported functions: sin, cos, tan, log, sqrt, abs, pow Note: Use this tool to evaluate a single mathematical expression. To compute descript...
expressionstringstatisticsPerform statistical calculations on a list of numbers. Available operations: mean, median, mode, std_dev, variance Note: Use this tool to compute descriptive statistics over a list of numbers. To evaluate a single mathematical expression, use the calculate tool instead. Exampl...2 paramsPerform statistical calculations on a list of numbers. Available operations: mean, median, mode, std_dev, variance Note: Use this tool to compute descriptive statistics over a list of numbers. To evaluate a single mathematical expression, use the calculate tool instead. Exampl...
numbersarrayoperationstringcompound_interestCalculate compound interest for investments. Formula: A = P(1 + r/n)^(nt) Where: - P = principal amount - r = annual interest rate (as decimal) - n = number of times interest compounds per year - t = time in years Examples: compound_interest(10000, 0.05, 5) # $10,000 at 5% for...4 paramsCalculate compound interest for investments. Formula: A = P(1 + r/n)^(nt) Where: - P = principal amount - r = annual interest rate (as decimal) - n = number of times interest compounds per year - t = time in years Examples: compound_interest(10000, 0.05, 5) # $10,000 at 5% for...
ratenumbertimenumberprincipalnumbercompounds_per_yearintegerconvert_unitsConvert between different units of measurement. Supported unit types: - length: mm, cm, m, km, in, ft, yd, mi - weight: g, kg, oz, lb - temperature: c, f, k (Celsius, Fahrenheit, Kelvin) Examples: convert_units(5, "km", "mi", "length") # 5 kilometers → 3.11 miles convert_units...4 paramsConvert between different units of measurement. Supported unit types: - length: mm, cm, m, km, in, ft, yd, mi - weight: g, kg, oz, lb - temperature: c, f, k (Celsius, Fahrenheit, Kelvin) Examples: convert_units(5, "km", "mi", "length") # 5 kilometers → 3.11 miles convert_units...
valuenumberto_unitstringfrom_unitstringunit_typestringmatrix_multiplyMultiply two matrices (A × B). Args: matrix_a: First matrix (m x n) matrix_b: Second matrix (n x p) Note: Requires NumPy. Raises ValueError if NumPy is unavailable. Examples: matrix_multiply([[1, 2], [3, 4]], [[5, 6], [7, 8]]) matrix_multiply([[1, 2, 3]], [[1], [2], [3]])2 paramsMultiply two matrices (A × B). Args: matrix_a: First matrix (m x n) matrix_b: Second matrix (n x p) Note: Requires NumPy. Raises ValueError if NumPy is unavailable. Examples: matrix_multiply([[1, 2], [3, 4]], [[5, 6], [7, 8]]) matrix_multiply([[1, 2, 3]], [[1], [2], [3]])
matrix_aarraymatrix_barraymatrix_transposeTranspose a matrix (swap rows and columns). Args: matrix: Input matrix (m x n) Note: Requires NumPy. Raises ValueError if NumPy is unavailable. Examples: matrix_transpose([[1, 2, 3], [4, 5, 6]]) matrix_transpose([[1], [2], [3]])1 paramsTranspose a matrix (swap rows and columns). Args: matrix: Input matrix (m x n) Note: Requires NumPy. Raises ValueError if NumPy is unavailable. Examples: matrix_transpose([[1, 2, 3], [4, 5, 6]]) matrix_transpose([[1], [2], [3]])
matrixarraymatrix_determinantCalculate the determinant of a square matrix. Args: matrix: Square matrix (n x n) Note: Requires NumPy. Raises ValueError if NumPy is unavailable. Examples: matrix_determinant([[1, 2], [3, 4]]) matrix_determinant([[1, 0, 0], [0, 1, 0], [0, 0, 1]]) # Identity matrix1 paramsCalculate the determinant of a square matrix. Args: matrix: Square matrix (n x n) Note: Requires NumPy. Raises ValueError if NumPy is unavailable. Examples: matrix_determinant([[1, 2], [3, 4]]) matrix_determinant([[1, 0, 0], [0, 1, 0], [0, 0, 1]]) # Identity matrix
matrixarraymatrix_inverseCalculate the inverse of a square matrix. Args: matrix: Square matrix (n x n) Note: Requires NumPy. Raises ValueError if NumPy is unavailable. Examples: matrix_inverse([[1, 2], [3, 4]]) matrix_inverse([[2, 0], [0, 2]]) # Diagonal matrix1 paramsCalculate the inverse of a square matrix. Args: matrix: Square matrix (n x n) Note: Requires NumPy. Raises ValueError if NumPy is unavailable. Examples: matrix_inverse([[1, 2], [3, 4]]) matrix_inverse([[2, 0], [0, 2]]) # Diagonal matrix
matrixarraymatrix_eigenvaluesCalculate the eigenvalues of a square matrix. Args: matrix: Square matrix (n x n) Note: Requires NumPy. Raises ValueError if NumPy is unavailable. Examples: matrix_eigenvalues([[4, 2], [1, 3]]) matrix_eigenvalues([[3, 0, 0], [0, 5, 0], [0, 0, 7]]) # Diagonal matrix1 paramsCalculate the eigenvalues of a square matrix. Args: matrix: Square matrix (n x n) Note: Requires NumPy. Raises ValueError if NumPy is unavailable. Examples: matrix_eigenvalues([[4, 2], [1, 3]]) matrix_eigenvalues([[3, 0, 0], [0, 5, 0], [0, 0, 7]]) # Diagonal matrix
matrixarraysave_calculationSave calculation to persistent workspace (survives restarts). Examples: save_calculation("portfolio_return", "10000 * 1.07^5", 14025.52) save_calculation("circle_area", "pi * 5^2", 78.54)3 paramsSave calculation to persistent workspace (survives restarts). Examples: save_calculation("portfolio_return", "10000 * 1.07^5", 14025.52) save_calculation("circle_area", "pi * 5^2", 78.54)
namestringresultnumberexpressionstringload_variableLoad previously saved calculation result from workspace. Examples: load_variable("portfolio_return") # Returns saved calculation load_variable("circle_area") # Access across sessions1 paramsLoad previously saved calculation result from workspace. Examples: load_variable("portfolio_return") # Returns saved calculation load_variable("circle_area") # Access across sessions
namestringplot_functionGenerate mathematical function plots (requires matplotlib). Args: expression: Mathematical expression to plot (e.g., "x**2", "sin(x)") x_range: Tuple of (min, max) for x-axis range num_points: Number of points to plot (default: 100) ctx: FastMCP context for logging Examples: p...3 paramsGenerate mathematical function plots (requires matplotlib). Args: expression: Mathematical expression to plot (e.g., "x**2", "sin(x)") x_range: Tuple of (min, max) for x-axis range num_points: Number of points to plot (default: 100) ctx: FastMCP context for logging Examples: p...
x_rangearrayexpressionstringnum_pointsintegercreate_histogramCreate statistical histograms (requires matplotlib). Args: data: List of numerical values bins: Number of histogram bins (default: 20) title: Chart title ctx: FastMCP context for logging Examples: create_histogram([1.0, 2.0, 2.5, 3.0, 3.5, 4.0, 5.0]) create_histogram([10, 20,...3 paramsCreate statistical histograms (requires matplotlib). Args: data: List of numerical values bins: Number of histogram bins (default: 20) title: Chart title ctx: FastMCP context for logging Examples: create_histogram([1.0, 2.0, 2.5, 3.0, 3.5, 4.0, 5.0]) create_histogram([10, 20,...
binsintegerdataarraytitlestringplot_line_chartCreate a line chart from data points (requires matplotlib). Args: x_data: X-axis data points y_data: Y-axis data points title: Chart title x_label: X-axis label y_label: Y-axis label color: Line color (name or hex code, e.g., 'blue', '#2E86AB') show_grid: Whether to show grid...7 paramsCreate a line chart from data points (requires matplotlib). Args: x_data: X-axis data points y_data: Y-axis data points title: Chart title x_label: X-axis label y_label: Y-axis label color: Line color (name or hex code, e.g., 'blue', '#2E86AB') show_grid: Whether to show grid...
colorvaluetitlestringx_dataarrayy_dataarrayx_labelstringy_labelstringshow_gridbooleanplot_scatter_chartCreate a scatter plot from data points (requires matplotlib). Args: x_data: X-axis data points y_data: Y-axis data points title: Chart title x_label: X-axis label y_label: Y-axis label color: Point color (name or hex code, e.g., 'blue', '#2E86AB') point_size: Size of scatter p...7 paramsCreate a scatter plot from data points (requires matplotlib). Args: x_data: X-axis data points y_data: Y-axis data points title: Chart title x_label: X-axis label y_label: Y-axis label color: Point color (name or hex code, e.g., 'blue', '#2E86AB') point_size: Size of scatter p...
colorvaluetitlestringx_dataarrayy_dataarrayx_labelstringy_labelstringpoint_sizeintegerplot_box_plotCreate a box plot for comparing distributions (requires matplotlib). Args: data_groups: List of data groups to compare group_labels: Optional labels for each group title: Chart title y_label: Y-axis label color: Box color (name or hex code, e.g., 'blue', '#2E86AB') ctx: FastMC...5 paramsCreate a box plot for comparing distributions (requires matplotlib). Args: data_groups: List of data groups to compare group_labels: Optional labels for each group title: Chart title y_label: Y-axis label color: Box color (name or hex code, e.g., 'blue', '#2E86AB') ctx: FastMC...
colorvaluetitlestringy_labelstringdata_groupsarraygroup_labelsvalueplot_financial_lineGenerate and plot synthetic financial price data (requires matplotlib). Creates realistic price movement patterns for educational purposes. Does not use real market data. Args: days: Number of days to generate (default: 30) trend: Market trend ('bullish', 'bearish', or 'volati...4 paramsGenerate and plot synthetic financial price data (requires matplotlib). Creates realistic price movement patterns for educational purposes. Does not use real market data. Args: days: Number of days to generate (default: 30) trend: Market trend ('bullish', 'bearish', or 'volati...
daysintegercolorvaluetrendstringstart_pricenumberEducational MCP server with 17 tools, persistent workspace, and cloud hosting. Built with FastMCP and the official Model Context Protocol Python SDK.
Available on the MCP Registry (io.github.clouatre-labs/math-mcp-learning-server) and PyPI.

See CONTRIBUTING.md for instructions to record your own demo.
Connect your MCP client to the hosted server:
Claude Desktop (claude_desktop_config.json):
{
"mcpServers": {
"math-cloud": {
"transport": "http",
"url": "https://math-mcp.fastmcp.app/mcp"
}
}
}
{
"mcpServers": {
"math": {
"command": "uvx",
"args": ["math-mcp-learning-server[scientific,plotting]"]
}
}
}
For other installation options (basic, scientific-only, plotting-only), see CONTRIBUTING.md.
| Category | Tool | Description |
|---|---|---|
| Workspace | workspace_save | Save calculations to persistent storage |
workspace_load | Retrieve previously saved calculations | |
| Math | calc_expression | Safely evaluate mathematical expressions |
calc_statistics | Statistical analysis (mean, median, mode, std_dev, variance) | |
calc_interest | Calculate compound interest for investments | |
calc_units | Convert between units (length, weight, temperature) | |
| Matrix | matrix_multiply | Multiply two matrices |
matrix_transpose | Transpose a matrix | |
matrix_determinant | Calculate matrix determinant | |
matrix_inverse | Calculate matrix inverse | |
matrix_eigenvalues | Calculate eigenvalues | |
| Visualization | plot_function | Plot mathematical functions |
plot_histogram | Create statistical histograms | |
plot_line_chart | Create line charts | |
plot_scatter | Create scatter plots | |
plot_box_plot | Create box plots | |
plot_financial_line | Create financial line charts |
math://workspace - Persistent calculation workspace summarymath://history - Chronological calculation historymath://functions - Available mathematical functions referencemath://constants/{constant} - Mathematical constants (pi, e, golden_ratio, etc.)math://catalog/tools - Tool catalog with metadata and usage examplesmath://variables - Active variables in the current workspacemath://test - Server health checkmath_tutor - Structured tutoring prompts (configurable difficulty)formula_explainer - Formula explanation with step-by-step breakdownsSee Usage Examples for detailed examples.
See CONTRIBUTING.md for development setup, testing, and contribution guidelines.
The calc_expression tool uses restricted eval() with a whitelist of allowed characters and functions, restricted global scope (only math module and abs), and no access to dangerous built-ins or imports. All tool inputs are validated with Pydantic models. File operations are restricted to the designated workspace directory. Complete type hints and validation are enforced for all operations.