Sponsored by Deepsite.site

A simple calculator app using Model Context protocol

Created By
KeerthiNingegowda8 months ago
A simple calculator app with MCP compliant server and client
Content

A simple calculator app using Model Context protocol

Purpose of this repo

To explore basic building blocks of MCP and intricacies of tool calling within MCP, from scratch. Keeping it as simple as possible without handling many edge cases. Understand how to build both MCP Server and clients.

Core Features

  • A calculator app to do add, subtract, multiply, divide and modulo
  • Debugging server using MCP Inspector
  • A MCP-based client that takes a query from the user to perform the above mentioned operations

    Future possibilities for quick concept exploration

  • Sequential tool calling
  • Storage of previous chat history is not supported to maintain simplicity
  • Input validation by server and/or client

  • 🚨 Most of the technolgies used in this repo like FastMCP, tool calling in anthropic and MCP itself are very recent. So there are some features in these technologies that are either not available or buggy. But the main goal is a simple exploration without using cursor or Claude Desktop 🚨

    MCP compliant Calculator Server

    Is built using FastMCP, due to its simplicty and automatic error handling. Points to remember:-

  • Always name the server either as mcp or server or app. Throws an error otherwise and is quite explicit
  • Annotations can be included as a future reference. Right now it is not supported in FastMCP for the version in uv.lock
  • MCP client

    Makes a connection to MCP server and should have access to LLM Would higly suggest to explore and inspect the objects returned when the model uses a tool and a genertic reponse Try to stress test giving numbers in different format. Eg:- Add 2 and 3 v/s Add two and three. Eg:- Try to use ambiguous and large numbers:- Add seven hundred thousand trillion with three hundred billion

    Workflow overview

    alt text

    To reproduce the working environment whre .toml file is located

    uv sync

    TO activate the working environment use

    source .venv/bin/activate

    To simply inspect the server

    Go to fastmcp_calculator_server folder and run
    mcp dev server.py alt_text

    Add your anthropic API key to .env file

    To run the whole MCP app

    Go to mcp_calculator/mcp_compliant_client and run
    python client.py <path to server.py>

    More about this on medium.

    Recommend Servers
    TraeBuild with Free GPT-4.1 & Claude 3.7. Fully MCP-Ready.
    DeepChatYour AI Partner on Desktop
    Zhipu Web SearchZhipu Web Search MCP Server is a search engine specifically designed for large models. It integrates four search engines, allowing users to flexibly compare and switch between them. Building upon the web crawling and ranking capabilities of traditional search engines, it enhances intent recognition capabilities, returning results more suitable for large model processing (such as webpage titles, URLs, summaries, site names, site icons, etc.). This helps AI applications achieve "dynamic knowledge acquisition" and "precise scenario adaptation" capabilities.
    Serper MCP ServerA Serper MCP Server
    MiniMax MCPOfficial MiniMax Model Context Protocol (MCP) server that enables interaction with powerful Text to Speech, image generation and video generation APIs.
    MCP AdvisorMCP Advisor & Installation - Use the right MCP server for your needs
    Howtocook Mcp基于Anduin2017 / HowToCook (程序员在家做饭指南)的mcp server,帮你推荐菜谱、规划膳食,解决“今天吃什么“的世纪难题; Based on Anduin2017/HowToCook (Programmer's Guide to Cooking at Home), MCP Server helps you recommend recipes, plan meals, and solve the century old problem of "what to eat today"
    WindsurfThe new purpose-built IDE to harness magic
    CursorThe AI Code Editor
    Context7Context7 MCP Server -- Up-to-date code documentation for LLMs and AI code editors
    Playwright McpPlaywright MCP server
    ChatWiseThe second fastest AI chatbot™
    EdgeOne Pages MCPAn MCP service designed for deploying HTML content to EdgeOne Pages and obtaining an accessible public URL.
    Amap Maps高德地图官方 MCP Server
    BlenderBlenderMCP connects Blender to Claude AI through the Model Context Protocol (MCP), allowing Claude to directly interact with and control Blender. This integration enables prompt assisted 3D modeling, scene creation, and manipulation.
    Visual Studio Code - Open Source ("Code - OSS")Visual Studio Code
    TimeA Model Context Protocol server that provides time and timezone conversion capabilities. This server enables LLMs to get current time information and perform timezone conversions using IANA timezone names, with automatic system timezone detection.
    AiimagemultistyleA Model Context Protocol (MCP) server for image generation and manipulation using fal.ai's Stable Diffusion model.
    Tavily Mcp
    Baidu Map百度地图核心API现已全面兼容MCP协议,是国内首家兼容MCP协议的地图服务商。
    Jina AI MCP ToolsA Model Context Protocol (MCP) server that integrates with Jina AI Search Foundation APIs.