Blog

Unit Converter MCP Server — Reliable and Precise Unit Conversions for LLMs

Unit Converter MCP Server — Reliable and Precise Unit Conversions for LLMs

Introducing the Unit Converter MCP server. Supporting 10+ categories of unit conversions, from temperature and length to computer data and time.

What it is

Unit Converter MCP is a Model Context Protocol server that brings accurate unit conversions to LLMs through a comprehensive set of tools.

Try it out

Full setup and usage instructions can be found in the docs on GitHub.

You can also inspect the conversion factors themselves, e.g. the speed conversion tool.

  1. Configure your LLM client to use unit-converter-mcp:

    {
      "mcpServers": {
        "unit-converter": {
          "command": "uvx",
          "args": ["unit-converter-mcp"]
        }
      }
    }
    
  2. Ask questions that need unit conversions:

    • convert 0 celsius to fahrenheit
    • what’s my weight in kg? I’m 205lbs
    • convert 3.14159 radians to degrees
    • convert the speed of a snail to Mach
    • how many floppy disks do you need to store 1TB?
    • how much area would 1,000 mattresses take up in acres
    • how many non-stop days would it take to watch Game of Thrones?

The toolbox

Tool Purpose Units
list_supported_units List all supported units for each type All conversion categories
convert_temperature Convert temperature between units Celsius, Fahrenheit, Kelvin
convert_length Convert length/distance between units meters, feet, miles, inches, etc.
convert_mass Convert mass between units kilograms, pounds, ounces, tons
convert_volume Convert volume between units liters, gallons, cups, fluid ounces
convert_time Convert time between units From seconds to millennia
convert_energy Convert energy between units joules, kWh, calories, BTU
convert_force Convert force between units Newtons, pounds force, kg force
convert_pressure Convert pressure between units Pascal, bar, PSI, atmosphere
convert_power Convert power between units watts, horsepower, BTU/hour
convert_speed Convert speed between units m/s, mph, km/h, knots, Mach
convert_angle Convert angle between units degrees, radians, arcmin, arcsec
convert_area Convert area between units square meters, acres, hectares
convert_computer_data Convert computer storage between units bytes to exabytes
convert_density Convert density between units kg/L, g/cm³, lb/gal

Source code

unit-converter-mcp - GitHub & PyPI

https://github.com/zazencodes/unit-converter-mcp

Please give this project a star on GitHub if you find it useful.

Pull requests and issues are encouraged!

Why you need it

The trust problem

When LLMs perform unit conversions on their own, it’s not always clear if they used the proper conversion factor or correct transformation logic.

The Unit Conversion MCP server uses fully-transparent functions that you can inspect and verify on GitHub.

The precision problem

Unless explicitly guided against this behavior, LLMs will truncate conversion factors.

The Unit Conversion MCP server uses a high amount of precision (typically 12 digits) for all calculations.

The small model problem

LLMs are bad at math. Advanced models like GPT-4o are capable of doing reliable math through tool calling, but small models rely purely on their core generative abilities, which is highly error prone.

The Unit Conversion MCP server does the math, so the model doesn’t have to.

Getting involved

I encourage you to browse the source code and star, fork or open an issue on GitHub.

Help me create a more complete, accurate and precise set of tools!

ZazenCodes

Agentic Coding Club

Now live onSkool
  • Weekly LIVE build sessions — 30 min building, 30 min Q&A
  • Free to join, full course library with Premium
Join Free

Comments (0)

No comments yet.