@zulong_1991/calculator-mcp-server
v2.1.0
Published
A calculator and random number generator MCP server
Downloads
68
Maintainers
Readme
@zulong/calculator-mcp-server
A calculator and random number generator Model Context Protocol (MCP) server that provides basic arithmetic operations and random number generation capabilities.
Features
- Basic arithmetic operations: addition, subtraction, multiplication, division
- Random number generation: integers and floats with customizable ranges
- Built with TypeScript and MCP SDK
- Ready to publish as npm package
- Supports stdio transport for MCP communication
Installation
npm install -g @zulong/calculator-mcp-serverUsage
As a Global CLI Tool
@zulong/calculator-mcp-serverAs an MCP Server
Add to your MCP configuration:
{
"mcpServers": {
"calculator": {
"command": "npx",
"args": [
"-y",
"@zulong/calculator-mcp-server"
]
}
}
}Available Tools
calculate
Performs basic arithmetic operations.
Parameters:
operation(string): The operation to perform - "add", "subtract", "multiply", or "divide"a(number): First operandb(number): Second operand
Example:
{
"operation": "add",
"a": 5,
"b": 3
}random
Generate random numbers with various options.
Parameters:
type(string): Type of random number - "integer" or "float"min(number): Minimum value (inclusive for integer, exclusive for float)max(number): Maximum value (inclusive for integer, exclusive for float)count(number, optional): Number of random numbers to generate (default: 1, max: 1000)
Examples:
{
"type": "integer",
"min": 1,
"max": 100
}{
"type": "float",
"min": 0,
"max": 1,
"count": 5
}Development
# Install dependencies
npm install
# Build the project
npm run build
# Run in development mode
npm run dev
# Start the server
npm startPublishing to npm
# Build the project
npm run build
# Publish to npm
npm publishLicense
MIT
