JSPM

lumin-math

2.1.1
  • ESM via JSPM
  • ES Module Entrypoint
  • Export Map
  • Keywords
  • License
  • Repository URL
  • TypeScript Types
  • README
  • Created
  • Published
  • Downloads 7
  • Score
    100M100P100Q45975F
  • License MIT

MCP server with 148 tools for math, hashing, reverse engineering, coding, gamedev, matrices, noise, bezier, and more

Package Exports

  • lumin-math
  • lumin-math/dist/server.js

This package does not declare an exports field, so the exports above have been automatically detected and optimized by JSPM instead. If any package subpath is missing, it is recommended to post an issue to the original package (lumin-math) to support the "exports" field. If that is not possible, create a JSPM override to customize the exports field for this package.

Readme

lumin-math

A comprehensive MCP (Model Context Protocol) server providing 148 tools for math, hashing, reverse engineering, coding utilities, game development, matrices, quaternions, noise generation, and more - built with Bun.

Designed for use with Claude Code and any MCP-compatible client.

Install

npm install -g lumin-math
lumin-math install

Works with Node.js 18+ out of the box. If Bun is detected, the installer will use it automatically for better performance.

From source (with Bun)

git clone https://github.com/SnowiyQ/lumin-math.git
cd lumin-math
bun install
bun run src/cli.ts install

Options

lumin-math install            # global (~/.claude.json)
lumin-math install --project  # project-scoped (.mcp.json)
lumin-math uninstall          # remove
lumin-math status             # check installation

Then restart Claude Code. Tools will be available as mcp__lumin-math__<tool_name>.

CLI

Interactive menu powered by @clack/prompts - just run lumin-math with no arguments for arrow-key selection.

The CLI auto-detects your runtime. If Bun is installed, it configures the MCP server to use bun for faster startup. Otherwise it uses node.

Tools (148)

Arithmetic (9)

Tool Description
add Add two numbers
subtract Subtract b from a
multiply Multiply two numbers
divide Divide a by b
modulo Remainder of a divided by b
power Raise base to exponent
sqrt Square root of a number
abs Absolute value
negate Negate a number

Trigonometry (8)

Tool Description
sin Sine of angle in radians
cos Cosine of angle in radians
tan Tangent of angle in radians
arcsin Inverse sine, returns radians
arccos Inverse cosine, returns radians
arctan Inverse tangent, returns radians
degreesToRadians Convert degrees to radians
radiansToDegrees Convert radians to degrees

Statistics (8)

Tool Description
sum Sum of an array of numbers
mean Arithmetic mean of an array
median Median of an array
mode Most frequent value(s) in an array
min Minimum value in an array
max Maximum value in an array
standardDeviation Population standard deviation
variance Population variance

Rounding (4)

Tool Description
round Round to N decimal places
floor Round down to nearest integer
ceiling Round up to nearest integer
truncate Truncate toward zero

Advanced Math (7)

Tool Description
log Logarithm with optional base (default 10)
ln Natural logarithm
factorial Factorial of a non-negative integer (max 170)
gcd Greatest common divisor
lcm Least common multiple
isPrime Check if a number is prime
baseConvert Convert a number between bases (2-36)

Hashing (6)

Tool Description
md5 MD5 hash of a string
sha1 SHA-1 hash of a string
sha256 SHA-256 hash of a string
sha512 SHA-512 hash of a string
crc32 CRC32 checksum of a string (returns hex)
hashHex Hash raw hex bytes with all algorithms at once

Reverse Engineering (19)

Tool Description
hexToDec Hex string to decimal
decToHex Decimal to hex (supports two's complement with bit width)
hexToBin Hex to binary string
binToHex Binary string to hex
bitwiseAnd Bitwise AND of two hex values
bitwiseOr Bitwise OR of two hex values
bitwiseXor Bitwise XOR of two hex values
bitwiseNot Bitwise NOT with specified bit width (8/16/32/64)
bitShift Logical bit shift left/right (hex input/output)
rol Rotate left
ror Rotate right
byteSwap Reverse byte order (endianness swap)
xorData XOR data with repeating key (both hex-encoded)
rvaToOffset RVA to file offset calculation
offsetToRva File offset to RVA calculation
pointerArith Add or subtract hex offset to/from base address
structPack Pack typed values into hex bytes (like Python struct.pack)
structUnpack Unpack hex bytes into typed values (like Python struct.unpack)
patternMatch Find byte pattern offsets with ?? wildcard support

Supported struct types: u8, i8, u16le/be, i16le/be, u32le/be, i32le/be, u64le/be, f32le/be, f64le/be

Coding Utilities (14)

Tool Description
base64Encode Base64 encode a UTF-8 string
base64Decode Decode base64 to UTF-8 string
hexBase64Encode Base64 encode raw hex bytes
hexBase64Decode Decode base64 to hex string
urlEncode URL-encode a string
urlDecode URL-decode a string
uuidGenerate Generate a v4 UUID
timestampToDate Unix timestamp to ISO 8601 date string
dateToTimestamp ISO date string to Unix timestamp
stringToHex UTF-8 string to hex byte string
hexToString Hex byte string to UTF-8 string
asciiFromCode ASCII code (0-127) to character info
asciiFromChar Character to ASCII code info
charCodeInfo Full Unicode character info (decimal, hex, octal, binary)

Game Development (26)

Tool Description
lerp Linear interpolation: a + (b - a) * t
inverseLerp Inverse lerp: find t where lerp(a,b,t) = value
clamp Clamp value to [min, max]
mapRange Remap value from one range to another
randomRange Random number in [min, max] (optional integer mode)
vec2Add Add two 2D vectors
vec2Subtract Subtract two 2D vectors
vec2Scale Scale a 2D vector
vec2Dot Dot product of two 2D vectors
vec2Magnitude Length of a 2D vector
vec2Normalize Normalize a 2D vector to unit length
vec2Distance Distance between two 2D points
vec2Angle Angle between two 2D vectors in degrees
vec3Add Add two 3D vectors
vec3Subtract Subtract two 3D vectors
vec3Scale Scale a 3D vector
vec3Dot Dot product of two 3D vectors
vec3Cross Cross product of two 3D vectors
vec3Magnitude Length of a 3D vector
vec3Normalize Normalize a 3D vector to unit length
vec3Distance Distance between two 3D points
vec3Angle Angle between two 3D vectors in degrees
hexToRgb Hex color to RGB
rgbToHex RGB to hex color string
rgbToHsl RGB to HSL
hslToRgb HSL to RGB

Expression Evaluator (1)

Tool Description
eval Evaluate a math expression string (supports +,-,*,/,%,**,pi,e,sqrt,sin,cos,tan,log,ln,abs,floor,ceil,round,min,max,atan2,pow,hypot)

IEEE 754 (3)

Tool Description
floatToHex Convert float to IEEE 754 hex representation (32-bit or 64-bit)
hexToFloat Convert IEEE 754 hex to float (32-bit or 64-bit)
floatInspect Inspect IEEE 754 float - show sign, exponent, mantissa bits

Bitfield (10)

Tool Description
getBit Get a single bit at position (0-indexed from LSB)
setBit Set a single bit to 1 at position
clearBit Clear a single bit to 0 at position
toggleBit Toggle a bit at position
extractBits Extract a range of bits [high:low] (inclusive)
popcount Count number of set bits (1s) in a value
bitLength Number of bits needed to represent the value
leadingZeros Count leading zeros for a given bit width
trailingZeros Count trailing zeros
maskCreate Create a bitmask of N bits starting at position

Matrix (7)

Tool Description
matMultiply Multiply two matrices
matTranspose Transpose a matrix
matDeterminant Determinant of a square matrix
matInverse Inverse of a square matrix
matIdentity Generate NxN identity matrix
matScale Multiply all elements by a scalar
matAdd Add two matrices

Quaternion (7)

Tool Description
quatMultiply Multiply two quaternions (a * b)
quatNormalize Normalize a quaternion to unit length
quatConjugate Conjugate of a quaternion (negate xyz)
quatFromEuler Create quaternion from Euler angles (degrees, XYZ order)
quatToEuler Convert quaternion to Euler angles in degrees (XYZ order)
quatSlerp Spherical linear interpolation between two quaternions
quatFromAxisAngle Create quaternion from axis and angle (degrees)

Unit Conversion (5)

Tool Description
convertLength Convert length units (mm, cm, m, km, in, ft, yd, mi)
convertWeight Convert weight units (mg, g, kg, oz, lb, ton)
convertTemperature Convert temperature (C, F, K)
convertData Convert data sizes (bits: b/kb/mb/gb/tb, bytes: B/KB/MB/GB/TB)
convertTime Convert time units (ms, s, min, h, d, w)

Network (6)

Tool Description
ipToInt Convert IPv4 address to integer
intToIp Convert integer to IPv4 address
subnetCalc Calculate subnet info from IP and CIDR prefix
ipInSubnet Check if an IP is within a subnet (CIDR notation)
ipToHex Convert IPv4 address to hex
hexToIp Convert hex to IPv4 address

Noise (3)

Tool Description
perlinNoise Perlin noise value at 2D/3D coordinates (returns -1 to 1)
fbmNoise Fractal Brownian Motion noise (layered Perlin)
noiseGrid Generate a 2D grid of Perlin noise values

Bezier (5)

Tool Description
bezierQuadratic Point on a quadratic Bezier curve at t (2D)
bezierCubic Point on a cubic Bezier curve at t (2D)
bezierTangent Tangent vector on a cubic Bezier curve at t (2D)
bezierLength Approximate length of a cubic Bezier curve (2D)
bezierEasing CSS cubic-bezier easing function - returns y for given x

Architecture

lumin-math/
  src/
    server.ts              # MCP stdio server entry point
    cli.ts                 # Interactive CLI installer
    tools/
      index.ts             # Re-exports all tool modules
      arithmetic.ts        # Basic math operations
      trigonometry.ts      # Trig functions
      statistics.ts        # Statistical operations
      rounding.ts          # Rounding functions
      advanced.ts          # Logarithms, primes, factorials, GCD/LCM
      hashing.ts           # MD5, SHA, CRC32
      reverseEngineering.ts # Hex, bitwise, struct pack/unpack, pattern matching
      coding.ts            # Base64, URL encoding, UUID, timestamps, ASCII
      gamedev.ts           # Vectors, interpolation, colors
      expression.ts        # Math expression evaluator
      ieee754.ts           # Float inspection and conversion
      bitfield.ts          # Bit manipulation helpers
      matrix.ts            # Matrix operations
      quaternion.ts        # Quaternion math
      units.ts             # Unit conversion
      network.ts           # IPv4 utilities
      noise.ts             # Perlin noise generation
      bezier.ts            # Bezier curve math
  package.json
  tsconfig.json
  • Works with Node.js 18+ and Bun - auto-detects runtime
  • stdio transport - communicates via JSON-RPC over stdin/stdout
  • Minimal deps - only @modelcontextprotocol/sdk, zod, and @clack/prompts (CLI only)
  • Hashing uses node:crypto (CRC32 is a built-in lookup table)
  • All bitwise/RE operations use BigInt for full 64-bit support

Development

# From source with Bun (no build needed)
bun run src/server.ts

# Build for Node.js
bun run build

# Run built version
node dist/server.js

License

MIT