MCP Calculator Demo
A 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.
README
MCP Demo
This is a demo of the MCP (Model Context Protocol) for testing and demonstration purposes. It includes a simple implementation of the MCP protocol and a sample calculator MCP server that can be used to test the protocol.
Running the Demo
npm install @modelcontextprotocol/sdk zod
node demo-client.mjs
And output should be:
โ
Calculator MCP server running on stdio
๐ข Calculator MCP Demo
โโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโ
๐ Available tools: multiply, add, subtract, divide
7 ร 6 = 42
123 ร 456 = 56088
42 + 58 = 100
100 โ 37 = 63
144 รท 12 = 12
Error: Division by zero is undefined.
โ
Demo complete!
How It Works
There are two files:
server.mjs โ the MCP Server
- Registers 4 tools:
multiply,add,subtract,divide - Each tool has a name, description, and typed inputs (using Zod)
- Listens for calls over stdio (stdin/stdout)
demo-client.mjs โ the MCP Client
- Spawns
server.mjsas a subprocess - Calls
listTools()to discover what the server offers - Calls each tool with arguments, gets results back
The communication between them looks like this:
demo-client.mjs โโโโ JSON-RPC over stdio โโโโโถ server.mjs
(Client) { tool: "multiply", (Server)
args: { a:7, b:6 } }
โโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโ
{ result: "7 ร 6 = 42" }
Connect to Claude Desktop
This lets Claude itself call your calculator tools in conversation.
Find your Claude Desktop config file:
Mac: ~/Library/Application Support/Claude/claude_desktop_config.json
Windows: %APPDATA%\Claude\claude_desktop_config.json
See https://modelcontextprotocol.io/docs/develop/connect-local-servers for details.
Add this (replace the path with your actual folder path):
{
"mcpServers": {
"calculator": {
"command": "node",
"args": ["/Users/yourname/calculator-mcp/server.mjs"]
}
}
}
Restart Claude Desktop. Then try asking Claude: "What is 123 multiplied by 456?" โ it will use your multiply tool to answer.

Recommended Servers
playwright-mcp
A Model Context Protocol server that enables LLMs to interact with web pages through structured accessibility snapshots without requiring vision models or screenshots.
Magic Component Platform (MCP)
An AI-powered tool that generates modern UI components from natural language descriptions, integrating with popular IDEs to streamline UI development workflow.
Audiense Insights MCP Server
Enables interaction with Audiense Insights accounts via the Model Context Protocol, facilitating the extraction and analysis of marketing insights and audience data including demographics, behavior, and influencer engagement.
VeyraX MCP
Single MCP tool to connect all your favorite tools: Gmail, Calendar and 40 more.
graphlit-mcp-server
The Model Context Protocol (MCP) Server enables integration between MCP clients and the Graphlit service. Ingest anything from Slack to Gmail to podcast feeds, in addition to web crawling, into a Graphlit project - and then retrieve relevant contents from the MCP client.
Kagi MCP Server
An MCP server that integrates Kagi search capabilities with Claude AI, enabling Claude to perform real-time web searches when answering questions that require up-to-date information.
E2B
Using MCP to run code via e2b.
Neon Database
MCP server for interacting with Neon Management API and databases
Exa Search
A Model Context Protocol (MCP) server lets AI assistants like Claude use the Exa AI Search API for web searches. This setup allows AI models to get real-time web information in a safe and controlled way.
Qdrant Server
This repository is an example of how to create a MCP server for Qdrant, a vector search engine.