Calculator MCP
The Calculator MCP server provides basic calculator operations via the Model Context Protocol (MCP), primarily for testing, toy projects, and integration with LLMs.
Operations include:
Addition, subtraction, multiplication, division, and modulus
Square root calculation
Features:
Programmatic integration using custom transports
SSE transport support for environments without displays
VS Code/VS Code Insiders integration
Enables GitHub Copilot agents in VS Code to use calculator functionality for basic mathematical operations including addition, subtraction, multiplication, division, modulo, and square root.
Click on "Deploy 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 what's 15% of 80 plus 7?"
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.
Calculate MCP
A Model Context Protocol (MCP) server that provides browser automation capabilities using basic calculator feature. This server enables LLMs to interact with calculator. (I actually made it for a test program)
Use Cases
The test code for to connect MCP feature.
The toy projects
Example config
{
"mcpServers": {
"calculate": {
"command": "npx",
"args": [
"-y",
"@wrtnlabs/calculator-mcp@latest"
]
}
}
}Installation in VS Code
Alternatively, you can install the Playwright MCP server using the VS Code CLI:
# For VS Code
code --add-mcp '{"name":"calculator","command":"npx","args":["-y", "@wrtnlabs/calculator-mcp@latest"]}'# For VS Code Insiders
code-insiders --add-mcp '{"name":"calculator","command":"npx","args":["-y", "@wrtnlabs/calculator-mcp@latest"]}'After installation, the Calculator MCP server will be available for use with your GitHub Copilot agent in VS Code.
CLI Options
The Calculator MCP server supports the following command-line options:
--port <port>: Port to listen on for SSE transport
Running headed browser on Linux w/o DISPLAY
When running headed browser on system w/o display or from worker processes of the IDEs,
run the MCP server from environment with the DISPLAY and pass the --port flag to enable SSE transport.
npx @wrtnlabs/calculator-mcp@latest --port 8931And then in MCP client config, set the url to the SSE endpoint:
{
"mcpServers": {
"calculator": {
"url": "http://localhost:8931/sse"
}
}
}Programmatic usage with custom transports
import { createServer } from "@wrtnlabs/calculator-mcp";
// ... other import statement
const client = new Client({
name: "test client",
version: "0.1.0",
});
const server = createServer({
name: "calculator",
version: "1.0.0"
});
const [clientTransport, serverTransport] = InMemoryTransport.createLinkedPair();
await Promise.all([
client.connect(clientTransport),
server.connect(serverTransport),
]);Tools
add
sub
mul
div
mod
sqrt
Available Tools
6 toolsaddA
Add two numbers
Inputs: a (required), b (required).
divC
Divide two numbers
Inputs: a (required), b (required).
modC
Mod two numbers
Inputs: a (required), b (required).
mulB
Multiply two numbers
Inputs: a (required), b (required).
sqrtC
Square root of a number
Inputs: a (required).
subC
Subtract two numbers
Inputs: a (required), b (required).
Tool Schema Changelog
Recent tool additions, removals, and schema changes observed during successful MCP inspections.
Loading tool schema changelog…
TDQS
Scored across 6 tools
Each tool performs a distinct mathematical operation with no overlap. An agent can easily choose the correct tool based on the operation name.
All tool names follow a consistent lowercase, single-word operator pattern (add, sub, mul, div, mod, sqrt). The naming is uniform and predictable.
Six tools cover the essential arithmetic operations for a calculator server without unnecessary bulk. The scope is tight and well-matched to the domain.
Core arithmetic operations are fully covered, including square root and modulo. A power/exponent operation could be a minor addition, but the current set handles typical calculator workflows without dead ends.
Related MCP Connectors
A comprehensive Model Context Protocol (MCP) server that enables AI assistants to interact with yo…
A Model Context Protocol server for Wix AI tools
Hosted MCP server for LLM cost estimation, model comparison, and budget-aware routing.
This MCP server enables users to perform scientific computations regarding linear algebra and vect…
Related MCP Servers
- AlicenseAqualityCmaintenanceA Model Context Protocol server that provides basic mathematical and statistical functions to LLMs, enabling them to perform accurate numerical calculations through a simple API.13191MIT
- AlicenseCqualityDmaintenanceA Model Context Protocol server that enables LLMs to perform precise numerical calculations by evaluating mathematical expressions.17,291 PyPI160MIT
- -licenseNot gradedqualityNot gradedmaintenanceA calculator server that exposes mathematical functions as tools (add, subtract, multiply, divide, square, power, square root), enabling language models to perform calculations through Model Context Protocol (MCP).-
- FlicenseNot gradedqualityDmaintenanceProvides basic mathematical operations (addition, subtraction, multiplication, division) through a Model Context Protocol server. Enables MCP-compatible clients like chatbots to perform calculations by sending structured math requests.-