MCP Calculator Service
Used for making HTTP requests to the calculator API endpoints, enabling the MCP server to perform mathematical operations like addition, subtraction, multiplication, division, and power calculations.
Manages environment variables for the MCP server, including Anthropic API keys and port configurations.
Powers the API endpoints for both the calculator service and MCP server, handling requests for mathematical operations and tool execution.
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 Calculator Servicewhat is 15% of 200?"
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 Calculator Service
A Model-Context-Protocol (MCP) implementation for a calculator service that uses Claude AI to process natural language requests and perform mathematical calculations.
Architecture
The service consists of three main components:
Calculator API (
calculator-api.js): Handles basic mathematical operationsMCP Server (
mcp-server.js): Manages LLM integration and tool orchestrationMCP Client (
mcp-client.js): Provides a user interface for interacting with the service
Related MCP server: Calculator MCP
Setup
Install dependencies:
npm installCreate a
.envfile in the root directory with the following variables:
ANTHROPIC_API_KEY=your_api_key_here
PORT=3000
MCP_PORT=3001Running the Service
You can run all components concurrently:
npm startOr run them individually:
# Calculator API
npm run start:calculator
# MCP Server
npm run start:mcp
# MCP Client
npm run start:clientUsage
Once the service is running, you can interact with it through the client interface. Here are some example commands:
"Add 5 and 3"
"What is 10 plus 20?"
"Calculate 7.5 + 2.25"
"Multiply 4 by 6"
"What is 8 times 3?"
Type "help" for more examples or "exit" to quit.
API Endpoints
Calculator API (Port 3000)
POST /:operation- Perform mathematical operations (add, subtract, multiply, divide, power)GET /health- Health check endpoint
MCP Server (Port 3001)
GET /tools- List available toolsPOST /execute/:toolId- Execute a specific toolPOST /agent- Process natural language requestsGET /health- Health check endpoint
Error Handling
The service includes comprehensive error handling for:
Invalid mathematical operations
Division by zero
Invalid parameter types
LLM response parsing errors
Network errors
Dependencies
@anthropic-ai/sdk: ^0.51.0
axios: ^1.6.7
body-parser: ^1.20.2
cors: ^2.8.5
dotenv: ^16.4.5
express: ^4.18.3
concurrently: ^8.2.2 (dev dependency)
This server cannot be deployed
Maintenance
Related MCP Connectors
MCP server unifying ERPs, CRMs, APIs and knowledge base for Claude, ChatGPT and Gemini.
Claude makes real phone calls for you — in many languages, with transcript and outcome back in chat.
Hosted MCP server for LLM cost estimation, model comparison, and budget-aware routing.
Furgonetka MCP Server is an extension for LLMs (such as Claude) that integrates AI assistants with Poland's most popular courier brokerage platform. The server enables models to interact directly with services from various couriers (including InPost, DPD, DHL, UPS, and Poczta Polska) through a single, unified interface. With this integration, your AI stops just "writing about logistics" and starts actually managing it.
Related MCP Servers
- AlicenseAqualityCmaintenanceA Model Context Protocol server that provides basic mathematical and statistical functions to LLMs, enabling them to perform accurate numerical calculations through a simple API.1318 npm180MIT
- AlicenseBqualityCmaintenanceA Model Context Protocol server that provides basic calculator functionality for LLMs, enabling them to perform mathematical operations like addition, subtraction, multiplication, division, modulo, and square root.6156 npm16MIT
- AlicenseNot gradedqualityDmaintenanceA backend service that provides accurate arithmetic calculation capabilities to AI models via the Model Context Protocol, allowing LLMs to offload mathematical computations for numerical queries.1MIT
- 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