@cyanheads/calculator-mcp-server

v0.1.24 pre-1.0

A hardened math.js calculator MCP server — evaluate, simplify, and differentiate expressions.

@cyanheads/calculator-mcp-server
claude mcp add --transport http calculator-mcp-server https://calculator.caseyjhand.com/mcp
codex mcp add calculator-mcp-server --url https://calculator.caseyjhand.com/mcp
{
  "mcpServers": {
    "calculator-mcp-server": {
      "url": "https://calculator.caseyjhand.com/mcp"
    }
  }
}
gemini mcp add --transport http calculator-mcp-server https://calculator.caseyjhand.com/mcp
{
  "mcpServers": {
    "calculator-mcp-server": {
      "command": "bunx",
      "args": [
        "@cyanheads/calculator-mcp-server@latest"
      ]
    }
  }
}
{
  "mcpServers": {
    "calculator-mcp-server": {
      "type": "http",
      "url": "https://calculator.caseyjhand.com/mcp"
    }
  }
}
curl -X POST https://calculator.caseyjhand.com/mcp \
  -H "Content-Type: application/json" \
  -H "MCP-Protocol-Version: 2025-11-25" \
  -d '{"jsonrpc":"2.0","id":1,"method":"initialize","params":{"protocolVersion":"2025-11-25","capabilities":{},"clientInfo":{"name":"curl","version":"1.0.0"}}}'

Tools

1

calculate

Evaluate math expressions, simplify algebraic expressions, or compute symbolic derivatives. One expression per call. Supports arithmetic, trigonometry, statistics, matrices, complex numbers, units, and combinatorics.

read
invocation
{
  "jsonrpc": "2.0",
  "id": 1,
  "method": "tools/call",
  "params": {
    "name": "calculate",
    "arguments": {
      "expression": "<expression>"
    }
  }
}
schema
{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "type": "object",
  "properties": {
    "expression": {
      "type": "string",
      "minLength": 1,
      "description": "One mathematical expression per call — neither `;` nor newlines separate statements. Inside matrices, `;` separates rows (e.g. `[1, 2; 3, 4]`). Supports arithmetic (+, -, *, /, ^, %), functions (sin, cos, sqrt, log, abs, round, etc.), constants (pi, e, phi, i), matrices, units (5 kg to lbs), and variables (when scope is provided)."
    },
    "operation": {
      "default": "evaluate",
      "description": "Operation to perform. \"evaluate\" computes a numeric result (default). \"simplify\" reduces an algebraic expression symbolically (e.g., \"2x + 3x\" -> \"5 * x\"). Supports algebraic and trigonometric identities. \"derivative\" computes the symbolic derivative (requires the variable parameter).",
      "type": "string",
      "enum": [
        "evaluate",
        "simplify",
        "derivative"
      ]
    },
    "variable": {
      "description": "Variable to differentiate with respect to. Required when operation is \"derivative\". Empty string is treated as omitted. Example: \"x\".",
      "anyOf": [
        {
          "type": "string",
          "const": "",
          "description": "Empty string — treated as omitted."
        },
        {
          "type": "string",
          "maxLength": 50,
          "pattern": "^[a-zA-Z_][a-zA-Z0-9_]*$",
          "description": "Variable identifier (alphanumeric and underscores, max 50 chars)."
        }
      ]
    },
    "scope": {
      "description": "Variable assignments for the expression. Example: { \"x\": 5, \"y\": 3 } makes \"x + y\" evaluate to 8.",
      "type": "object",
      "propertyNames": {
        "type": "string"
      },
      "additionalProperties": {
        "type": "number"
      }
    },
    "precision": {
      "description": "Significant digits (1–16) for numeric results. Omit for full precision. Empty string is treated as omitted. Ignored for symbolic operations (simplify, derivative).",
      "anyOf": [
        {
          "type": "string",
          "const": "",
          "description": "Empty string — treated as omitted."
        },
        {
          "type": "integer",
          "minimum": 1,
          "maximum": 16,
          "description": "Significant digits (integer, 1–16)."
        }
      ]
    }
  },
  "required": [
    "expression",
    "operation"
  ],
  "additionalProperties": false
}
view source ↗

Resources

1