MCP Arithmetic Server
Click on "Deploy 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 Arithmetic ServerWhat is 12 times 8?"
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 Arithmetic Server
A Model Context Protocol (MCP) server built with Node.js that exposes four arithmetic tools: add, subtract, multiply, and divide.
Prerequisites
Node.js 18+ (for top-level
awaitand ES modules)
Related MCP server: Math Operations MCP Server
Installation
npm installRunning the server
npm startThe server communicates over stdio, so it can be connected to any MCP-compatible client.
MCP Inspector
The MCP Inspector is a tool for inspecting and testing MCP servers. It provides a web UI where you can list tools and call them interactively.
npm run inspectorThis launches the inspector in your browser. In the inspector UI:
Set the transport to
StdioSet the command to
nodeand the args toserver.jsClick Connect
You can then call any of the tools directly from the browser.
Available tools
All four tools share the same input schema — two numbers:
Property | Type | Required | Description |
| number | yes | The first number |
| number | yes | The second number |
add
Adds two numbers together.
{ "a": 5, "b": 7 }Result: 5 + 7 = 12
subtract
Subtracts the second number from the first (a - b).
{ "a": 10, "b": 4 }Result: 10 - 4 = 6
multiply
Multiplies two numbers together.
{ "a": 5, "b": 7 }Result: 5 * 7 = 35
divide
Divides the first number by the second (a / b). Returns an error if b is zero.
{ "a": 15, "b": 3 }Result: 15 / 3 = 5
{ "a": 15, "b": 0 }Result (error): Cannot divide by zero.
Testing locally
You can test the server with the MCP Inspector:
npm run server:inspectConnecting to a client
Configure your MCP client (e.g., Claude Desktop, VS Code Copilot) to use this command:
node D:\Learning_Projects\MCP\server.jsAvailable Tools
4 toolsaddA
Add two numbers and return the result.
| Name | Required | Description | Default |
|---|---|---|---|
| a | Yes | The first number. | |
| b | Yes | The second number. |
TDQS
Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?
No annotations are provided, so the description carries the behavioral burden. For a pure arithmetic function, 'Add two numbers and return the result' fully discloses the behavior—it's deterministic, has no side effects, and returns a numeric result. While it doesn't explicitly state read-only or side-effect-free behavior, those are inherent for this simple operation, so the description is adequate.
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, front-loaded sentence with no wasted words. It states the operation and output clearly, earning every character it uses.
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 is complete. It states the operation, the inputs (implicitly via 'two numbers'), and the output. No output schema exists, but the return type is obvious from context. There are no missing details an agent would need to invoke it 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 input schema already provides descriptions for both parameters ('The first number.' and 'The second number.') with 100% schema description coverage. The tool description adds no additional meaning beyond what the schema states, so the baseline of 3 applies.
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 'Add two numbers and return the result' uses a specific verb ('add') and resource (two numbers) and clearly distinguishes itself from siblings subtract, multiply, and divide. The purpose is unambiguous and action-oriented.
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 (when addition is needed) and the sibling context makes the alternative tools obvious. However, it lacks explicit when-not-to-use conditions or mentions of edge cases, so it falls 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.
divideA
Divide the first number by the second (a / b) and return the result. Returns an error if b is zero.
| Name | Required | Description | Default |
|---|---|---|---|
| a | Yes | The first number. | |
| b | Yes | The second number. |
TDQS
Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?
There are no annotations, so the description carries the behavioral burden. It covers the core behavior by stating that it returns the result and explicitly documents the b=0 error case, which is valuable edge-case transparency.
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?
Two short sentences with no filler. The formula is front-loaded, and the error condition is stated compactly in the second sentence. Every word earns its place.
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, this is complete. It specifies inputs, the operation, the result, and the failure condition. No output schema exists, but the return value is trivially inferable as the numeric quotient.
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 documents both parameters, so the baseline is 3. The description adds useful semantic context beyond the schema: the operation is order-sensitive (a / b), and b must not be zero.
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 ('Divide'), a clear resource ('the first number by the second'), and the exact formula (a / b). This unambiguously distinguishes it from sibling tools like add, subtract, and multiply.
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 tool's operation is clear enough that an agent can infer when to use it: whenever a quotient is needed. It does not explicitly name alternatives or exclusion cases, but the sibling tool set and the formula make the selection obvious.
Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.
multiplyA
Multiply two numbers and return the result.
| Name | Required | Description | Default |
|---|---|---|---|
| a | Yes | The first number. | |
| b | Yes | The second number. |
TDQS
Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?
No annotations exist, so the description carries the full burden. It states a pure computation: take two numbers, multiply, and return a result, implying no side effects. Yet it does not address edge cases, numeric precision, type coercion, or error behavior, leaving some behavioral ambiguity despite the operation's simplicity.
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, front-loaded with the primary action, and contains no filler or redundant modifiers. Every word contributes to understanding the operation and its output.
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 with fully documented parameters, the description covers the essential behavioral contract. Although there is no output schema, 'return the result' is unambiguous in the multiplication context, and no hidden prerequisites or side effects need to be disclosed.
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 already provides 100% coverage with descriptions for both 'a' ('The first number.') and 'b' ('The second number.'). The description adds no additional meaning to the parameters, so the baseline score of 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 uses a specific verb 'Multiply' and specifies the resource ('two numbers') and the output ('return the result'), making the tool's function immediately clear. It is inherently distinct from the add, subtract, and divide siblings, though it does not explicitly name them or differentiate itself beyond the operation name.
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 intended use is implied by the description: if an agent needs to multiply two numbers, this tool is the obvious choice. However, there is no explicit guidance about when to use it versus alternatives, no exclusions, and no mention of situations where a different arithmetic tool would be preferable.
Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.
subtractA
Subtract the second number from the first (a - b) and return the result.
| Name | Required | Description | Default |
|---|---|---|---|
| a | Yes | The first number. | |
| b | Yes | The second number. |
TDQS
Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?
No annotations are present, so the description is the sole source of behavioral transparency. It clearly discloses the exact arithmetic operation, the operand order, and that the result is returned. For this simple pure computation, this covers the relevant behavioral traits.
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 operation and formula with no filler. Every phrase contributes to understanding what the tool does.
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 only two simple numeric parameters, fully documented schema, and no side effects, the description provides everything needed to call it correctly. The explicit (a - b) formula and return statement make the behavior complete without requiring an output schema.
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?
Both parameters are fully documented in the input schema with clear meanings ('first number', 'second number'), so schema coverage is 100% and the baseline is 3. The description reinforces the order by stating b is subtracted from a, but adds no materially new information beyond the schema.
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 uses the precise verb 'Subtract' with the explicit operand order ('second number from the first') and the formula (a - b), making the operation unambiguous. This clearly distinguishes it from siblings 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?
There is no explicit statement of when to use this tool versus add, multiply, or divide. The operation name and formula imply it should be chosen when a difference is needed, but no exclusions or alternative-routing guidance are provided.
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.
4 tool updates
v1.0.0- First observed
add - First observed
divide - First observed
multiply - First observed
subtract
TDQS
Scored across 4 tools
Each tool performs a unique arithmetic operation with no overlap. Clear parameter conventions (a, b) further eliminate ambiguity.
All tool names are single verbs matching their operations exactly: add, subtract, multiply, divide. Perfectly consistent pattern.
Four tools cover the four basic arithmetic operations without redundancy. The scope is narrow and well-suited to the server's purpose.
The core arithmetic operations are fully covered. Minor additions like modulo or exponentiation could be useful, but the current set is coherent and complete for basic arithmetic.
Maintenance
Related MCP Connectors
This MCP server enables users to perform scientific computations regarding linear algebra and vect…
Math.js MCP — wraps the mathjs.org API (free, no auth)
Educational MCP server with 17 math/stats tools, visualizations, and persistent workspace
Related MCP Servers
- AlicenseAqualityDmaintenanceProvides basic mathematical calculation functionality through MCP tools including arithmetic operations, exponentiation, and square root calculations. Features proper error handling for edge cases like division by zero and negative square roots.621 npm2MIT
- AlicenseNot gradedqualityDmaintenanceEnables AI applications to perform basic mathematical operations like addition and subtraction through MCP tools. Also provides REST API endpoints for the same operations.MIT
- AlicenseNot gradedqualityCmaintenanceEnables basic calculator operations such as add, subtract, multiply, and divide through an MCP interface.2 npmISC
- AlicenseAqualityBmaintenanceProvides basic arithmetic operations (add, subtract, multiply, divide) through MCP, enabling AI clients to perform calculations via natural language.46 npmMIT