MCP Calculator
Click on "Install 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 Calculatorwhat is 5 plus 3?"
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
A Model Context Protocol (MCP) server example with calculator tools, built using FastMCP.
Setup and Installation
Prerequisites
Python 3.8 or higher
pip package manager
1. Clone the Repository
git clone https://github.com/arulrajnet/mcp-calculator.git
cd mcp-calculator2. Create Virtual Environment (Recommended)
python -m venv .venv
source .venv/bin/activate # On Windows: .venv\Scripts\activate3. Install Dependencies
# Install the package in development mode
pip install -e .
# Or install with development dependencies
pip install -e .[dev]Related MCP server: Calculator MCP Server
Running the Server
Start the MCP calculator server:
python server.pyThe server will start on http://localhost:8000/mcp/calculator using the streamable HTTP transport.
You should see output similar to:
Uvicorn running on http://0.0.0.0:8000Testing with the Client
1. Run the Test Client
In a new terminal (while the server is running):
python client.pyThis will connect to the server and list all available tools.
2. Example Client Usage
You can modify client.py to test specific calculator functions:
from fastmcp import Client
import asyncio
async def main():
# Connect via SSE
async with Client("http://localhost:8000/mcp/calculator") as client:
# List available tools
tools = await client.list_tools()
print(f"Available tools: {[tool['name'] for tool in tools]}")
# Test some calculations
result = await client.call_tool("add", {"a": 5, "b": 3})
print(f"5 + 3 = {result}")
result = await client.call_tool("factorial", {"n": 5})
print(f"5! = {result}")
result = await client.call_tool("is_prime", {"n": 17})
print(f"Is 17 prime? {result}")
if __name__ == "__main__":
asyncio.run(main())Development
Code Formatting
black .
isort .Type Checking
mypy .Running Tests
pytestRunning Tests with Coverage
pytest --cov=. --cov-report=htmlAuthor
This server cannot be installed
Maintenance
Resources
Unclaimed servers have limited discoverability.
Looking for Admin?
If you are the server author, to access and configure the admin panel.
Related MCP Servers
- AlicenseBqualityDmaintenanceA demonstration server implementing the Model Context Protocol (MCP) that provides three basic tools: echo, calculator, and current time functionality.Last updated328ISC
- Flicense-qualityDmaintenanceA simple MCP server that provides basic calculator functionality for performing mathematical operations. Built with FastMCP and demonstrates fundamental MCP server implementation patterns.Last updated
- Flicense-qualityDmaintenanceA demonstration MCP server that provides calculator functionality through both stdio and FastAPI implementations. Enables users to perform mathematical calculations via MCP tools using the FastMCP framework.Last updated
- Flicense-qualityDmaintenanceA template MCP server built with FastMCP framework that demonstrates basic tool implementation with a simple addition calculator example.Last updated15
Related MCP Connectors
MCP (Model Context Protocol) server for Appwrite
A comprehensive Model Context Protocol (MCP) server that enables AI assistants to interact with yo…
This MCP server enables users to perform scientific computations regarding linear algebra and vect…
Latest Blog Posts
- Who's Calling? MCP Hosts Are an Identity Blind Spot (And the Spec Knows It)By Om-Shree-0709 on .mcpAgent IdentityOAuth 2.1
- Your AI Chatbot Just Exposed Your CEO's Salary to an InternBy Om-Shree-0709 on .Agent IdentityMCP SecurityOAuth Delegation
- Why MCP Servers Need Execution Sandboxing (And Why Your Current Stack Isn't Enough)By Om-Shree-0709 on .Agentic AiPrompt InjectionWebAssembly
MCP directory API
We provide all the information about MCP servers via our MCP API.
curl -X GET 'https://glama.ai/api/mcp/v1/servers/arulrajnet/mcp-calculator'
If you have feedback or need assistance with the MCP directory API, please join our Discord server