by githejie
Enables LLMs to perform precise numerical calculations through a Model Context Protocol server.
Calculator MCP Server provides a lightweight MCP server that exposes a calculate
tool. LLMs can call this tool to evaluate arithmetic or mathematical expressions, ensuring accurate numeric results instead of relying on approximate reasoning.
uv
(no extra step, run with uvx
).pip install mcp-server-calculator
and execute python -m mcp_server_calculator
.uv
:"mcpServers": {
"calculator": {
"command": "uvx",
"args": ["mcp-server-calculator"]
}
}
pip
:"mcpServers": {
"calculator": {
"command": "python",
"args": ["-m", "mcp_server_calculator"]
}
}
calculate
tool from an LLM prompt by supplying the expression
string.calculate
for evaluating any valid expression.uvx
or pip.Q: Which package manager is recommended?
A: uv
is recommended for its speed and direct uvx
execution.
Q: Can I run the server on Windows?
A: Yes, both uvx
and the pip‑based command work on Windows.
Q: Is there a way to secure the server with an API key? A: The server does not require authentication by default, but you can wrap the command in a script that checks environment variables before launching.
Q: What expressions are supported?
A: Any expression parsable by Python's eval
under a safe sandbox is accepted (basic arithmetic, math functions, etc.).
A Model Context Protocol server for calculating. This server enables LLMs to use calculator for precise numerical calculations.
calculate
- Calculates/evaluates the given expression.
expression
(string, required): Expression to be calculatedWhen using uv
no specific installation is needed. We will
use uvx
to directly run mcp-server-calculator.
curl -LsSf https://astral.sh/uv/install.sh | sh
Alternatively you can install mcp-server-calculator
via pip:
pip install mcp-server-calculator
After installation, you can run it as a script using:
python -m mcp_server_calculator
Add this to your MCP client settings:
"mcpServers": {
"calculator": {
"command": "uvx",
"args": ["mcp-server-calculator"]
}
}
Alternatively add this to your MCP client settings:
"mcpServers": {
"calculator": {
"command": "python",
"args": ["-m", "mcp_server_calculator"]
}
}
mcp-server-calculator is licensed under the MIT License. This means you are free to use, modify, and distribute the software, subject to the terms and conditions of the MIT License. For more details, please see the LICENSE file in the project repository.
Please log in to share your review and rating for this MCP.
Explore related MCPs that share similar capabilities and solve comparable challenges
by zed-industries
A high‑performance, multiplayer code editor designed for speed and collaboration.
by modelcontextprotocol
Model Context Protocol Servers
by modelcontextprotocol
A Model Context Protocol server for Git repository interaction and automation.
by modelcontextprotocol
A Model Context Protocol server that provides time and timezone conversion capabilities.
by cline
An autonomous coding assistant that can create and edit files, execute terminal commands, and interact with a browser directly from your IDE, operating step‑by‑step with explicit user permission.
by continuedev
Enables faster shipping of code by integrating continuous AI agents across IDEs, terminals, and CI pipelines, offering chat, edit, autocomplete, and customizable agent workflows.
by upstash
Provides up-to-date, version‑specific library documentation and code examples directly inside LLM prompts, eliminating outdated information and hallucinated APIs.
by github
Connects AI tools directly to GitHub, enabling natural‑language interactions for repository browsing, issue and pull‑request management, CI/CD monitoring, code‑security analysis, and team collaboration.
by daytonaio
Provides a secure, elastic infrastructure that creates isolated sandboxes for running AI‑generated code with sub‑90 ms startup, unlimited persistence, and OCI/Docker compatibility.