calculator-mcp-server
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., "@calculator-mcp-serveradd 5 and 3"
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.
Calculator MCP Server
A Model Context Protocol server exposing calculator operations, built as a learning project.
Tools
add(a, b)
subtract(a, b)
multiply(a, b)
divide(a, b)
power(base, exponent)
square_root(number)
modulus(a, b)
Related MCP server: Calculator MCP
Run
uv run mcp dev src/calculator_mcp/server.pyTest
uv run pytest tests/ -vArchitecture
operations.py— pure calculator logic, no MCP dependencyserver.py— FastMCP tool registration, thin wrappers over operations.pyexceptions.py— custom exception hierarchy (CalculatorError base)tests/— pytest unit tests, independent of the MCP layer
Connect to Claude Desktop
Add this to claude_desktop_config.json:
{
"mcpServers": {
"calculator": {
"command": "uv",
"args": ["run", "--directory", "/path/to/calculator-mcp-server", "mcp", "run", "src/calculator_mcp/server.py"]
}
}
}This structure generalizes to any MCP server: keep domain logic separate from protocol code, use typed exceptions per failure mode, annotate tools honestly (readOnly/idempotent/destructive/openWorld), and test the logic layer without needing a live server.
Available Tools
7 toolsaddARead-onlyIdempotent
Add two numbers together.
Args: a: The first number. b: The second number.
Returns: The sum of a and b.
| Name | Required | Description | Default |
|---|---|---|---|
| a | Yes | ||
| b | Yes |
Output Schema
| Name | Required | Description |
|---|---|---|
| result | Yes |
TDQS
Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?
Annotations already declare readOnlyHint=true, idempotentHint=true, and destructiveHint=false, covering the safety profile. The description adds "Returns the sum of a and b," which is more of a restatement than new behavioral insight. No extra context about edge cases or errors is provided, but for a pure mathematical operation this is acceptable.
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 extremely concise, front-loaded with the core action, and logically structured with Args and Returns sections. Every sentence contributes meaningful information without redundancy.
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 this simple, the description, combined with rich annotations and an output schema, covers all necessary context. The agent knows it is a safe, deterministic operation that sums two numbers and returns a number, with no missing prerequisites or side effects.
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 only lists parameters a and b with type number and no descriptions. The description adds meaning by labeling a as "The first number" and b as "The second number," which helps an agent understand the ordering and role of each argument. This compensates for the 0% schema description coverage.
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?
"Add two numbers together" is a specific verb+resource combination that clearly distinguishes this tool from siblings like subtract, multiply, and divide. The phrase states exactly what the tool does without ambiguity.
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 (when you need to sum two numbers), but it does not explicitly contrast with alternatives or state when not to use this tool. Given the sibling tools are distinct arithmetic operations, the intended use is clear, but no explicit guidance is provided.
Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.
divideARead-onlyIdempotent
Divide the first number by the second.
Args: a: The number to be divided (the dividend). b: The number to divide by (the divisor). Must not be zero.
Returns: The result of a divided by b.
Raises: DivisionByZeroError: If b is zero.
| Name | Required | Description | Default |
|---|---|---|---|
| a | Yes | ||
| b | Yes |
Output Schema
| Name | Required | Description |
|---|---|---|
| result | Yes |
TDQS
Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?
Annotations already mark the tool as read-only and idempotent, and the description adds critical behavioral context: the divisor must be non-zero and DivisionByZeroError is raised for b=0. This goes beyond the structured annotations.
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 uses a clear Args/Returns/Raises structure with no wasted words. Every sentence adds necessary information: the role of each parameter, the error handling, and the return value.
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 two-number pure function, the description covers inputs, output, and error handling. The presence of an output schema reinforces the return value, and the description is self-contained.
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 only defines a and b as numbers with no descriptions. The description explicitly labels a as the dividend and b as the divisor, and adds the non-zero constraint and error condition, fully compensating for the 0% schema coverage.
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 'Divide the first number by the second,' which clearly states the operation and its two inputs. This distinguishes it from sibling arithmetic operations like modulus, power, and square_root.
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 provides clear division semantics and the non-zero constraint, but does not explicitly discuss when to use division versus alternatives. However, the context is intuitive enough for an agent to select this tool for quotient calculations.
Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.
modulusARead-onlyIdempotent
Compute the remainder when dividing a by b.
Args: a: The dividend. b: The divisor. Must not be zero.
Returns: The remainder of a divided by b.
Raises: DivisionByZeroError: If b is zero.
| Name | Required | Description | Default |
|---|---|---|---|
| a | Yes | ||
| b | Yes |
Output Schema
| Name | Required | Description |
|---|---|---|
| result | Yes |
TDQS
Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?
Beyond annotations, the description discloses that b must not be zero and that DivisionByZeroError is raised if violated, which is critical behavioral context. It also specifies the return value. There is no contradiction with the readOnly and idempotent hints.
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 uses a clear docstring structure with Args, Returns, and Raises sections, making it easy to parse. It is appropriately sized, with each section earning its place, though slightly more verbose than the absolute minimum.
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 arithmetic operation, the description is complete: it covers the operation, both parameters with roles and constraints, the return value, and the error condition. With an output schema present, no additional return structure details are needed.
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 only provides types (number) and titles (A, B), but the description adds semantic meaning by labeling a as the dividend and b as the divisor, plus the constraint that b must not be zero. This fully compensates for the 0% schema description coverage.
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 computes the remainder when dividing a by b, precisely defining the modulus operation. This distinguishes it from sibling tools like divide, which computes the quotient, and other arithmetic operations.
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 use cases for remainder calculations but does not explicitly state when to prefer this tool over alternatives like divide. It lacks clear 'when to use' or 'when not to use' guidance, though the mathematical definition is self-evident.
Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.
multiplyARead-onlyIdempotent
Multiply two numbers together.
Args: a: The first number. b: The second number.
Returns: The product of a and b.
| Name | Required | Description | Default |
|---|---|---|---|
| a | Yes | ||
| b | Yes |
Output Schema
| Name | Required | Description |
|---|---|---|
| result | Yes |
TDQS
Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?
Annotations already indicate readOnlyHint=true, idempotentHint=true, and destructiveHint=false, so the description does not contradict them. However, it adds no extra behavioral context beyond the basic operation, such as edge cases or limitations.
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 extremely concise with a single sentence plus structured Args/Returns sections. No unnecessary words or repetition.
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?
This is a simple arithmetic tool with a clear purpose, minimal parameters, and annotations covering safety. The description covers the operation, parameters, and return value adequately for the tool's complexity.
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 0%, so the description must compensate. It briefly defines 'a' and 'b' as 'first number' and 'second number,' which adds minimal but sufficient meaning beyond the raw parameter names.
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's purpose with a specific verb and resource: 'Multiply two numbers together.' It distinguishes from sibling tools (add, subtract, divide, power) by explicitly naming multiplication.
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 usage is implied by the clear purpose, but the description does not explicitly discuss when to use this tool versus alternatives or mention any exclusions. It lacks explicit guidance like 'for addition, use add'.
Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.
powerARead-onlyIdempotent
Raise a number to a power.
Args: base: The base number. exponent: The power to raise the base to.
Returns: base raised to the power of exponent.
Raises: InvalidPowerOperationError: If the result would be complex, or if the computation overflows.
| Name | Required | Description | Default |
|---|---|---|---|
| base | Yes | ||
| exponent | Yes |
Output Schema
| Name | Required | Description |
|---|---|---|
| result | Yes |
TDQS
Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?
Annotations already declare readOnlyHint, idempotentHint, and destructiveHint=false. The description adds valuable behavioral context by documenting the InvalidPowerOperationError for complex results or overflow, which is not present in annotations. This exceeds the baseline while remaining concise.
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 minimal and well-structured with Args, Returns, and Raises sections. Every line provides essential information without redundancy, making it easy to scan and interpret.
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 arithmetic tool, the description covers the operation, both parameters, the return value, and the primary error case. Annotations cover safety/permanence. No gaps remain, especially given the straightforward domain and sibling context.
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 coverage is 0%, but the description explicitly explains each parameter: 'base: The base number' and 'exponent: The power to raise the base to.' It also clarifies the return value and error conditions, fully compensating for the schema's lack of 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 opens with 'Raise a number to a power,' which is a specific verb+resource statement that clearly distinguishes it from arithmetic siblings like add, multiply, and square_root. The purpose is immediately unambiguous.
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 clearly implies when to use this tool (for exponentiation) by defining exactly what it does. However, it does not explicitly reference alternative tools or state exclusions, such as 'use square_root for inverse operations,' so it misses the top score for direct guidance.
Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.
square_rootARead-onlyIdempotent
Compute the square root of a number.
Args: number: The number to take the square root of. Must be non-negative.
Returns: The square root of number.
Raises: NegativeSquareRootError: If number is negative.
| Name | Required | Description | Default |
|---|---|---|---|
| number | Yes |
Output Schema
| Name | Required | Description |
|---|---|---|
| result | Yes |
TDQS
Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?
Annotations already declare the tool as read-only, idempotent, and non-destructive. The description adds valuable context: the input must be non-negative and a NegativeSquareRootError is raised otherwise. This goes beyond the safety profile to disclose functional constraints and error behavior.
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 compact and well-structured, using Args/Returns/Raises sections. Every sentence serves a purpose, with no redundant filler.
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?
Given the simplicity of the tool (one parameter, pure function), the description is complete. It specifies input, output, and error condition, complementing the existing output schema without needing to repeat return format.
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 provides only the parameter name and type (number), with 0% coverage in the schema description. The description fully compensates by explaining the parameter's meaning ('The number to take the square root of') and the non-negative constraint.
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 operation ('Compute the square root of a number') with a specific verb and resource. It unambiguously distinguishes from the arithmetic sibling tools (add, subtract, etc.) by naming the exact mathematical operation.
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 does not explicitly state when to use this tool over alternatives. The use case is implied by the function name and description, but no exclusions or alternative tool references are given.
Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.
subtractARead-onlyIdempotent
Subtract the second number from the first.
Args: a: The number to subtract from. b: The number to subtract.
Returns: The result of a minus b.
| Name | Required | Description | Default |
|---|---|---|---|
| a | Yes | ||
| b | Yes |
Output Schema
| Name | Required | Description |
|---|---|---|
| result | Yes |
TDQS
Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?
Annotations already indicate readOnly and non-destructive behavior. The description adds value by clarifying operand order (a is subtracted from, b is subtracted) and explicitly stating the return value ('The result of a minus b'). No contradiction with annotations.
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, with a clear first line followed by a structured Args/Returns format. Every sentence adds necessary information with no filler.
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 arithmetic function with two numeric inputs and a numeric output, the description fully covers operation, parameters, and return value. Output schema exists, and annotations cover safety, so the description is complete.
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?
With 0% schema description coverage, the description fully compensates by defining each parameter: 'a: The number to subtract from' and 'b: The number to subtract.' Both parameters are clearly semantically described.
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 'Subtract the second number from the first,' which is a specific action and resource. It unambiguously differentiates this tool from siblings like add, multiply, and divide.
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?
No explicit guidance on when to use this tool versus alternatives, but the operation is self-explanatory and usage is implied by the name and description. There is no comparison to siblings, so it remains at the 'implied usage' level.
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.
7 tool updates
v0.1.0- First observed
add - First observed
divide - First observed
modulus - First observed
multiply - First observed
power - First observed
square_root - First observed
subtract
TDQS
Scored across 7 tools
Each tool performs a distinct mathematical operation: add, subtract, multiply, divide, modulus, square_root, and power. There is no overlap or ambiguity between them, so an agent will never have to guess which tool to use for a given operation.
The names are clear and short, but not perfectly uniform: add, subtract, multiply, divide, and power are verbs, while modulus and square_root are nouns. However, this is a common and readable convention for math operations, and the intent is obvious.
With 7 tools, the server is well-scoped for a calculator. It covers basic arithmetic plus modulus, square root, and power, which is a reasonable and expected set for the purpose without unnecessary bloat.
The core arithmetic and common math operations are present, providing good coverage for a calculator server. Minor omissions like absolute value or factorial exist, but they are not essential for the primary purpose and agents can typically work around them.
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
Model Context Protocol server for Studex tools, notifications, and profile integrations
Safe scientific calculator MCP for numeric expressions
Model Context Protocol server for todo.vu task management and time tracking.
Deterministic time-value-of-money and fund-performance tools for AI agents — future value, present value, CAGR, annuities, perpetuities, loan payments, payback, discounted payback, DPI, RVPI and TVPI via Model Context Protocol. Useful for corporate finance, financial projections, financial analysis, quantitative analysis, financial formulas and financial modeling.
Related MCP Servers
- FlicenseNot gradedqualityDmaintenanceProvides basic arithmetic operations and advanced mathematical functions through the Model Context Protocol (MCP), with features like calculation history tracking and expression evaluation.1-
- AlicenseBqualityDmaintenanceProvides mathematical computation capabilities including basic arithmetic operations (add, subtract, multiply, divide), advanced functions (square root, factorial, logarithm), and trigonometric functions (sin, cos, tan) through the Model Context Protocol.5MIT
- FlicenseAqualityDmaintenanceProvides basic mathematical operations including addition, subtraction, multiplication, division, and power calculations through a Model Context Protocol interface.51-
- FlicenseNot gradedqualityDmaintenanceProvides basic arithmetic operations (add, multiply, divide) for AI assistants through the Model Context Protocol.-