Calculator MCP Server
Performs basic arithmetic calculations. A TypeScript-based server demonstrating core MCP concepts.
Calculator MCP Server
A TypeScript-based MCP server that implements a robust calculator with precise decimal arithmetic. This server demonstrates core MCP concepts by providing arithmetic operations with support for multiple operands and configurable precision using Decimal.js.
Features
Tools
Arithmetic Functions
These functions take an array of at least two numbers and return a single numerical result.
add- Adds an array of numbers.subtract- Subtracts numbers sequentially from the first.multiply- Multiplies an array of numbers.divide- Divides numbers sequentially. Handles division by zero.
Trigonometric Functions
These functions operate on arrays of numbers and return an array of results. The angles input requires at least one number.
- Basic Trigonometry:
sin,cos,tan- Input:
angles(array of numbers),mode('radians' or 'degrees', defaults to 'radians').
- Input:
- Inverse Trigonometry:
asin,acos,atan- Input:
values(array of numbers).
- Input:
- Hyperbolic Functions:
sinh,cosh,tanh- Input:
values(array of numbers).
- Input:
- Inverse Hyperbolic Functions:
asinh,acosh,atanh- Input:
values(array of numbers).
- Input:
Miscellaneous
set_precision- Configures decimal precision for all subsequent calculations.- Takes
precisionparameter as the number of decimal places.
- Takes
Development
Install dependencies:
bun install
Run the development server:
bun start
Installation as standalone MCP server
To use with Claude Desktop, add the server config:
On MacOS: ~/Library/Application Support/Claude/claude_desktop_config.json
On Windows: %APPDATA%/Claude/claude_desktop_config.json
{
"mcpServers": {
"Calculator": {
"command": "/path/to/calculator-mcp/src/index.ts"
}
}
}
Or for Cline VSCode extension, add a modified version of this to your MCP config file:
"Calculator": {
"autoApprove": [
"add",
"subtract",
"multiply",
"divide",
"set_precision"
],
"disabled": true,
"timeout": 60,
"type": "stdio",
"command": "bun",
"args": [
"/path-to-your/calculator-mcp/src/index.ts"
]
}
Installation using Docker
To run the MCP server using Docker, you should first build the image using:
docker build -t calculator-mcp .
Followed by adding this to the (Cline) MCP config file:
"Calculator (docker)": {
"autoApprove": [
"add",
"subtract",
"multiply",
"divide",
"set_precision"
],
"disabled": false,
"timeout": 60,
"type": "stdio",
"command": "docker",
"args": [
"run",
"--rm",
"-i",
"calculator-mcp"
]
}
Debugging
Since MCP servers communicate over stdio, debugging can be challenging. We recommend using the MCP Inspector, which is available as a package script:
bun run inspector
The Inspector will provide a URL to access debugging tools in your browser.
Related Servers
Beancount MCP
Execute Beancount queries and submit transactions to a ledger.
MCP Outlook Tools
Interact with Microsoft Outlook for calendar management, email operations, and search functionality.
MCP Hub
A hub server that connects to and manages other MCP servers.
Dovetail
Connect AI tools to the Dovetail API for user research and customer feedback analysis.
MCBU Campus Assistant
A chatbot for Manisa Celal Bayar University student affairs, featuring a web scraper, student database, and API integration tools for automation.
Pulsetic MCP Server
The Pulsetic MCP Server connects Pulsetic monitoring with AI agents and MCP-compatible tools, enabling direct access to uptime data, cron monitoring results, incident management workflows, and status page information through the Model Context Protocol (MCP). It allows teams to securely expose operational monitoring data in a structured format, making it easy to build AI-driven automation, monitoring assistants, and intelligent operational workflows without custom middleware.
Todoist MCP
Interact with your Todoist tasks and projects using your LLM.
Feishu/Lark OpenAPI
Connect AI agents to Feishu/Lark APIs for automating tasks like document processing, conversation management, and calendar scheduling.
MCP Journaling Server
An interactive journaling server with emotional analysis and automatic conversation saving.
Flyweel Ad-MCP (Google+Meta)
Connect your Google Ads and Meta accounts to Claude, Cursor, or any AI tool that supports MCP.