MCP 服务器

Math MCP Learning

io.github.clouatre-labs/math-mcp-learning-server
数据与分析 教育 科学与工程 公开且可连接 MCP 2025-11-25

此 MCP 可以做什么

Provides mathematical and statistical calculations, matrix operations, unit conversions, educational plots, and persistent calculation storage.

calc_expression
Mathematical Calculator
Safely 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 descriptive statistics over a list of numbers, use the statistics tool instead. Examples: - "2 + 3 * 4" → 14 - "sqrt(16)" → 4.0 - "sin(3.14159/2)" → 1.0
只读 幂等
输入模式
{'type': 'object', 'required': ['expression'], 'properties': {'expression': {'type': 'string', 'maxLength': 500, 'description': "Mathematical expression to evaluate. Supports +, -, *, /, **, and math functions (sin, cos, sqrt, log, etc.). Example: '2 * sin(pi/4) + sqrt(16)'"}}, 'additionalProperties': False}
输出模式
{'type': 'object', 'required': ['expression', 'result', 'difficulty', 'topic'], 'properties': {'topic': {'type': 'string'}, 'result': {'type': 'number'}, 'difficulty': {'type': 'string'}, 'expression': {'type': 'string'}}, 'description': 'Result of a mathematical expression evaluation.'}
calc_interest
Compound Interest Calculator
Calculate 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 5 years → $12,762.82 compound_interest(5000, 0.03, 10, 12) # $5,000 at 3% compounded monthly → $6,744.25
只读 幂等
输入模式
{'type': 'object', 'required': ['principal', 'rate', 'time'], 'properties': {'rate': {'type': 'number', 'maximum': 1.0, 'minimum': 0, 'description': 'Annual interest rate as decimal 0.0-1.0 (e.g. 0.05 = 5%). If entering a percentage, divide by 100 first.'}, 'time': {'type': 'number', 'description': 'Investment time in years (must be > 0), e.g. 10.0', 'exclusiveMinimum': 0}, 'principal': {'type': 'number', 'description': 'Initial investment amount in dollars (must be > 0), e.g. 1000.0', 'exclusiveMinimum': 0}, 'compounds_per_year': {'type': 'integer', 'default': 12, 'description': 'Compounding frequency per year (must be > 0): 12=monthly, 365=daily', 'exclusiveMinimum': 0}}, 'additionalProperties': False}
输出模式
{'type': 'object', 'required': ['principal', 'final_amount', 'total_interest', 'rate', 'time', 'compounds_per_year', 'difficulty', 'topic', 'formula'], 'properties': {'rate': {'type': 'number'}, 'time': {'type': 'number'}, 'topic': {'type': 'string'}, 'formula': {'type': 'string'}, 'principal': {'type': 'number'}, 'difficulty': {'type': 'string'}, 'final_amount': {'type': 'number'}, 'total_interest': {'type': 'number'}, 'compounds_per_year': {'type': 'integer'}}, 'description': 'Result of compound interest calculation.'}
calc_statistics
Statistical Analysis
Perform 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. Examples: statistics([1.0, 2.5, 3.0, 4.5, 5.0], "mean") # Returns 3.2 statistics([1.0, 2.5, 3.0, 4.5, 5.0], "std_dev") # Returns ~1.58
只读 幂等
输入模式
{'type': 'object', 'required': ['numbers', 'operation'], 'properties': {'numbers': {'type': 'array', 'items': {'type': 'number'}, 'maxItems': 10000, 'description': 'List of numbers to compute descriptive statistics on. Example: [1.0, 2.5, 3.0, 4.5, 5.0]'}, 'operation': {'type': 'string', 'examples': ['mean', 'median', 'mode', 'std_dev', 'variance'], 'description': 'Statistical operation to perform. Allowed values: mean, median, mode, std_dev, variance'}}, 'additionalProperties': False}
输出模式
{'type': 'object', 'required': ['operation', 'result', 'sample_size', 'difficulty', 'topic'], 'properties': {'topic': {'type': 'string'}, 'result': {'type': 'number'}, 'operation': {'type': 'string'}, 'difficulty': {'type': 'string'}, 'sample_size': {'type': 'integer'}}, 'description': 'Result of statistical calculation.'}
calc_units
Unit Converter
Convert 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(150, "lb", "kg", "weight") # 150 pounds → 68.04 kilograms
只读 幂等
输入模式
{'type': 'object', 'required': ['value', 'from_unit', 'to_unit', 'unit_type'], 'properties': {'value': {'type': 'number', 'description': 'Numeric value to convert, e.g., 100.0'}, 'to_unit': {'type': 'string', 'examples': ['ft', 'lb', 'f'], 'description': 'Target unit abbreviation. Valid units depend on unit_type: length (mm, cm, m, km, in, ft, yd, mi), weight (g, kg, oz, lb), temperature (c, f, k)'}, 'from_unit': {'type': 'string', 'examples': ['m', 'kg', 'c'], 'description': 'Source unit abbreviation. Valid units depend on unit_type: length (mm, cm, m, km, in, ft, yd, mi), weight (g, kg, oz, lb), temperature (c, f, k)'}, 'unit_type': {'type': 'string', 'examples': ['length', 'weight', 'temperature'], 'description': 'Unit category: length, weight, or temperature'}}, 'additionalProperties': False}
输出模式
{'type': 'object', 'required': ['value', 'from_unit', 'to_unit', 'converted_value', 'unit_type', 'difficulty', 'topic'], 'properties': {'topic': {'type': 'string'}, 'value': {'type': 'number'}, 'to_unit': {'type': 'string'}, 'from_unit': {'type': 'string'}, 'unit_type': {'type': 'string'}, 'difficulty': {'type': 'string'}, 'converted_value': {'type': 'number'}}, 'description': 'Result of unit conversion.'}
matrix_determinant
Matrix Determinant
Calculate the determinant of a square matrix. 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
只读 幂等
输入模式
{'type': 'object', 'required': ['matrix'], 'properties': {'matrix': {'type': 'array', 'items': {'type': 'array', 'items': {'type': 'number'}}, 'maxItems': 10000, 'description': '2D list of numbers representing a square matrix. Each inner list is a row. Example: [[1, 2], [3, 4]]'}}, 'additionalProperties': False}
输出模式
{'type': 'object', 'required': ['size', 'determinant', 'difficulty', 'topic'], 'properties': {'size': {'type': 'integer'}, 'topic': {'type': 'string'}, 'difficulty': {'type': 'string'}, 'determinant': {'type': 'number'}}, 'description': 'Result of matrix determinant calculation.'}
matrix_eigenvalues
Matrix Eigenvalues
Calculate the eigenvalues of a square matrix. 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
只读 幂等
输入模式
{'type': 'object', 'required': ['matrix'], 'properties': {'matrix': {'type': 'array', 'items': {'type': 'array', 'items': {'type': 'number'}}, 'maxItems': 10000, 'description': '2D list of numbers representing a square matrix. Each inner list is a row. Example: [[4, 2], [1, 3]]'}}, 'additionalProperties': False}
输出模式
{'type': 'object', 'required': ['size', 'success', 'difficulty', 'topic'], 'properties': {'size': {'type': 'integer'}, 'error': {'anyOf': [{'type': 'string'}, {'type': 'null'}], 'default': None}, 'topic': {'type': 'string'}, 'success': {'type': 'boolean'}, 'difficulty': {'type': 'string'}, 'eigenvalues': {'anyOf': [{'type': 'array', 'items': {'type': 'number'}}, {'type': 'null'}], 'default': None}, 'eigenvectors': {'anyOf': [{'type': 'array', 'items': {'type': 'array', 'items': {'type': 'number'}}}, {'type': 'null'}], 'default': None}, 'complex_values': {'anyOf': [{'type': 'array', 'items': {'type': 'string'}}, {'type': 'null'}], 'default': None}, 'complex_eigenvalues_warning': {'anyOf': [{'type': 'string'}, {'type': 'null'}], 'default': None}}, 'description': 'Result of matrix eigenvalues calculation.'}
matrix_inverse
Matrix Inverse
Calculate the inverse of a square matrix. Note: Requires NumPy. Raises ValueError if NumPy is unavailable. Examples: matrix_inverse([[1, 2], [3, 4]]) matrix_inverse([[2, 0], [0, 2]]) # Diagonal matrix
只读 幂等
输入模式
{'type': 'object', 'required': ['matrix'], 'properties': {'matrix': {'type': 'array', 'items': {'type': 'array', 'items': {'type': 'number'}}, 'maxItems': 10000, 'description': '2D list of numbers representing a square matrix. Each inner list is a row. Example: [[1, 2], [3, 4]]'}}, 'additionalProperties': False}
输出模式
{'type': 'object', 'required': ['size', 'success', 'difficulty', 'topic'], 'properties': {'size': {'type': 'integer'}, 'error': {'anyOf': [{'type': 'string'}, {'type': 'null'}], 'default': None}, 'topic': {'type': 'string'}, 'success': {'type': 'boolean'}, 'difficulty': {'type': 'string'}, 'result_matrix': {'anyOf': [{'type': 'array', 'items': {'type': 'array', 'items': {'type': 'number'}}}, {'type': 'null'}], 'default': None}}, 'description': 'Result of matrix inverse calculation.'}
matrix_multiply
Matrix Multiplication
Multiply two matrices (A × B). 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]])
只读 幂等
输入模式
{'type': 'object', 'required': ['matrix_a', 'matrix_b'], 'properties': {'matrix_a': {'type': 'array', 'items': {'type': 'array', 'items': {'type': 'number'}}, 'maxItems': 10000, 'description': '2D list of numbers representing the first matrix. Each inner list is a row. Example: [[1, 2], [3, 4]]'}, 'matrix_b': {'type': 'array', 'items': {'type': 'array', 'items': {'type': 'number'}}, 'maxItems': 10000, 'description': '2D list of numbers representing the second matrix. Each inner list is a row. Example: [[5, 6], [7, 8]]'}}, 'additionalProperties': False}
输出模式
{'type': 'object', 'required': ['rows_a', 'cols_a', 'rows_b', 'cols_b', 'result_matrix', 'difficulty', 'topic'], 'properties': {'topic': {'type': 'string'}, 'cols_a': {'type': 'integer'}, 'cols_b': {'type': 'integer'}, 'rows_a': {'type': 'integer'}, 'rows_b': {'type': 'integer'}, 'difficulty': {'type': 'string'}, 'result_matrix': {'type': 'array', 'items': {'type': 'array', 'items': {'type': 'number'}}}}, 'description': 'Result of matrix multiplication operation.'}
matrix_transpose
Matrix Transpose
Transpose a matrix (swap rows and columns). Note: Requires NumPy. Raises ValueError if NumPy is unavailable. Examples: matrix_transpose([[1, 2, 3], [4, 5, 6]]) matrix_transpose([[1], [2], [3]])
只读 幂等
输入模式
{'type': 'object', 'required': ['matrix'], 'properties': {'matrix': {'type': 'array', 'items': {'type': 'array', 'items': {'type': 'number'}}, 'maxItems': 10000, 'description': '2D list of numbers representing the matrix. Each inner list is a row. Example: [[1, 2, 3], [4, 5, 6]]'}}, 'additionalProperties': False}
输出模式
{'type': 'object', 'required': ['original_rows', 'original_cols', 'result_matrix', 'difficulty', 'topic'], 'properties': {'topic': {'type': 'string'}, 'difficulty': {'type': 'string'}, 'original_cols': {'type': 'integer'}, 'original_rows': {'type': 'integer'}, 'result_matrix': {'type': 'array', 'items': {'type': 'array', 'items': {'type': 'number'}}}}, 'description': 'Result of matrix transpose operation.'}
plot_box_plot
Box Plot
Create a box plot for comparing distributions (requires matplotlib). Examples: plot_box_plot([[1, 2, 3, 4, 5], [2, 4, 6, 8, 10]], group_labels=["A", "B"]) plot_box_plot([[10, 20, 30], [15, 25, 35], [5, 15, 25]], title="Comparison")
只读 幂等
输入模式
{'type': 'object', 'required': ['data_groups'], 'properties': {'color': {'anyOf': [{'type': 'string', 'maxLength': 100}, {'type': 'null'}], 'default': None, 'description': "Box color (name or hex code, e.g., 'blue', '#2E86AB')"}, 'title': {'type': 'string', 'default': 'Box Plot', 'maxLength': 100, 'description': "Chart title string, e.g., 'Distribution Comparison'"}, 'y_label': {'type': 'string', 'default': 'Values', 'maxLength': 100, 'description': "Y-axis label, e.g., 'Values'"}, 'data_groups': {'type': 'array', 'items': {'type': 'array', 'items': {'type': 'number'}}, 'maxItems': 100, 'description': 'List of data groups to compare, e.g., [[1, 2, 3], [4, 5, 6]]'}, 'group_labels': {'anyOf': [{'type': 'array', 'items': {'type': 'string'}, 'maxItems': 100}, {'type': 'null'}], 'default': None, 'description': "Labels for each group, e.g., ['Group A', 'Group B']"}}, 'additionalProperties': False}
plot_financial_line
Financial Line Chart
Generate and plot synthetic financial price data (requires matplotlib). Creates realistic price movement patterns for educational purposes. Does not use real market data. Note: Use for time-series price data with optional moving average overlay. For general XY data, use plot_line_chart instead. Examples: plot_financial_line(days=60, trend='bullish') plot_financial_line(days=90, trend='volatile', start_price=150.0, color='orange')
只读 幂等
输入模式
{'type': 'object', 'properties': {'days': {'type': 'integer', 'default': 30, 'maximum': 1000, 'minimum': 2, 'description': 'Number of days to generate, e.g., 30'}, 'color': {'anyOf': [{'type': 'string', 'maxLength': 100}, {'type': 'null'}], 'default': None, 'description': "Line color (name or hex code, e.g., 'blue', '#2E86AB')"}, 'trend': {'type': 'string', 'default': 'bullish', 'examples': ['bullish', 'bearish', 'volatile'], 'description': 'Market trend direction'}, 'start_price': {'type': 'number', 'default': 100.0, 'description': 'Starting price value, e.g., 100.0'}}, 'additionalProperties': False}
plot_function
Function Plotter
Generate mathematical function plots (requires matplotlib). Examples: plot_function("x**2", (-5, 5)) plot_function("sin(x)", (-3.14, 3.14))
只读 幂等
输入模式
{'type': 'object', 'required': ['expression', 'x_range'], 'properties': {'x_range': {'type': 'array', 'maxItems': 2, 'minItems': 2, 'description': 'X-axis range as (min, max), e.g., (-5.0, 5.0)', 'prefixItems': [{'type': 'number'}, {'type': 'number'}]}, 'expression': {'type': 'string', 'maxLength': 500, 'description': 'Mathematical expression to plot, e.g., "x**2" or "sin(x)". Must be <= MAX_EXPRESSION_LENGTH characters. Example: "x**2"'}, 'num_points': {'type': 'integer', 'default': 100, 'maximum': 10000, 'minimum': 2, 'description': 'Number of sample points to plot along x_range, e.g., 100'}}, 'additionalProperties': False}
plot_histogram
Statistical Histogram
Create statistical histograms (requires matplotlib). Examples: plot_histogram([1.0, 2.0, 2.5, 3.0, 3.5, 4.0, 5.0]) plot_histogram([10, 20, 30, 40, 50], bins=5, title="Test Scores")
只读 幂等
输入模式
{'type': 'object', 'required': ['data'], 'properties': {'bins': {'type': 'integer', 'default': 20, 'description': 'Number of histogram bins, e.g., 20'}, 'data': {'type': 'array', 'items': {'type': 'number'}, 'maxItems': 10000, 'description': 'List of numeric values to bin, e.g., [1.0, 2.0, 2.5, 3.0]'}, 'title': {'type': 'string', 'default': 'Data Distribution', 'maxLength': 100, 'description': "Chart title string, e.g., 'Data Distribution'"}}, 'additionalProperties': False}
plot_line_chart
Line Chart
Create a line chart from data points (requires matplotlib). Note: Use for general XY data. For time-series price data with optional moving average, use plot_financial_line instead. Examples: plot_line_chart([1, 2, 3, 4], [1, 4, 9, 16], title="Squares") plot_line_chart([0, 1, 2], [0, 1, 4], color='red', x_label='Time', y_label='Distance')
只读 幂等
输入模式
{'type': 'object', 'required': ['x_data', 'y_data'], 'properties': {'color': {'anyOf': [{'type': 'string', 'maxLength': 100}, {'type': 'null'}], 'default': None, 'description': "Line color (name or hex code, e.g., 'blue', '#2E86AB')"}, 'title': {'type': 'string', 'default': 'Line Chart', 'maxLength': 100, 'description': "Chart title string, e.g., 'Squares'"}, 'x_data': {'type': 'array', 'items': {'type': 'number'}, 'maxItems': 10000, 'description': 'X-axis data points, e.g., [1, 2, 3, 4]'}, 'y_data': {'type': 'array', 'items': {'type': 'number'}, 'maxItems': 10000, 'description': 'Y-axis data points, e.g., [1, 4, 9, 16]'}, 'x_label': {'type': 'string', 'default': 'X', 'maxLength': 100, 'description': "X-axis label, e.g., 'Time'"}, 'y_label': {'type': 'string', 'default': 'Y', 'maxLength': 100, 'description': "Y-axis label, e.g., 'Distance'"}, 'show_grid': {'type': 'boolean', 'default': True, 'description': 'Whether to display grid lines'}}, 'additionalProperties': False}
plot_scatter
Scatter Plot
Create a scatter plot from data points (requires matplotlib). Examples: plot_scatter([1, 2, 3, 4], [1, 4, 9, 16], title="Correlation Study") plot_scatter([1, 2, 3], [2, 4, 5], color='purple', point_size=100)
只读 幂等
输入模式
{'type': 'object', 'required': ['x_data', 'y_data'], 'properties': {'color': {'anyOf': [{'type': 'string', 'maxLength': 100}, {'type': 'null'}], 'default': None, 'description': "Point color (name or hex code, e.g., 'blue', '#2E86AB')"}, 'title': {'type': 'string', 'default': 'Scatter Plot', 'maxLength': 100, 'description': "Chart title string, e.g., 'Correlation Study'"}, 'x_data': {'type': 'array', 'items': {'type': 'number'}, 'maxItems': 10000, 'description': 'X-axis data points, e.g., [1, 2, 3, 4]'}, 'y_data': {'type': 'array', 'items': {'type': 'number'}, 'maxItems': 10000, 'description': 'Y-axis data points, e.g., [1, 4, 9, 16]'}, 'x_label': {'type': 'string', 'default': 'X', 'maxLength': 100, 'description': "X-axis label, e.g., 'Variable X'"}, 'y_label': {'type': 'string', 'default': 'Y', 'maxLength': 100, 'description': "Y-axis label, e.g., 'Variable Y'"}, 'point_size': {'type': 'integer', 'default': 50, 'description': 'Scatter point size in points^2, e.g., 50'}}, 'additionalProperties': False}
workspace_load
Load Variable
Load previously saved calculation result from workspace. Examples: load_variable("portfolio_return") # Returns saved calculation load_variable("circle_area") # Access across sessions
只读 幂等
输入模式
{'type': 'object', 'required': ['name'], 'properties': {'name': {'type': 'string', 'description': "Name of the variable to load from workspace, e.g., 'circle_area'"}}, 'additionalProperties': False}
输出模式
{'type': 'object', 'required': ['success', 'name', 'action'], 'properties': {'name': {'type': 'string'}, 'error': {'anyOf': [{'type': 'string'}, {'type': 'null'}], 'default': None}, 'topic': {'anyOf': [{'type': 'string'}, {'type': 'null'}], 'default': None}, 'action': {'type': 'string'}, 'result': {'anyOf': [{'type': 'number'}, {'type': 'null'}], 'default': None}, 'success': {'type': 'boolean'}, 'timestamp': {'anyOf': [{'type': 'string'}, {'type': 'null'}], 'default': None}, 'difficulty': {'anyOf': [{'type': 'string'}, {'type': 'null'}], 'default': None}, 'expression': {'anyOf': [{'type': 'string'}, {'type': 'null'}], 'default': None}, 'session_id': {'anyOf': [{'type': 'string'}, {'type': 'null'}], 'default': None}, 'available_variables': {'anyOf': [{'type': 'array', 'items': {'type': 'string'}}, {'type': 'null'}], 'default': None}}, 'description': 'Result of loading a variable from the workspace.'}
workspace_save
Save Calculation to Workspace
Save 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)
输入模式
{'type': 'object', 'required': ['name', 'expression', 'result'], 'properties': {'name': {'type': 'string', 'maxLength': 50, 'description': "Variable name for the saved calculation. Used to retrieve it later. Example: 'circle_area'"}, 'result': {'type': 'number', 'description': 'Numeric result of evaluating the expression, e.g., 78.54'}, 'expression': {'type': 'string', 'maxLength': 500, 'description': "The mathematical expression that was evaluated. Example: 'pi * r**2'"}}, 'additionalProperties': False}
输出模式
{'type': 'object', 'required': ['name', 'expression', 'result', 'success', 'is_new', 'total_variables', 'difficulty', 'topic'], 'properties': {'name': {'type': 'string'}, 'topic': {'type': 'string'}, 'action': {'type': 'string', 'default': 'save_calculation'}, 'is_new': {'type': 'boolean'}, 'result': {'type': 'number'}, 'success': {'type': 'boolean'}, 'difficulty': {'type': 'string'}, 'expression': {'type': 'string'}, 'session_id': {'anyOf': [{'type': 'string'}, {'type': 'null'}], 'default': None}, 'total_variables': {'type': 'integer'}}, 'description': 'Result of saving a calculation to the workspace.'}
已添加
plot_financial_line
2026年9月17日 12:41
已添加
plot_box_plot
2026年9月17日 12:41
已添加
plot_scatter
2026年9月17日 12:41
已添加
plot_line_chart
2026年9月17日 12:41
已添加
plot_histogram
2026年9月17日 12:41
已添加
plot_function
2026年9月17日 12:41
已添加
workspace_load
2026年9月17日 12:41
已添加
workspace_save
2026年9月17日 12:41
已添加
matrix_eigenvalues
2026年9月17日 12:41
已添加
matrix_inverse
2026年9月17日 12:41
已添加
matrix_determinant
2026年9月17日 12:41
已添加
matrix_transpose
2026年9月17日 12:41
已添加
matrix_multiply
2026年9月17日 12:41
已添加
calc_units
2026年9月17日 12:41
已添加
calc_interest
2026年9月17日 12:41
已添加
calc_statistics
2026年9月17日 12:41
已添加
calc_expression
2026年9月17日 12:41