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 ServerWhat is 1234 * 5678?"
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.
My First MCP Server — Setup Journey
A step-by-step log of building and connecting my first Model Context Protocol server to Claude Desktop, using the official Python SDK. This README documents exactly what was done, in order, including the issues hit along the way.
Built on: macOS Monterey 12.7.6, Intel i5, 8GB RAM (2015 MacBook Pro).
What is MCP
MCP lets an app like Claude Desktop call out to a local program (a "server") for tools and live data, instead of relying only on the model's built-in knowledge. This project builds a simple calculator server and connects it to Claude Desktop as a working example.
SDK used: modelcontextprotocol/python-sdk
Related MCP server: Calculator MCP Server
Steps followed
1. Install uv (Python package/project manager)
uv wasn't installed, so:
curl -LsSf https://astral.sh/uv/install.sh | sh
source $HOME/.local/bin/env
uv --version2. Create the project
mkdir mcp-test && cd mcp-test
uv init
uv add "mcp[cli]"Issue hit: uv init defaulted requires-python to >=3.14, a version with no prebuilt wheel for the cryptography dependency — uv add sat compiling it from source for a very long time.
Fix: pin the project to a more compatible Python version:
sed -i '' 's/requires-python = ">=3.14"/requires-python = ">=3.10"/' pyproject.toml
rm -rf .venv
uv venv --python 3.12
uv add "mcp[cli]"This installed cleanly using a prebuilt wheel.
3. Write the server
Created calculator_server.py using mcp.server.MCPServer, exposing calculator functions as tools (add, subtract, multiply, divide, power, square_root, percentage) and a small in-memory calculation log as a resource (history://recent), so tool calls and resource reads could both be demonstrated.
4. Test locally with the MCP Inspector
uv run mcp dev calculator_server.pyIssue hit: npx not found — the Inspector needs Node.js, which wasn't installed.
Fix: installed Node via nvm (chosen over Homebrew, since Homebrew's latest Node bottle isn't well supported on macOS Monterey and risked a slow/failing source build):
curl -o- https://raw.githubusercontent.com/nvm-sh/nvm/v0.40.1/install.sh | bash
source ~/.zshrc
nvm install 20
nvm use 20Reran uv run mcp dev calculator_server.py — it started the Inspector proxy and printed a local URL with an auth token. Opened that URL in the browser and confirmed:
Tools tab → called
multiply(6, 7)→ got42Resources tab → opened
history://recent→ saw the call logged
5. Connect the server to Claude Desktop
In Claude Desktop: Settings → Developer → Local MCP servers → Edit Config.
Issue hit: manually opening claude_desktop_config.json via terminal initially showed an unrelated app-preferences file, not the MCP config — resolved by using the in-app Edit Config button instead of guessing the file path, since it opens the correct file for the installed build.
Added:
{
"mcpServers": {
"calculator": {
"command": "/Users/<you>/.local/bin/uv",
"args": [
"--directory",
"/Users/<you>/Documents/mcp-test",
"run",
"calculator_server.py"
]
}
}
}Used the full path to uv (from which uv) since Claude Desktop's process doesn't inherit the terminal shell's PATH.
6. Verify it's actually working
In Settings → Developer, the calculator server showed status running.
In a chat, confirmed the calculator toggle was on under the "+" → connectors menu, then asked Claude a question it could only answer using the tool's live state:
"What's in my calculator history?"
First attempt returned no history — because the earlier questions asked ("what's 84 divided by 12") were simple enough that Claude just computed them mentally instead of calling the tool. Asking more explicitly:
"Use the calculator tool for 84 divided by 12, and 15% of 200."
produced a response tagged "used calculator integration" in the UI — confirming the tool call was real, not just model math.
Result
A working local MCP server with 7 tools and 1 resource, connected to Claude Desktop, verified end-to-end via real tool invocation (not just Claude's own arithmetic).
Project structure
mcp-test/
├── calculator_server.py # the MCP server
├── pyproject.toml # project + dependency config (Python >=3.10)
├── uv.lock # locked dependency versions
└── README.md # this fileReference
Available Tools
7 toolsaddA
Add two numbers.
| 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?
With no annotations, the description carries the full burden. 'Add two numbers' fully describes the behavior for a pure arithmetic operation with no side effects, hidden state, or special requirements. The simplicity of the operation makes this sufficient.
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, ultra-concise sentence with no wasted words. It is perfectly front-loaded and 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 trivial two-number addition with an output schema and no nested objects, the description is complete. The simplicity of the tool means no further context is required.
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 mentions 'two numbers' which maps to parameters a and b, but does not provide individual parameter detail. Since addition is commutative, order is irrelevant, and the description is minimally adequate.
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' clearly states the specific verb 'Add' and the resource 'two numbers', which unambiguously distinguishes this from sibling tools like subtract, 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?
The description does not explicitly state when to use this tool versus alternatives, but the purpose itself implies usage: use when you need to add two numbers. No exclusions or alternative recommendations are provided, so it relies on the obviousness of the operation.
Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.
divideA
Divide a by b. Raises an error if b is 0.
| 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?
With no annotations provided, the description carries the full burden. It discloses the critical error condition when b is 0, which is a key behavioral trait beyond the operation itself. It doesn't explicitly mention purity or side effects, but the arithmetic context makes these less critical.
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, consisting of two short sentences. It front-loads the main operation and then adds the error condition, with no waste.
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 and the presence of an output schema, the description covers the essential aspects: the operation and the error condition. It is sufficiently complete for an agent 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 description 'Divide a by b' clarifies the roles of the parameters: a is the dividend and b is the divisor. This adds meaning beyond the schema, which only has titles 'A' and 'B' with no descriptions, 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 explicitly states 'Divide a by b', which is a specific verb and resource that clearly distinguishes this tool from siblings like add 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 description provides clear context for the division operation, making it obvious when to use this tool. However, it does not explicitly mention alternatives or exclusions, so it doesn't earn a 5.
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.
| 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 are absent, so the description carries the full burden for behavioral disclosure. 'Multiply two numbers' accurately describes the core operation, but does not disclose edge cases, error handling, or return behavior. However, for a trivial arithmetic operation, this minimal description is acceptable and not misleading.
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, 'Multiply two numbers,' with no filler words or redundant information. It is effectively front-loaded and maximally concise.
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 two-number multiply tool with an existing output schema, the description covers the essential purpose. It lacks details on return values or edge cases, but these are not critical given the tool's triviality and the presence of 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?
Schema description coverage is 0%, so the description must compensate for the lack of parameter details. It confirms that both parameters are numbers and are to be multiplied, but does not explain individual roles. Since multiplication is commutative, the symmetry reduces the need for further clarification.
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 the specific verb 'Multiply' and the resource 'two numbers', which clearly distinguishes it from sibling tools like add, subtract, divide, power, square_root, and percentage. There is no ambiguity about what the 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?
No guidance is given on when to use this tool versus the sibling arithmetic operations. The description does not mention any alternatives, exclusions, or context for when multiplication is preferred.
Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.
percentageA
Return what percent 'part' is of 'whole'.
| Name | Required | Description | Default |
|---|---|---|---|
| part | Yes | ||
| whole | Yes |
Output Schema
| Name | Required | Description |
|---|---|---|
| result | Yes |
TDQS
Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?
The description defines the operation as 'what percent part is of whole', which implies the formula (part/whole)*100. However, it does not disclose edge cases such as if whole is zero, whether the result is rounded, or the exact format of the return value (e.g., 50 vs 0.5). With no annotations, this leaves some behavioral aspects unspecified.
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, short sentence that immediately states the purpose. Every word contributes to understanding, with no filler or redundant information.
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 two-parameter arithmetic tool, the description is adequate. It explains the core operation, and since an output schema exists, the return value does not need to be described in the text. It lacks edge-case notes but these are not critical for a basic percentage calculator.
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 provides parameter names (part, whole) with no descriptions. The tool description adds meaning by clarifying that 'part' is the numerator and 'whole' is the denominator, but it does not mention constraints (e.g., whole cannot be zero) or types beyond the schema's number type.
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 ('Return') and resource ('what percent'), clearly stating the calculation it performs. It distinguishes itself from sibling arithmetic tools by focusing on the percentage relationship between part and whole.
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 guidance is provided on when to use this tool versus alternatives like divide or multiply. While the description implies percentage computation, it does not explicitly state that this is for percentage context or when to prefer it over manual arithmetic.
Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.
powerA
Raise base to the given exponent.
| 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?
For a pure mathematical function, the description fully captures the behavior with no side effects or hidden operations. Since no annotations are provided, the description carries the burden, but the operation is straightforward and unambiguous, requiring no additional disclosure.
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, concise sentence with no unnecessary words. It is front-loaded with the key information and gets straight to the point.
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 very simple tool with an output schema present, so the description does not need to explain return values. The description fully specifies the operation, making it complete for the tool's low 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?
The description explicitly references 'base' and 'exponent' in the operation, providing clear semantic meaning. Since the schema has zero description coverage, this mapping is essential for understanding which parameter plays which role.
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 'Raise base to the given exponent' uses a specific verb and resource, clearly stating the exponentiation operation. It naturally distinguishes itself from sibling arithmetic tools like add, multiply, 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?
There is no guidance on when to use this tool versus alternatives. It does not mention any exclusions, prerequisites, or comparative scenarios where power would be preferred over other arithmetic operations.
Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.
square_rootA
Return the square root of x. Raises an error if x is negative.
| Name | Required | Description | Default |
|---|---|---|---|
| x | Yes |
Output Schema
| Name | Required | Description |
|---|---|---|
| result | Yes |
TDQS
Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?
No annotations are present, so the description carries the full burden. It discloses the primary behavior and the error case for negative inputs. Additional details like return type are covered by the output schema.
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 two short sentences, front-loading the core action and including the essential error condition with no unnecessary words.
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 mathematical function, the description covers purpose and error handling. The presence of an output schema means return format doesn't need explanation, so the tool is adequately documented.
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 a type and title for 'x'. The description adds semantic meaning by referencing 'x' in the context of the square root, making its role clear despite 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 states a specific verb 'Return' and resource 'square root of x', clearly distinguishing it from sibling arithmetic operations like add or 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?
The description gives clear context for when to use the tool (computing a square root) and notes an error condition. It doesn't explicitly name alternatives, but the sibling set makes the intended use apparent.
Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.
subtractA
Subtract b from a.
| 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?
With no annotations, the description carries the full burden of explaining behavior. It clearly specifies the order of operands (b from a) but does not disclose additional traits such as return type, edge cases, or side effects. For a simple arithmetic function, this is minimal but adequate; however, it lacks richness beyond the core operation.
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, focused sentence with no filler words. It communicates the essential operation clearly and efficiently, earning a perfect score for conciseness.
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, the explicit input schema, and the presence of an output schema (as indicated by context), the description provides sufficient context. It does not need to explain return values or complex behaviors, making it complete for its purpose.
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?
Although the input schema has no descriptions for a and b, the description adds critical semantic meaning by clarifying the subtractive relationship: a is the minuend and b is the subtrahend. This compensates for the 0% schema description coverage and helps the agent understand how to correctly pass arguments.
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 action as 'Subtract b from a', using a specific verb and resource. This unambiguously identifies the operation and distinguishes it from sibling tools 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?
The description implies use for subtraction but does not explicitly state when to choose this tool over alternatives. There is no mention of exclusions or competing tools, leaving the usage context to be inferred from the operation name and sibling context.
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.
7 tool updates
v0.1.0- First observed
add - First observed
divide - First observed
multiply - First observed
percentage - First observed
power - First observed
square_root - First observed
subtract
TDQS
Each tool performs a unique arithmetic operation—addition, subtraction, multiplication, division, exponentiation, square root, and percentage—with no overlap or ambiguity. Descriptions clarify the exact inputs and behavior.
Tool names are consistently lowercase and follow a simple operation-name pattern (add, subtract, multiply, divide, power, percentage). The only minor deviation is 'square_root' using an underscore, which is a small inconsistency but does not hinder understanding.
Seven tools form a well-scoped set for a calculator, covering the essential operations without unnecessary redundancy. The count is appropriate for the domain.
The tool surface covers all standard arithmetic operations, including power and square root, plus percentage. This is a comprehensive set for a general-purpose calculator, with no obvious missing operations.
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
This MCP server enables users to perform scientific computations regarding linear algebra and vect…
Educational MCP server with 17 math/stats tools, visualizations, and persistent workspace
Free calculators as MCP tools: finance, taxes, health, units, dates. Search, fetch & compute.
Math.js MCP — wraps the mathjs.org API (free, no auth)
Related MCP Servers
- -licenseNot gradedqualityNot gradedmaintenanceA calculator server that exposes mathematical functions as tools (add, subtract, multiply, divide, square, power, square root), enabling language models to perform calculations through Model Context Protocol (MCP).-
- AlicenseNot gradedqualityDmaintenanceA Python-based MCP server that provides a suite of basic arithmetic tools, including addition, square roots, and percentage calculations, for AI assistants. It enables models to perform precise mathematical operations through the Model Context Protocol.MIT
- AlicenseBqualityDmaintenanceA simple Model Context Protocol (MCP) server that provides basic calculation functions to Claude. It enables users to perform mathematical operations like addition directly through natural language commands.1MIT
- FlicenseNot gradedqualityDmaintenanceA sample MCP server that provides basic arithmetic tools like addition, subtraction, multiplication, and division. It serves as a demonstration for implementing the Model Context Protocol and connecting custom tools to clients like Claude Desktop.-
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/kirthi0071/MCP-First-Server'
If you have feedback or need assistance with the MCP directory API, please join our Discord server