This MCP server for calculations enables large language models to perform precise numerical calculations using a calculator tool. It provides a simple way to handle mathematical expressions without relying on the LLM's numerical abilities.
With uv
, no specific installation is needed as you can run the server directly using uvx
:
curl -LsSf https://astral.sh/uv/install.sh | sh
You can install the package via pip:
pip install mcp-server-calculator
After installation with pip, run it as a script:
python -m mcp_server_calculator
To integrate the calculator with your MCP client, you'll need to update your settings.
Add this to your MCP client settings:
"mcpServers": {
"calculator": {
"command": "uvx",
"args": ["mcp-server-calculator"]
}
}
If you installed using pip, use this configuration:
"mcpServers": {
"calculator": {
"command": "python",
"args": ["-m", "mcp_server_calculator"]
}
}
The server provides the following tool:
expression
(string) - The expression to calculateOnce configured, the LLM can use the calculator for precise numerical calculations by invoking the calculate
tool with any mathematical expression.
There are two ways to add an MCP server to Cursor. The most common way is to add the server globally in the ~/.cursor/mcp.json
file so that it is available in all of your projects.
If you only need the server in a single project, you can add it to the project instead by creating or adding it to the .cursor/mcp.json
file.
To add a global MCP server go to Cursor Settings > MCP and click "Add new global MCP server".
When you click that button the ~/.cursor/mcp.json
file will be opened and you can add your server like this:
{
"mcpServers": {
"cursor-rules-mcp": {
"command": "npx",
"args": [
"-y",
"cursor-rules-mcp"
]
}
}
}
To add an MCP server to a project you can create a new .cursor/mcp.json
file or add it to the existing one. This will look exactly the same as the global MCP server example above.
Once the server is installed, you might need to head back to Settings > MCP and click the refresh button.
The Cursor agent will then be able to see the available tools the added MCP server has available and will call them when it needs to.
You can also explictly ask the agent to use the tool by mentioning the tool name and describing what the function does.