MCP Calculator Demo MCP Server

Local setup required. This server has to be cloned and prepared on your machine before you register it in Claude Code.
1

Set the server up locally

Run this once to clone and prepare the server before adding it to Claude Code.

Run in terminal
npm install
npm start
2

Register it in Claude Code

After the local setup is done, run this command to point Claude Code at the built server.

Run in terminal
claude mcp add mcp-calculator-demo -- node "<FULL_PATH_TO_MCP_DEMO>/dist/index.js"

Replace <FULL_PATH_TO_MCP_DEMO>/dist/index.js with the actual folder you prepared in step 1.

README.md

A sample MCP server that provides basic arithmetic tools

MCP Demo

This repository contains demo projects showcasing the use of the Message Communication Protocol (MCP) in different scenarios.

Projects

1. Calculator

A simple calculator service with a client and server implementation.

  • Files:
    • demo-client.mjs: Example client for the calculator service
    • server.mjs: Calculator server
    • package.json, README.md

2. MCP Client (TypeScript)

Offical demo from MCP documentation

A TypeScript-based client for interacting with MCP services.

  • Files:
    • index.ts: Main client code
    • build/index.js: Compiled output
    • .env: Environment configuration
    • log/session1.txt: Example session log
    • package.json, tsconfig.json

[!NOTE] Need to set ANTHROPIC_API_KEY in .env to run the client. The credit from Anthropic is NOT free.

3. Weather

Offical demo from MCP documentation

A weather information service using MCP.

  • Files:
    • src/index.ts: Main source code
    • build/index.js: Compiled output
    • package.json, tsconfig.json

Getting Started

Each project contains its own dependencies and setup.
Navigate into a project folder and run:

npm install
npm start

or for TypeScript projects:

npm install
npm run build
npm start

License

MIT

Tools (4)

addAdds two numbers together
subtractSubtracts the second number from the first
multiplyMultiplies two numbers
divideDivides the first number by the second

Configuration

claude_desktop_config.json
{"mcpServers": {"calculator": {"command": "node", "args": ["/path/to/server.mjs"]}}}

Try it

What is 154 plus 89?
Calculate 500 divided by 25.
Multiply 12 by 12 and then subtract 50.
What is the result of 100 minus 33?

Frequently Asked Questions

What are the key features of MCP Calculator Demo?

Provides basic arithmetic operations. Implements the Model Context Protocol. Supports addition, subtraction, multiplication, and division. Demonstrates client-server communication.

What can I use MCP Calculator Demo for?

Testing MCP server connectivity in Claude Desktop. Learning how to implement custom tools in MCP. Verifying arithmetic capabilities within an AI assistant.

How do I install MCP Calculator Demo?

Install MCP Calculator Demo by running: npm install && npm start

What MCP clients work with MCP Calculator Demo?

MCP Calculator Demo works with any MCP-compatible client including Claude Desktop, Claude Code, Cursor, and other editors with MCP support.

Turn this server into reusable context

Keep MCP Calculator Demo docs, env vars, and workflow notes in Conare so your agent carries them across sessions.

Need the old visual installer? Open Conare IDE.
Open Conare