{"_id":"@brainycalc/mcpunitconverter","_rev":"3-e66323aac78e57ffe04c1c6c11cd477d","name":"@brainycalc/mcpunitconverter","dist-tags":{"latest":"1.0.3"},"versions":{"1.0.1":{"name":"@brainycalc/mcpunitconverter","version":"1.0.1","keywords":["mcp","unit-converter","model-context-protocol"],"license":"MIT","_id":"@brainycalc/mcpunitconverter@1.0.1","maintainers":[{"name":"jonbill","email":"codibits@gmail.com"}],"bin":{"mcpunitconverter":"src/index.js"},"dist":{"shasum":"e1367aa3f97ca476bd740ea3c456a47bab68b12e","tarball":"https://registry.npmjs.org/@brainycalc/mcpunitconverter/-/mcpunitconverter-1.0.1.tgz","fileCount":5,"integrity":"sha512-zTup9wVnmSC7vtjCKvs/fHbMWX18mx/rKZsN7dwzOOn9JEuXxAYTrhc+LMDw5la4KbbivYfwuqP7FHmLzkT96w==","signatures":[{"sig":"MEQCIG/QRVhV9GJt8BAIEBgfnmVC4mJJ/ok8Xc59J0MpQ3DYAiA+qunkSqwnrg6iwdI4c2uiKcIeZayB/TN+70cI93gR+A==","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"unpackedSize":119549},"main":"src/index.js","type":"module","scripts":{"test":"node src/test.js","start":"node src/index.js"},"_npmUser":{"name":"jonbill","email":"codibits@gmail.com"},"_npmVersion":"11.12.1","description":"Unit conversion MCP server for AI Agents and MCP-compatible clients","directories":{},"_nodeVersion":"24.15.0","dependencies":{"zod":"^3.23.8","@modelcontextprotocol/sdk":"^1.0.0"},"_hasShrinkwrap":false,"_npmOperationalInternal":{"tmp":"tmp/mcpunitconverter_1.0.1_1786277026042_0.9273163566626164","host":"s3://npm-registry-packages-npm-production"}},"1.0.2":{"name":"@brainycalc/mcpunitconverter","version":"1.0.2","keywords":["mcp","unit-converter","model-context-protocol"],"license":"MIT","_id":"@brainycalc/mcpunitconverter@1.0.2","maintainers":[{"name":"jonbill","email":"codibits@gmail.com"}],"bin":{"mcpunitconverter":"src/index.js"},"dist":{"shasum":"e81abcdbaa8e19899e34f2cbcf5412d9538f8410","tarball":"https://registry.npmjs.org/@brainycalc/mcpunitconverter/-/mcpunitconverter-1.0.2.tgz","fileCount":5,"integrity":"sha512-g6IzWBP+NifwVHbG+snRWkOnvFSVuHRYTqNpDSDB3dr7WF4EYAB8eQEAMG3Xm8E9twK9Zbn8gPTIJ3l3YYC5rw==","signatures":[{"sig":"MEYCIQDKOBeO2h3Ocdk2Mgfetsi2djfcwTvMG5lxaMd3tzoTLAIhAMYcTXYbPqeskapHEIx1zDXWT1NXlDJHK/Z3XRL0ejje","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"unpackedSize":119546},"main":"src/index.js","type":"module","scripts":{"test":"node src/test.js","start":"node src/index.js"},"_npmUser":{"name":"jonbill","email":"codibits@gmail.com"},"_npmVersion":"11.12.1","description":"Unit conversion MCP server for AI Agents and MCP-compatible clients","directories":{},"_nodeVersion":"24.15.0","dependencies":{"zod":"^3.23.8","@modelcontextprotocol/sdk":"^1.0.0"},"_hasShrinkwrap":false,"_npmOperationalInternal":{"tmp":"tmp/mcpunitconverter_1.0.2_1786277159785_0.06886261683769912","host":"s3://npm-registry-packages-npm-production"}},"1.0.3":{"name":"@brainycalc/mcpunitconverter","version":"1.0.3","description":"Unit conversion MCP server for AI Agents and MCP-compatible clients","type":"module","main":"src/index.js","bin":{"mcpunitconverter":"src/index.js"},"scripts":{"start":"node src/index.js","test":"node src/test.js"},"dependencies":{"@modelcontextprotocol/sdk":"^1.0.0","zod":"^3.23.8"},"keywords":["mcp","unit-converter","model-context-protocol"],"license":"MIT","_id":"@brainycalc/mcpunitconverter@1.0.3","_nodeVersion":"24.15.0","_npmVersion":"11.12.1","dist":{"integrity":"sha512-AUFLlyBfFRgfovOet3eIC9/xSw9XPer1RJI0ni73uGHkbpSo7kLZeh4ReVaJm99dmYP8LjbD7kU51OgQEdd28g==","shasum":"da0ec9f12109ff58d6d222ed1d224b04fcb1c764","tarball":"https://registry.npmjs.org/@brainycalc/mcpunitconverter/-/mcpunitconverter-1.0.3.tgz","fileCount":5,"unpackedSize":119546,"signatures":[{"keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U","sig":"MEUCIHz2DIRehci+Aov/vp6/YDkpu1mHJKqPHsU2xu3haJKVAiEAnaDPyfHmLbJwPnDbawylL06HLU3kXSL32NFSJXCAKlE="}]},"_npmUser":{"name":"jonbill","email":"codibits@gmail.com"},"directories":{},"maintainers":[{"name":"jonbill","email":"codibits@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages-npm-production","tmp":"tmp/mcpunitconverter_1.0.3_1786277352038_0.10208529727171967"},"_hasShrinkwrap":false}},"time":{"created":"2026-08-09T12:03:45.882Z","modified":"2026-08-09T12:09:12.496Z","1.0.1":"2026-08-09T12:03:46.186Z","1.0.2":"2026-08-09T12:05:59.921Z","1.0.3":"2026-08-09T12:09:12.212Z"},"license":"MIT","keywords":["mcp","unit-converter","model-context-protocol"],"description":"Unit conversion MCP server for AI Agents and MCP-compatible clients","maintainers":[{"name":"jonbill","email":"codibits@gmail.com"}],"readme":"# MCP Unit Converter\n\n[MCP Unit Converter](https://www.brainycalc.com/) is a Model Context Protocol (MCP) unit-conversion engine for AI assistants and MCP-compatible clients.\n\nIt provides a large collection of conversion tools covering everyday units, engineering, heat, fluids, light, electricity, magnetism, radiation, data, typography, and other specialized measurements.\n\nThe converter implementation uses shared conversion-factor tables for linear conversions and dedicated logic for non-linear conversions such as temperature, fuel consumption, number bases, and text case conversion.\n\n## Features\n\n- Length and distance conversion\n- Mass and weight conversion\n- Volume conversion\n- Temperature conversion\n- Temperature-interval conversion\n- Area conversion\n- Dry-volume conversion\n- Lumber-volume conversion\n- Pressure conversion\n- Energy conversion\n- Power conversion\n- Force conversion\n- Time conversion\n- Speed conversion\n- Angle conversion\n- Fuel-consumption conversion\n- Number-base conversion\n- Data-storage conversion\n- Text-case conversion\n- Angular velocity and acceleration\n- Density and specific volume\n- Moment of inertia\n- Moment of force and torque\n- Fuel efficiency by mass and volume\n- Thermal expansion\n- Thermal resistance\n- Thermal conductivity\n- Specific heat capacity\n- Heat density and heat flux\n- Heat-transfer coefficient\n- Volumetric, mass, and molar flow\n- Mass-flux density\n- Molar and solution concentration\n- Dynamic and kinematic viscosity\n- Surface tension\n- Permeability\n- Luminance and luminous intensity\n- Illumination\n- Image resolution\n- Frequency and wavelength\n- Electric charge and charge density\n- Current and current density\n- Electric field strength\n- Electric potential / voltage\n- Electrical resistance, resistivity, conductance, and conductivity\n- Capacitance and inductance\n- Magnetomotive force\n- Magnetic field strength\n- Magnetic flux and flux density\n- Radiation activity\n- Radiation exposure\n- Absorbed radiation dose\n- SI-prefix conversion\n- Data-transfer speeds\n- Sound levels\n- Typography units\n\n---\n\n# MCP Client Configuration\n\n## LM Studio\n\nIf this converter is exposed by an MCP server, add that server to your MCP configuration.\n\n### Using npx\n\nReplace `YOUR_NPM_PACKAGE_NAME` with the actual published npm package name:\n\n```json\n{\n  \"mcpServers\": {\n    \"mcpunitconverter\": {\n      \"command\": \"npx\",\n      \"args\": [\n        \"-y\",\n        \"@brainycalc/mcpunitconverter\"\n      ]\n    }\n  }\n}\n```\n\n### Using the local source\n\nIf the MCP server launches this converter from a local Node.js project:\n\n```json\n{\n  \"mcpServers\": {\n    \"mcpunitconverter\": {\n      \"command\": \"node\",\n      \"args\": [\n        \"/absolute/path/to/your/project/src/index.js\"\n      ]\n    }\n  }\n}\n```\n\nUse an absolute path for the local installation.\n\n> **Note:** `unitconverter.js` is the conversion implementation supplied with this README. The uploaded source does not define the npm package name or MCP server entry-point filename, so those values are intentionally left configurable.\n\n---\n\n# Conversion Engine\n\nThe core linear conversion engine uses a unit-to-base-unit factor table.\n\n```js\nfunction linearConvert(rates, value, fromUnit, toUnit) {\n  if (!rates[fromUnit]) throw new Error(`Unknown source unit: \"${fromUnit}\"`);\n  if (!rates[toUnit]) throw new Error(`Unknown target unit: \"${toUnit}\"`);\n  const base = value * rates[fromUnit];\n  return base / rates[toUnit];\n}\n```\n\nResults from standard linear converters use the following structure:\n\n```json\n{\n  \"value\": 100,\n  \"fromUnit\": \"cm\",\n  \"toUnit\": \"m\",\n  \"convertedValue\": 1\n}\n```\n\nThe source rounds the converted value using `toPrecision(10)` before returning it.\n\n---\n\n# Available MCP Tools\n\nThe supplied source registers **78 conversion tools**.\n\n## Common Converters\n\n| Tool | Description |\n|---|---|\n| `convert_length` | Convert between length units (m, km, inch, foot, yard, mile, nautical_mile, light_year, angstrom, etc.) |\n| `convert_mass` | Convert between mass/weight units (kg, g, lb, oz, stone, metric_ton, short_ton, grain, carat, etc.) |\n| `convert_volume` | Convert between volume units (liter, ml, gallon_us, gallon_uk, pint, quart, cup, fl_oz, cubic_m, barrel_oil, etc.) |\n| `convert_temperature` | Convert between temperature units: celsius (c), fahrenheit (f), kelvin (k), rankine (r), reaumur (re) |\n| `convert_temperature_interval` | Convert temperature interval/difference (c, k, f, r, re) — not absolute temperatures. |\n| `convert_area` | Convert between area units (sq_m, sq_km, sq_ft, sq_in, sq_mile, acre, hectare, barn, etc.) |\n| `convert_volume_dry` | Convert dry volume units (bushel, peck, pint_dry, quart_dry, barrel_dry, etc.) |\n| `convert_volume_lumber` | Convert lumber volume (cubic_m, board_foot, cubic_ft, cord, cord_foot, thousand_board_feet, etc.) |\n| `convert_pressure` | Convert between pressure units (pa, kpa, bar, psi, atm, torr, mmhg, inhg, etc.) |\n| `convert_energy` | Convert between energy units (j, kj, cal, kcal, wh, kwh, btu, ev, erg, ft_lbf, ton_tnt, etc.) |\n| `convert_power` | Convert power units (w, kw, mw, hp, hp_metric, btu_per_h, ton_refrigeration, etc.) |\n| `convert_force` | Convert force units (n, kn, dyne, kgf, lbf, kip, pdl, ozf, etc.) |\n| `convert_time` | Convert time units (s, ms, min, h, day, week, month_30, year_julian, century, millennium, etc.) |\n| `convert_speed` | Convert speed units (mps, kph, mph, knot, fps, mach, c, etc.) |\n| `convert_angle` | Convert angle units (deg, rad, grad, turn, arcmin, arcsec, mil, revolution, etc.) |\n| `convert_fuel_consumption` | Convert fuel consumption units (l_per_100km, km_per_l, mpg_us, mpg_uk, etc.) |\n| `convert_base` | Convert numbers between positional bases (binary=2, octal=8, decimal=10, hex=16, etc.) |\n| `convert_data_storage` | Convert data storage units (b, B, KB, MB, GB, TB, PB, KiB, MiB, GiB, TiB, etc.) |\n| `convert_case` | Convert text case (upper, lower, title, sentence, camel, pascal, snake, kebab, constant) |\n\n## Engineering Converters\n\n| Tool | Description |\n|---|---|\n| `convert_angular_velocity` | Convert angular velocity (rad_per_s, deg_per_s, rpm, rps, etc.) |\n| `convert_acceleration` | Convert acceleration units (mps2, g, gal, ft_per_s2, cm_per_s2, etc.) |\n| `convert_angular_acceleration` | Convert angular acceleration (rad_per_s2, deg_per_s2, rev_per_s2, rpm_per_s, etc.) |\n| `convert_density` | Convert density units (kg_per_m3, g_per_cm3, g_per_l, lb_per_ft3, lb_per_in3, etc.) |\n| `convert_specific_volume` | Convert specific volume (m3_per_kg, l_per_kg, ft3_per_lb, in3_per_lb, etc.) |\n| `convert_moment_of_inertia` | Convert moment of inertia (kg_m2, g_cm2, lb_ft2, lb_in2, slug_ft2, etc.) |\n| `convert_moment_of_force` | Convert moment of force (n_m, kn_m, kgf_m, lbf_ft, lbf_in, etc.) |\n| `convert_torque` | Convert torque units (n_m, kn_m, kgf_m, lbf_ft, lbf_in, ozf_in, etc.) |\n\n## Heat Converters\n\n| Tool | Description |\n|---|---|\n| `convert_fuel_efficiency_mass` | Convert fuel efficiency per mass (j_per_kg, kj_per_kg, cal_per_g, btu_per_lb, kcal_per_kg, etc.) |\n| `convert_fuel_efficiency_volume` | Convert fuel efficiency per volume (j_per_l, kj_per_l, btu_per_gal_us, etc.) |\n| `convert_thermal_expansion` | Convert thermal expansion coefficients (per_k, per_c, per_f, per_r) |\n| `convert_thermal_resistance` | Convert thermal resistance (k_per_w, f_per_btu_per_h, r_value_si, r_value_us, etc.) |\n| `convert_thermal_conductivity` | Convert thermal conductivity (w_per_m_k, btu_per_h_ft_f, cal_per_s_cm_c, kcal_per_h_m_c, etc.) |\n| `convert_specific_heat_capacity` | Convert specific heat capacity (j_per_kg_k, cal_per_g_c, btu_per_lb_f, kcal_per_kg_c, etc.) |\n| `convert_heat_density` | Convert heat density (j_per_m3, kj_per_m3, btu_per_ft3, kcal_per_m3, etc.) |\n| `convert_heat_flux_density` | Convert heat flux density (w_per_m2, btu_per_h_ft2, cal_per_s_cm2, kcal_per_h_m2, etc.) |\n| `convert_heat_transfer_coefficient` | Convert heat transfer coefficient (w_per_m2_k, btu_per_h_ft2_f, kcal_per_h_m2_c, etc.) |\n\n## Fluids Converters\n\n| Tool | Description |\n|---|---|\n| `convert_flow` | Convert volumetric flow (m3_per_s, l_per_s, l_per_min, gal_us_per_min, ft3_per_s, bbl_per_day, etc.) |\n| `convert_flow_mass` | Convert mass flow (kg_per_s, lb_per_s, lb_per_h, g_per_s, ton_per_h, etc.) |\n| `convert_flow_molar` | Convert molar flow (mol_per_s, mol_per_h, kmol_per_s, lbmol_per_s, etc.) |\n| `convert_mass_flux_density` | Convert mass flux density (kg_per_s_m2, g_per_s_cm2, lb_per_s_ft2, lb_per_h_ft2, etc.) |\n| `convert_concentration_molar` | Convert molar concentration (mol_per_m3, mol_per_l, mmol_per_l, umol_per_l, kmol_per_m3, etc.) |\n| `convert_concentration_solution` | Convert solution concentration (kg_per_m3, g_per_l, mg_per_l, lb_per_gal_us, g_per_dl, etc.) |\n| `convert_viscosity_dynamic` | Convert dynamic viscosity (pa_s, cp, p, lbf_s_per_ft2, lb_per_ft_s, n_s_per_m2, etc.) |\n| `convert_viscosity_kinematic` | Convert kinematic viscosity (m2_per_s, cm2_per_s, st, cst, ft2_per_s, etc.) |\n| `convert_surface_tension` | Convert surface tension (n_per_m, mn_per_m, dyn_per_cm, lbf_per_ft, etc.) |\n| `convert_permeability` | Convert permeability (m2, darcy, millidarcy, ft2, etc.) |\n\n## Light / Optics\n\n| Tool | Description |\n|---|---|\n| `convert_luminance` | Convert luminance/brightness (cd_per_m2, fL, L, stilb, lambert, apostilb, etc.) |\n| `convert_luminous_intensity` | Convert luminous intensity (cd, mcd, kcd, hefner_unit, carcel, etc.) |\n| `convert_illumination` | Convert illumination/illuminance (lux, fc, phot, mlux, nox, lm_per_m2, etc.) |\n| `convert_image_resolution` | Convert digital image resolution (dpi, dpcm, ppm, pixel_per_mm, etc.) |\n| `convert_frequency` | Convert frequency units (hz, khz, mhz, ghz, thz, rpm, rps, rad_per_s, etc.) |\n| `convert_wavelength_from_frequency` | Calculate the wavelength in meters from a frequency in Hz (using speed of light c = 299,792,458 m/s) |\n\n## Electricity\n\n| Tool | Description |\n|---|---|\n| `convert_charge` | Convert electric charge (c, mc, uc, nc, pc, kc, ah, mAh, fc, statcoulomb, etc.) |\n| `convert_linear_charge_density` | Convert linear charge density (c_per_m, mc_per_m, c_per_cm, c_per_ft, etc.) |\n| `convert_surface_charge_density` | Convert surface charge density (c_per_m2, c_per_cm2, c_per_ft2, mc_per_m2, etc.) |\n| `convert_volume_charge_density` | Convert volume charge density (c_per_m3, c_per_cm3, c_per_ft3, etc.) |\n| `convert_current` | Convert electric current (a, ma, ua, na, ka, biot, gilbert, statampere, abampere, etc.) |\n| `convert_linear_current_density` | Convert linear current density (a_per_m, a_per_cm, a_per_ft, a_per_in, ma_per_m, etc.) |\n| `convert_surface_current_density` | Convert surface current density (a_per_m2, a_per_cm2, a_per_ft2, a_per_in2, etc.) |\n| `convert_electric_field_strength` | Convert electric field strength (v_per_m, kv_per_m, v_per_cm, v_per_in, n_per_c, etc.) |\n| `convert_electric_potential` | Convert electric potential/voltage (v, mv, uv, kv, abvolt, statvolt, etc.) |\n| `convert_electric_resistance` | Convert electric resistance (ohm, mohm, kohm, mohm_mega, gohm, statohm, abohm, etc.) |\n| `convert_electric_resistivity` | Convert electric resistivity (ohm_m, ohm_cm, ohm_ft, ohm_in, etc.) |\n| `convert_electric_conductance` | Convert electric conductance (s, ms, us, ns, mho, mmho, abmho, statmho, etc.) |\n| `convert_electric_conductivity` | Convert electric conductivity (s_per_m, ms_per_m, mho_per_m, s_per_cm, s_per_ft, etc.) |\n| `convert_capacitance` | Convert electrostatic capacitance (f, mf, uf, nf, pf, kf, statfarad, abfarad, etc.) |\n| `convert_inductance` | Convert inductance (h, mh, uh, nh, ph, kh, stathenry, abhenry, etc.) |\n\n## Magnetism\n\n| Tool | Description |\n|---|---|\n| `convert_magnetomotive_force` | Convert magnetomotive force (a, ka, ma, gilbert, at, kt, etc.) |\n| `convert_magnetic_field_strength` | Convert magnetic field strength (a_per_m, ka_per_m, oersted, at_per_m, at_per_cm, etc.) |\n| `convert_magnetic_flux` | Convert magnetic flux (wb, mwb, maxwell, line, kiloline, v_s, t_m2, etc.) |\n| `convert_magnetic_flux_density` | Convert magnetic flux density (t, mt, ut, gauss, mgauss, wb_per_m2, gamma, etc.) |\n\n## Radiology\n\n| Tool | Description |\n|---|---|\n| `convert_radiation` | Convert radiation activity (bq, kbq, mbq, gbq, ci, mci, uci, nci, dis_per_s, etc.) |\n| `convert_radiation_exposure` | Convert radiation exposure (c_per_kg, r, mr, ur, etc.) |\n| `convert_radiation_absorbed_dose` | Convert radiation absorbed dose (gy, mgy, rad, mrad, j_per_kg, sv, msv, rem, mrem, etc.) |\n\n## Other\n\n| Tool | Description |\n|---|---|\n| `convert_prefix` | Convert SI prefixes (yotta, zetta, exa, peta, tera, giga, mega, kilo, base, milli, micro, nano, etc.) |\n| `convert_data_transfer` | Convert data transfer speeds (bps, kbps, mbps, gbps, tbps, Bps, kBps, kibps, etc.) |\n| `convert_sound` | Convert sound level units (db, np, b — decibel, neper, bel) |\n| `convert_typography` | Convert typography units (point, pica, inch, cm, mm, pixel_72dpi, pixel_96dpi, em, twip) |\n\n---\n\n# Tool Input\n\nMost unit-conversion tools use the same three parameters:\n\n```json\n{\n  \"value\": 10,\n  \"fromUnit\": \"km\",\n  \"toUnit\": \"mile\"\n}\n```\n\nThe parameters are:\n\n| Parameter | Type | Description |\n|---|---|---|\n| `value` | number | Numeric value to convert |\n| `fromUnit` | string | Source unit identifier |\n| `toUnit` | string | Target unit identifier |\n\nThe source validates source and target units and throws an error when an unknown unit is supplied.\n\n---\n\n# Examples\n\n## Length\n\n```json\n{\n  \"value\": 10,\n  \"fromUnit\": \"km\",\n  \"toUnit\": \"mile\"\n}\n```\n\n## Mass\n\n```json\n{\n  \"value\": 5,\n  \"fromUnit\": \"kg\",\n  \"toUnit\": \"lb\"\n}\n```\n\n## Temperature\n\n```json\n{\n  \"value\": 100,\n  \"fromUnit\": \"celsius\",\n  \"toUnit\": \"fahrenheit\"\n}\n```\n\nTemperature uses dedicated conversion logic rather than the linear conversion-factor engine.\n\n## Pressure\n\n```json\n{\n  \"value\": 1,\n  \"fromUnit\": \"atm\",\n  \"toUnit\": \"psi\"\n}\n```\n\n## Energy\n\n```json\n{\n  \"value\": 1,\n  \"fromUnit\": \"kwh\",\n  \"toUnit\": \"j\"\n}\n```\n\n## Speed\n\n```json\n{\n  \"value\": 100,\n  \"fromUnit\": \"kph\",\n  \"toUnit\": \"mph\"\n}\n```\n\n---\n\n# Special Conversion Tools\n\nSome tools do not use the standard `value / fromUnit / toUnit` pattern.\n\n## `convert_wavelength_from_frequency`\n\nCalculates wavelength from frequency using the speed of light.\n\nInput:\n\n```json\n{\n  \"frequencyHz\": 1000000000\n}\n```\n\nThe source uses:\n\n```text\nc = 299,792,458 m/s\n```\n\n## `convert_base`\n\nConverts a number between numeric bases.\n\nExample:\n\n```json\n{\n  \"value\": \"FF\",\n  \"fromBase\": 16,\n  \"toBase\": 10\n}\n```\n\nThe result includes:\n\n- `originalValue`\n- `fromBase`\n- `toBase`\n- `convertedValue`\n- `decimalValue`\n\n## `convert_case`\n\nConverts text between common naming/text cases.\n\nSupported cases in the source include:\n\n```text\nupper\nlower\ntitle\nsentence\ncamel\npascal\nsnake\nkebab\nconstant\n```\n\nExample:\n\n```json\n{\n  \"text\": \"hello world\",\n  \"toCase\": \"camel\"\n}\n```\n\n## `convert_prefix`\n\nConverts values between SI prefixes.\n\nInput:\n\n```json\n{\n  \"value\": 1,\n  \"fromPrefix\": \"kilo\",\n  \"toPrefix\": \"mega\"\n}\n```\n\n---\n\n# Temperature\n\nTemperature is handled separately because Celsius, Fahrenheit, Kelvin, Rankine, and Réaumur are not related by a simple multiplicative factor.\n\nSupported temperature identifiers include:\n\n```text\nc\ncelsius\nf\nfahrenheit\nk\nkelvin\nr\nrankine\nre\nreaumur\n```\n\nExample:\n\n```json\n{\n  \"value\": 32,\n  \"fromUnit\": \"fahrenheit\",\n  \"toUnit\": \"celsius\"\n}\n```\n\n---\n\n# Fuel Consumption\n\nFuel consumption is also handled separately because some units represent consumption per distance while others represent distance per volume.\n\nThe source supports units including:\n\n```text\nl_per_100km\nkm_per_l\nmpg_us\nmpg_uk\nmiles_per_l\nl_per_km\nl_per_mi\nkm_per_gal_us\n```\n\nExample:\n\n```json\n{\n  \"value\": 8,\n  \"fromUnit\": \"l_per_100km\",\n  \"toUnit\": \"mpg_us\"\n}\n```\n\n---\n\n# Data Storage\n\nThe data-storage converter distinguishes decimal and binary units.\n\nExamples include:\n\n```text\nb\nB\nKB\nMB\nGB\nTB\nPB\nEB\nZB\nYB\nKiB\nMiB\nGiB\nTiB\nPiB\nnibble\nword\ndword\nqword\n```\n\nExample:\n\n```json\n{\n  \"value\": 1,\n  \"fromUnit\": \"GB\",\n  \"toUnit\": \"GiB\"\n}\n```\n\n---\n\n# Unit Identifiers\n\nUnit identifiers are defined directly in the source conversion tables.\n\nExamples:\n\n| Category | Example units |\n|---|---|\n| Length | `m`, `km`, `cm`, `inch`, `mile` |\n| Mass | `kg`, `g`, `lb`, `oz`, `stone` |\n| Volume | `liter`, `ml`, `gallon_us`, `gallon_uk` |\n| Pressure | `pa`, `bar`, `psi`, `atm` |\n| Energy | `j`, `kj`, `kwh`, `btu`, `ev` |\n| Power | `w`, `kw`, `mw`, `hp` |\n| Force | `n`, `kn`, `lbf`, `kgf` |\n| Time | `s`, `ms`, `min`, `h`, `day`, `week` |\n| Speed | `mps`, `kph`, `mph`, `knot`, `mach` |\n| Angle | `deg`, `rad`, `grad`, `turn` |\n| Data | `B`, `KB`, `MB`, `GB`, `KiB`, `MiB` |\n\nFor the complete set of supported identifiers, use the conversion tables in `unitconverter.js`.\n\n---\n\n# Error Handling\n\nThe core conversion engine checks that both units exist:\n\n```js\nif (!rates[fromUnit]) throw new Error(`Unknown source unit: \"${fromUnit}\"`);\nif (!rates[toUnit]) throw new Error(`Unknown target unit: \"${toUnit}\"`);\n```\n\nUnknown units therefore produce an explicit error rather than silently returning an incorrect result.\n\nSpecialized converters also validate their supported units and parameters.\n\n---\n\n# Architecture\n\nThe source is organized around:\n\n1. Shared conversion logic\n2. Unit conversion-factor tables\n3. Specialized conversion functions\n4. MCP tool definitions\n\nA typical linear converter follows this pattern:\n\n```js\nconst LENGTH = {\n  m: 1,\n  km: 1000,\n  mile: 1609.344\n};\n\nexport function convertLength({ value, fromUnit, toUnit }) {\n  return result(\n    value,\n    fromUnit,\n    toUnit,\n    linearConvert(LENGTH, value, fromUnit, toUnit)\n  );\n}\n```\n\nThis makes additional units straightforward to add by extending the corresponding conversion table.\n\n---\n\n# MCP Tool Execution\n\nAn MCP client sends a tool name and arguments to the MCP server.\n\nFor a standard conversion:\n\n```json\n{\n  \"name\": \"convert_length\",\n  \"arguments\": {\n    \"value\": 10,\n    \"fromUnit\": \"km\",\n    \"toUnit\": \"mile\"\n  }\n}\n```\n\nThe MCP server should route the request to the corresponding conversion function and return its result to the MCP client.\n\n> The supplied `unitconverter.js` defines the conversion functions and tool registry. The actual MCP transport/server bootstrap should be provided by the surrounding MCP server entry point.\n\n---\n\n# Package Structure\n\nA typical project using this converter can be organized as:\n\n```text\nmcp-unit-converter/\n├── package.json\n├── README.md\n├── LICENSE\n└── src/\n    ├── index.js\n    └── unitconverter.js\n```\n\nWhere:\n\n- `src/index.js` is the MCP server entry point.\n- `src/unitconverter.js` contains the conversion engine and MCP tool definitions.\n- `README.md` documents the package.\n- `LICENSE` contains the project license.\n\nThe exact project structure is not defined by the supplied `unitconverter.js` file.\n\n---\n\n# Runtime\n\nThe conversion implementation is written in JavaScript using ES module syntax such as:\n\n```js\nexport function convertLength(...) {\n  ...\n}\n```\n\nA Node.js project using this file should configure its package appropriately for ES modules.\n\n---\n\n# Use Cases\n\nMCP Unit Converter is suitable for AI agents and applications that need reliable unit conversion for:\n\n- Engineering calculations\n- Scientific calculations\n- Physics\n- Chemistry\n- Electrical engineering\n- Mechanical engineering\n- Fluid mechanics\n- Heat-transfer calculations\n- Petroleum and energy applications\n- Construction\n- Manufacturing\n- Data and networking\n- Typography and digital publishing\n- General-purpose AI assistants\n\n---\n\n# Adding a New Unit\n\nFor a linear conversion category, add the unit and its factor relative to the category's base unit.\n\nExample:\n\n```js\nconst LENGTH = {\n  m: 1,\n  km: 1000,\n  mile: 1609.344,\n  new_unit: YOUR_CONVERSION_FACTOR\n};\n```\n\nThe existing converter function can then use the new identifier.\n\nFor non-linear units, create specialized conversion logic instead of adding a simple factor.\n\n---\n\n# License\n\nMIT License.\n\nSee the `LICENSE` file for the complete license text.\n\n---\n\n# Links\n\n- [BrainyCalc](https://www.brainycalc.com/)\n\nAdd the final npm package URL and project repository URL after publication.\n\n---\n\n# Recommended npm Keywords\n\n```text\nmcp\nmcp-server\nmodel-context-protocol\nunit-converter\nunit-conversion\nconverter\nmeasurement\nengineering\nscientific\nphysics\nchemistry\nlength\nmass\nvolume\ntemperature\npressure\nenergy\npower\nforce\ntime\nspeed\nelectricity\nmagnetism\nradiation\ndata-conversion\nai\nai-agent\nllm\nlm-studio\nnodejs\njavascript\n```\n\n---\n\n# Summary\n\nMCP Unit Converter provides a broad JavaScript conversion engine designed to expose unit conversions as MCP tools.\n\nThe supplied implementation contains **78 registered conversion tools** spanning common measurements and specialized engineering/scientific domains.\n\nIt is designed to be integrated into an MCP server and consumed by MCP-compatible AI clients such as LM Studio.\n","readmeFilename":"README.md"}