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 101 tools for math, hashing, reverse engineering, coding utilities, and game development - built with Bun.
Designed for use with Claude Code and any MCP-compatible client.
Install
npm (recommended)
npm install -g lumin-math
lumin-math installWorks 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 installOptions
lumin-math install # global (~/.claude.json)
lumin-math install --project # project-scoped (.mcp.json)
lumin-math uninstall # remove
lumin-math status # check installationThen 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 (101)
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 |
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
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
BigIntfor 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.jsLicense
MIT