mcp-math-tools
Click on "Install Server".
Wait a few minutes for the server to deploy. Once ready, it will show a "Started" state.
In the chat, type
@followed by the MCP server name and your instructions, e.g., "@mcp-math-toolsCalculate 15% tip on $85.50 split 3 ways"
That's it! The server will respond to your query, and you can continue using it as needed.
Here is a step-by-step guide with screenshots.
mcp-math-tools
Math and calculation tools for AI agents, exposed via the Model Context Protocol (MCP).
Tools
calculate
Evaluate math expressions safely (no eval). Supports arithmetic operators (+, -, *, /, ^, %), parentheses, functions (sqrt, abs, floor, ceil, round, log, ln, sin, cos, tan, min, max, pow), constants (pi, e), and named variables.
convert_units
Convert between units across six categories:
Length: m, km, cm, mm, mi, yd, ft, in
Weight: kg, g, mg, lb, oz, ton
Temperature: C, F, K
Data: B, KB, MB, GB, TB
Time: s, min, h, d, week
Speed: m/s, km/h, mph, knots
statistics
Statistical analysis on datasets: mean, median, mode, variance, standard deviation, min, max, range, percentile, correlation between two arrays, and a full summary mode.
format_number
Format numbers as: currency ($1,234.56), percentage, scientific notation, binary, octal, hexadecimal, significant figures, or with thousands separators.
percentage_calc
Common percentage operations: X% of Y, what percent X is of Y, percentage change between two values, tip calculator, discount calculator, and markup calculator.
Related MCP server: Math Calculation MCP Server
Installation
npm install
npm run buildUsage with Claude Desktop
Add to your claude_desktop_config.json:
{
"mcpServers": {
"math-tools": {
"command": "node",
"args": ["path/to/mcp-math-tools/dist/index.js"]
}
}
}Examples
Calculate: 2 * (3 + 4) ^ 2 returns 98
Convert: 100 from km/h to mph returns 62.137...
Statistics: summary of [1, 2, 3, 4, 5] returns mean, median, mode, variance, etc.
Format: 1234567.89 as currency returns $1,234,567.89
Percentage: 15% tip on 85.50 bill split 3 ways
License
MIT
Available Tools
5 toolscalculateB
Evaluate a mathematical expression safely. Supports: +, -, *, /, ^ (power), % (modulo), sqrt(), abs(), floor(), ceil(), round(), log() (base 10), ln() (natural), sin(), cos(), tan(), min(), max(), pow(), pi, e. Supports named variables.
| Name | Required | Description | Default |
|---|---|---|---|
| variables | No | Optional named variables, e.g. {"x": 5, "y": 10} | |
| expression | Yes | The math expression to evaluate, e.g. "2 * (3 + 4) ^ 2" |
TDQS
Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?
With no annotations provided, the description must carry the full burden. It mentions 'safely' and specifies that log is base 10 and ln is natural, which adds behavioral context beyond the schema. However, it does not disclose error handling, return type, or limitations (e.g., no complex numbers). Given the absence of annotations, the description provides some transparency but lacks depth on behavior in edge cases.
Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.
Is the description appropriately sized, front-loaded, and free of redundancy?
The description opens with the primary purpose and then efficiently lists supported operations. It is not overly verbose, and the list is necessary to inform the agent of capabilities. The structure is clear and front-loads the key information. It earns a 4 because the list could be seen as a bit dense, but it is appropriately concise for a calculator tool with many operations.
Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.
Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?
The description covers the supported operations and variables, which is adequate for most use cases. However, it does not mention the output format (e.g., returns a number) or error handling for invalid expressions. Given the complexity of the tool (many functions), a note about return values or potential errors would make it more complete. The list of functions is comprehensive, but the lack of detail on edge cases leaves it slightly incomplete.
Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.
Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?
The schema description covers both parameters at 100%, so the baseline is 3. The description mentions support for named variables but does not add semantics beyond the schema's examples. It lists supported functions but these relate to the expression format, not the parameter definitions. No additional meaning is provided, so it remains at the baseline.
Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.
Does the description clearly state what the tool does and how it differs from similar tools?
The description clearly states that the tool evaluates mathematical expressions and lists the supported operators and functions. It does not explicitly differentiate from siblings like convert_units or statistics, but the general-purpose nature is evident from the list of operations. It is specific enough for an agent to understand its core function, though not as exemplary as explicitly naming a sibling to contrast.
Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.
Does the description explain when to use this tool, when not to, or what alternatives exist?
There is no explicit guidance on when to use this tool versus alternatives. The description implies it is for arbitrary math evaluation, but it does not state exclusions or refer to sibling tools. An agent can infer usage from the purpose, but without explicit alternatives, it falls short of providing clear decision criteria.
Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.
convert_unitsA
Convert a value between units. Supported categories: length (m, ft, in, km, mi, cm, mm, yd), weight (kg, lb, oz, g, mg, ton), temperature (C, F, K), data (B, KB, MB, GB, TB), time (s, min, h, d, week), speed (m/s, km/h, mph, knots).
| Name | Required | Description | Default |
|---|---|---|---|
| to | Yes | Target unit, e.g. "mi", "kg", "F" | |
| from | Yes | Source unit, e.g. "km", "lb", "C" | |
| value | Yes | The numeric value to convert |
TDQS
Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?
With no annotations provided, the description carries the full burden of disclosing behavior. It states the core action and supported units but does not mention return format, error handling for unsupported units, precision/rounding behavior, or any side effects. An agent knows what it converts but not what the response looks like or how failures are surfaced.
Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.
Is the description appropriately sized, front-loaded, and free of redundancy?
The description is a single sentence followed by a structured list of categories and units. It is compact, scannable, and front-loaded with the primary action. Every part earns its place; the unit list is dense but necessary for correct invocation.
Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.
Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?
For a simple conversion tool, the description covers supported units and categories, which is the critical information for calling it correctly. It lacks an output schema and does not explain the return type, but the expected output is easily inferred as the converted number. The absence of edge-case details (e.g., temperature offset formulas) is a minor gap, not a blocker.
Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.
Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?
The input schema describes 'from' and 'to' with only single examples (e.g., 'mi', 'kg'), leaving the full set of valid units implicit. The description compensates by exhaustively listing all supported units per category, giving the agent complete vocabulary for these parameters. This adds meaningful semantic value beyond the schema's terse examples.
Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.
Does the description clearly state what the tool does and how it differs from similar tools?
The description opens with 'Convert a value between units,' a clear verb-resource pair that immediately identifies the tool's function. It then enumerates supported categories and their units, which unambiguously distinguishes it from the sibling tools (calculate, statistics, format_number, percentage_calc) that handle arithmetic rather than unit conversion.
Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.
Does the description explain when to use this tool, when not to, or what alternatives exist?
The description implies when to use the tool—when a value needs converting between the listed unit categories. It does not explicitly name alternative tools or state when not to use it, but the context is clear enough given the distinct sibling set. There is no exclusions or 'use X instead' guidance, so it stops short of a 5.
Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.
format_numberA
Format a number in various ways: currency ($1,234.56), percentage (0.15 -> 15%), scientific notation, binary, octal, hexadecimal, significant figures, thousands separator.
| Name | Required | Description | Default |
|---|---|---|---|
| value | Yes | The number to format | |
| format | Yes | The format type | |
| decimals | No | Number of decimal places (default: 2 for currency/percentage/scientific/thousands) | |
| separator | No | Thousands separator character (default: ",") | |
| currency_symbol | No | Currency symbol (default: "$") | |
| significant_figures | No | Number of significant figures (required for significant_figures format) |
TDQS
Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?
No annotations are provided, so the description carries the full burden. The description discloses the supported formats but does not state that this is a pure/read-only transformation, what it returns (a string), or any error behavior. It is not misleading, but it leaves basic behavioral aspects unstated.
Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.
Is the description appropriately sized, front-loaded, and free of redundancy?
The description is a single sentence that front-loads the core action ('Format a number') and immediately provides concrete examples of each format. There is no redundant or filler content; every word contributes to clarifying the tool's purpose.
Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.
Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?
The description, combined with the fully-documented schema, covers all supported formats and parameter roles. It does not explicitly state the return type, but this is strongly implied by the formatting intent. No critical information for calling the tool is missing.
Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.
Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?
Schema description coverage is 100%, so the schema already documents all parameters. The description adds illustrative examples (e.g., $1,234.56) but does not add meaning beyond the schema's parameter descriptions. Baseline 3 is appropriate.
Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.
Does the description clearly state what the tool does and how it differs from similar tools?
The description states a specific verb (format) and resource (a number) and enumerates the supported formats (currency, percentage, scientific, binary, octal, hexadecimal, significant figures, thousands separator), which clearly distinguishes it from sibling tools like calculate or convert_units.
Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.
Does the description explain when to use this tool, when not to, or what alternatives exist?
The description implies the tool is for formatting numbers but does not explicitly state when to use it over percentage_calc or other siblings. There is no mention of exclusions or conditions. For example, when should an agent choose format_number with format='percentage' rather than percentage_calc? This is left to inference.
Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.
percentage_calcA
Common percentage calculations. Operations: percent_of (X% of Y), what_percent (X is what % of Y), percentage_change (old to new), tip (bill + tip% + optional split), discount (price - discount%), markup (cost + markup%).
| Name | Required | Description | Default |
|---|---|---|---|
| part | No | The part value (for what_percent: X is what % of value) | |
| value | No | The base value (for percent_of: Y, for what_percent: the whole, for tip: bill amount, for discount: original price, for markup: cost) | |
| percent | No | The percentage value (for percent_of, tip, discount, markup) | |
| new_value | No | New value (for percentage_change) | |
| old_value | No | Old value (for percentage_change) | |
| operation | Yes | The percentage operation to perform | |
| split_ways | No | Number of people to split the bill (for tip, default: 1) |
TDQS
Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?
With no annotations provided, the description carries the full behavioral disclosure burden. It does explain the semantics of each operation (e.g., percent_of, tip, discount), which is helpful. However, it does not disclose return format, rounding behavior, edge cases like zero values, or error handling, which a calculator tool would benefit from stating.
Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.
Is the description appropriately sized, front-loaded, and free of redundancy?
The description is a single compact sentence that front-loads the tool's purpose and then concisely lists every operation with its relevant inputs. There is no filler or repetition, and it efficiently conveys a lot of operational detail in a small space.
Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.
Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?
The description covers all operations and parameter mappings, and the schema provides rich field descriptions, so the main calling contract is clear. However, there is no output schema and the description does not mention what the tool returns (e.g., a single number, a per-person split amount, or an object), which is a notable gap for an agent executing the tool.
Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.
Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?
Schema description coverage is 100%, so the baseline is already 3. The description adds meaningful operational context by mapping parameters to each operation, such as 'tip (bill + tip% + optional split)' and 'percentage_change (old to new)', clarifying which parameters apply to which calculation. This goes beyond the individual field descriptions.
Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.
Does the description clearly state what the tool does and how it differs from similar tools?
The description clearly states the tool performs common percentage calculations and enumerates six specific operations with their formulas. It is unambiguous about what the tool does, but it does not explicitly distinguish itself from sibling tools like calculate or statistics.
Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.
Does the description explain when to use this tool, when not to, or what alternatives exist?
The description implies usage by listing the supported operations and their parameter mappings, so an agent can infer when to use it for percentage tasks. However, it gives no explicit guidance about when not to use it or when a sibling tool like calculate or statistics would be more appropriate.
Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.
statisticsA
Calculate statistics on a dataset. Operations: mean, median, mode, variance, stddev, min, max, range, percentile, correlation. For percentile provide the 'percentile' parameter (0-100). For correlation provide a second dataset 'dataY'.
| Name | Required | Description | Default |
|---|---|---|---|
| data | Yes | The dataset (array of numbers) | |
| dataY | No | Second dataset for correlation. Must be same length as 'data'. | |
| operation | Yes | The statistical operation to perform. Use 'summary' for all basic stats at once. | |
| percentile | No | The percentile to compute (0-100). Required when operation is 'percentile'. | |
| population | No | If true, use population variance/stddev (N). Default is sample (N-1). |
TDQS
Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?
Since no annotations are provided, the description must carry the full burden of behavioral disclosure. It does reveal operation-specific parameter requirements, which is helpful, but it omits important behaviors such as the existence of the 'summary' operation, the meaning of the 'population' parameter (sample vs population variance), return value structure, and edge-case handling (e.g., empty datasets). This is a moderate amount of transparency but leaves significant behavioral gaps.
Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.
Is the description appropriately sized, front-loaded, and free of redundancy?
The description is concise (two sentences) and front-loaded with the core purpose and operation list. It avoids fluff and uses clear phrasing. However, it omits the 'summary' operation from the list, which is present in the schema enum, making the description slightly incomplete but not wordy.
Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.
Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?
For a tool with 5 parameters, no output schema, and no annotations, the description provides enough to use the main operations but misses key aspects: 'summary' is not mentioned, 'population' behavior is not explained, and there is no indication of return format or edge cases. The description is adequate for basic use but not fully complete for an agent to handle all scenarios correctly.
Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.
Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?
The schema already provides detailed descriptions for all parameters (100% coverage). The description adds minimal value beyond this: it restates that percentile needs the 'percentile' parameter and correlation needs 'dataY', which the schema already documents. It does not clarify the 'population' parameter or the 'summary' operation. With high schema coverage, the baseline is 3, and the description provides no extra semantic depth.
Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.
Does the description clearly state what the tool does and how it differs from similar tools?
The description clearly states 'Calculate statistics on a dataset' and enumerates the supported operations (mean, median, mode, etc.), making the tool's purpose unambiguous and distinct from generic calculators like 'calculate' or 'percentage_calc'. It also provides specific operation names, so an agent can immediately understand what this tool does.
Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.
Does the description explain when to use this tool, when not to, or what alternatives exist?
The description offers some internal guidance (e.g., 'For percentile provide the percentile parameter', 'For correlation provide dataY'), but it does not explicitly state when to use this tool versus the sibling tools (calculate, convert_units, format_number, percentage_calc). There is no exclusion rule or alternative routing, so the when-to-use context is implied rather than explicit.
Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.
Tool Schema Changelog
Recent tool additions, removals, and schema changes observed during successful MCP inspections. Dates show when Glama detected each change.
5 tool updates
v1.0.0- First observed
calculate - First observed
convert_units - First observed
format_number - First observed
percentage_calc - First observed
statistics
TDQS
Each tool serves a clearly distinct purpose: expression evaluation, unit conversion, statistical analysis, number formatting, and percentage-specific calculations. There is no meaningful overlap that would confuse an agent's selection.
Naming conventions are inconsistent: 'calculate' is a bare verb, 'convert_units' and 'format_number' use verb_noun, while 'statistics' and 'percentage_calc' are noun-based with an abbreviation. This lacks a predictable pattern.
With 5 tools, the server is well-scoped for a focused math toolkit. Each tool addresses a distinct category of mathematical need without unnecessary bloat.
The surface covers core math operations: general calculation, conversions, statistics, formatting, and percentages. Minor gaps exist (e.g., equation solving, advanced matrix operations) but are beyond the apparent scope of a general math utility server.
Maintenance
Resources
Unclaimed servers have limited discoverability.
Looking for Admin?
If you are the server author, to access and configure the admin panel.
Related MCP Connectors
Math.js MCP — wraps the mathjs.org API (free, no auth)
Precision math engine for AI agents. 203 exact methods. Zero hallucination.
Safe scientific calculator MCP for numeric expressions
1500+ deterministic tools for AI agents: math, conversion, validation, hashing, encoding, date/time.
Related MCP Servers
- AlicenseAqualityDmaintenanceProvides advanced mathematical utilities including basic arithmetic, statistical analysis, unit conversions, quadratic equation solving, percentage calculations, and trigonometric functions for AI assistants.6MIT
- AlicenseNot gradedqualityDmaintenanceProvides comprehensive mathematical capabilities including basic arithmetic, advanced functions, statistical tools, and access to mathematical constants. It allows users to perform computations and generate math-related prompts through a standardized MCP interface.MIT
- AlicenseCqualityCmaintenanceA comprehensive MCP server that turns any AI assistant into a powerful mathematical computation engine, providing 52 advanced functions, 158 unit conversions, financial calculations, and secure AST-based evaluation.1813MIT
- AlicenseNot gradedqualityDmaintenanceProvides a comprehensive set of mathematical functions as MCP tools, enabling language models to perform calculations including arithmetic, trigonometry, logarithms, and more.231MIT
Latest Blog Posts
- Who's Calling? MCP Hosts Are an Identity Blind Spot (And the Spec Knows It)By Om-Shree-0709 on .mcpAgent IdentityOAuth 2.1
- Your AI Chatbot Just Exposed Your CEO's Salary to an InternBy Om-Shree-0709 on .Agent IdentityMCP SecurityOAuth Delegation
- Why MCP Servers Need Execution Sandboxing (And Why Your Current Stack Isn't Enough)By Om-Shree-0709 on .Agentic AiPrompt InjectionWebAssembly
MCP directory API
We provide all the information about MCP servers via our MCP API.
curl -X GET 'https://glama.ai/api/mcp/v1/servers/rog0x/mcp-math-tools'
If you have feedback or need assistance with the MCP directory API, please join our Discord server