MCP Calculator Server Demo

MCP Calculator Server Demo

mcp-server-with-client-demo-for-calculator-with-sse-•bypijush2022

A demo project containing an MCP calculator server that offers arithmetic tools over Server-Sent Events, plus a client that evaluates simple and complex expressions.

License: MIT License•Runtime: Awaiting documentation review•Category: developer tools

WHAT IT DOES

  • •Offers arithmetic operations for addition, subtraction, multiplication and division.
  • •Accepts direct tool syntax such as add and divide commands.
  • •Handles complex expressions, including parentheses, via RPN evaluation.
  • •Reports division-by-zero errors instead of returning a result.

BEST FOR

  • •Demonstrating an MCP server paired with a client over SSE.
  • •Performing basic and expression-based calculations through an MCP tool interface.

ABOUT MCP-SERVER-WITH-CLIENT-DEMO-FOR-CALCULATOR-WITH-SSE-

MCP Calculator Server Demo is cataloged as an MCP server attributed to pijush2022. A demo project containing an MCP calculator server that offers arithmetic tools over Server-Sent Events, plus a client that evaluates simple and complex expressions. It is categorized under developer tools. See the capability inspector for recorded interfaces and their independent review status; consult upstream documentation for the current interface.

HOW TO INSTALL

Installation configuration is not reviewed. No executable setup is offered for this entry; inspect the source repository before proceeding.

LICENSE

Catalog license label: MIT License. Check the source repository's current license and terms before using, modifying or distributing this software.

Capability inspector

Capability definitions are not reviewed. Unreviewed imports are not exposed as trusted interfaces.

Tools (0)

No reviewed records to display. This does not establish that upstream lacks this capability.

Resources (0)

No reviewed records to display. This does not establish that upstream lacks this capability.

Prompts (0)

No reviewed records to display. This does not establish that upstream lacks this capability.

NEWSLETTER - COMING LATER

Newsletter subscriptions are not open yet

Email delivery is not connected. This page does not collect email addresses or create subscriptions.

Browse the registry for current listings instead.

Community Reviews

Coming later

Reviews for MCP Calculator Server Demo are not available yet

Review publishing and storage are not connected. This page does not collect or publish ratings or comments, including after sign-in.

FREQUENTLY ASKED QUESTIONS

What arithmetic operations does the calculator server support?

It supports addition, subtraction, multiplication and division, along with direct command forms for each.

How do the client and server communicate?

They communicate via Server-Sent Events, with the server built on FastMCP.

Upstream README

View this exact version on GitHub

README.md · 084fedc14824 · Fetched 2026-11-13 13:01:58 UTC

Original upstream text, without AI rewriting. Scripts, forms and unsafe links are filtered for safety.

Showing the last retrieved documentation snapshot; check the source for current changes.

MCP Calculator Demo

A demonstration project showcasing a calculator service using the MCP (Model Control Protocol) framework. This project consists of a server that provides basic arithmetic operations and a client that can evaluate both simple and complex mathematical expressions.

Project Structure

  • calculator_server.py: The MCP server that provides arithmetic operations
  • client.py: The client application that connects to the server and processes user input
  • requirements.txt: Project dependencies

Features

  • Basic arithmetic operations (addition, subtraction, multiplication, division)
  • Support for both simple operations (e.g., "add 2 3") and complex expressions
  • Error handling for division by zero
  • Server-Sent Events (SSE) communication between client and server
  • Support for parentheses in expressions
  • RPN (Reverse Polish Notation) evaluation for complex expressions

Prerequisites

  • Python 3.7+
  • pip (Python package manager)

Installation

  1. Clone the repository
  2. Create and activate a virtual environment:
    python -m venv .venv
    source .venv/bin/activate  # On Windows: .venv\Scripts\activate
    
  3. Install dependencies:
    pip install -r requirements.txt
    

Usage

Starting the Server

Run the calculator server:

python calculator_server.py

The server will start on http://127.0.0.1:5005 by default.

Running the Client

In a separate terminal, run the client:

python client.py

Available Operations

The calculator supports the following operations:

  1. Direct tool syntax:

    • add 2 3
    • subtract 5 2
    • multiply 4 3
    • divide 10 2
  2. Complex expressions:

    • 5+7-2
    • 5+7-2*3
    • (5+7)*2
    • 10/2+3*4

Example Usage

» add 2 3
Result: 5

» 5+7-2*3
Result: 6

» (5+7)*2
Result: 24

» divide 10 0
Error: Division by zero.

Technical Details

  • The server uses FastMCP for handling MCP operations
  • Communication between client and server is done via Server-Sent Events (SSE)
  • The client implements the Shunting-Yard algorithm for parsing complex expressions
  • Error handling is implemented for invalid expressions and division by zero

Dependencies

  • fastapi
  • uvicorn
  • sse-starlette
  • fastmcp>=0.1.0
  • llama-index
  • llama-index-llms-anthropic
  • anthropic
  • python-dotenv
  • requests
  • sseclient-py
  • uv

License

This project is open source and available under the MIT License.

Install configuration

Are you the maintainer?

Claim this server with your GitHub account to request manual ownership verification.

README Embed Badge
Markdown

Link to the catalog listing for MCP Calculator Server Demo from your README. This badge does not certify ownership, compatibility or security.

[![MCP catalog listing](https://img.shields.io/badge/MCP-awesome--mcp-orange?style=flat-square)](https://awesome-mcp.com/servers/mcp-server-with-client-demo-for-calculator-with-sse-)

REPOSITORY STATS

GitHub StarsUnavailable
ForksUnavailable

Public repository statistics could not be verified. Check the configured source address; unavailable counts are not zero.

Downloads and pulls

Separate sources, scopes and periods. Never combined or treated as installations, active users or security reviews.

No reviewed package or image identity; download statistics are not listed yet.

Related developer tools MCP Servers

Alternative and complementary servers in the same category

View all in developer tools →
Postbye
postbye-mcp•postbye-team

A directory listing describing a cancellation-letter and mailing-address service. The configured public GitHub repository returned 404 during source verification.

Repository stats unavailable
Developer Tools
Singapore Proxy MCP
singapore-proxy-mcp•Xavierfok

A hosted MCP service for browsing and searching through Singapore mobile-network proxies.

0
Developer Tools

A directory listing describing a Markdown-to-PDF service. The configured public GitHub repository returned 404 during source verification.

Repository stats unavailable
Developer Tools