Calculator MCP Server
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., "@Calculator MCP Serveradd 25 and 17 then multiply the result by 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.
Calculator MCP Server
A minimal MCP server exposing four tools —
add, subtract, multiply, divide — in two versions:
calculator_server.py— built with the PythonmcpSDK (FastMCP).@mcp.tool()derives the JSON schema from type hints/docstrings and handles the JSON-RPC protocol for you.calculator_server_raw.py— the same server implemented from scratch with only the standard library (json+sys), nomcpdependency. It hand-rolls the JSON-RPC 2.0 message handling to show what FastMCP is doing underneath: read a newline-delimited JSON request from stdin, dispatch onmethod(initialize,tools/list,tools/call,ping), write a JSON-RPC response to stdout. See the file's top-of-file docstring for the framing details (no LSP-style headers, just one JSON object per line).
Setup
python -m venv .venv
.venv\Scripts\pip install -r requirements.txtRelated MCP server: my-mcp-server
Run it directly (stdio)
MCP servers talk over stdio (or HTTP), not a normal CLI — you don't "run and see output," a client connects to it. Two ways to try it:
1. MCP Inspector (visual, interactive) — requires Node.js/npx:
.venv\Scripts\mcp dev calculator_server.pyOpens a browser UI where you can call add, multiply, etc. by hand.
If the page loads but says "Connect to an MCP server to start inspecting" and there's no Tools tab, the sidebar didn't pick up the command automatically (can happen if a stale/previous session config is cached). Fill in the sidebar manually and click Connect:
Transport Type:
STDIOCommand:
C:\Users\simon\mcpserversample\.venv\Scripts\python.exeArguments:
C:\Users\simon\mcpserversample\calculator_server.py
Once connected, a Tools tab appears in the top nav where you can click "List Tools" and run each one.
2. test_client.py — a scripted client included in this repo that
connects, lists tools, and calls each one. Defaults to calculator_server.py,
or pass a path to test the other version:
.venv\Scripts\python test_client.py
.venv\Scripts\python test_client.py calculator_server_raw.pyWiring it into Claude Desktop
Add to claude_desktop_config.json:
{
"mcpServers": {
"calculator": {
"command": "C:\\Users\\simon\\mcpserversample\\.venv\\Scripts\\python.exe",
"args": ["C:\\Users\\simon\\mcpserversample\\calculator_server.py"]
}
}
}How it works
calculator_server.pycreates aFastMCPserver and registers each Python function as a tool via the@mcp.tool()decorator. The function's type hints and docstring become the tool's JSON schema and description, which is what the calling client (Claude, the Inspector, ortest_client.py) sees.mcp.run()starts the server listening on stdin/stdout using the MCP stdio transport — the standard way a client launches and talks to a local MCP server as a subprocess.A client connects, calls
list_tools()to discover what's available, thencall_tool(name, args)to invoke one and get the result back.
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
- FlicenseNot gradedqualityDmaintenanceA 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.
- AlicenseNot gradedqualityDmaintenanceA basic MCP server that implements a calculate tool for arithmetic operations (add, subtract, multiply, divide). It handles requests via stdio.841MIT
- FlicenseNot gradedqualityCmaintenanceProvides basic calculator operations (add, subtract, multiply, divide) as MCP tools for use with Claude Desktop and other MCP clients.
- FlicenseAqualityCmaintenanceProvides four fundamental arithmetic operations (add, subtract, multiply, divide) as MCP tools with zero-division protection.4
Related MCP Connectors
Math.js MCP — wraps the mathjs.org API (free, no auth)
Number utilities MCP.
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/leesdream/mcpserversample'
If you have feedback or need assistance with the MCP directory API, please join our Discord server