Convert between 200+ measurement units (length, mass, speed, energy, etc.) via unit-converter-mcp (uvx)
When agents process user requests involving quantities ("how many kilometers is 50 miles?", "convert 212°F to Celsius", "how many gigabytes in 2 terabytes?"), they need a reliable conversion engine. This recipe covers unit-converter-mcp, a comprehensive MCP server with 16 tools across 14 unit categories, including a convert_batch tool for multiple conversions in a single call.
Recipe: Convert measurement units via unit-converter-mcp (uvx)
Server: unit-converter-mcp v0.1.2 (PyPI) — built on FastMCP 2.14.7, 81 packages Transport: stdio via uvx unit-converter-mcp Tools: 16 tools — 14 per-category converters + convert_batch + list_supported_units Auth: None required Startup: ~2s cold, ~1s warm (uvx cache)
How to launch
uvx unit-converter-mcpUnit categories (14)
| Category | Tool | Example units |
|---|---|---|
| Temperature | convert_temperature | celsius, fahrenheit, kelvin |
| Length | convert_length | meter, mile, light year, parsec, angstrom (29 units) |
| Mass | convert_mass | kilogram, pound, stone, tonne, carat (20 units) |
| Speed | convert_speed | km/h, mph, knots, Mach, speed of light (22 units) |
| Volume | convert_volume | liter, gallon, cup, barrel, acre foot (37 units) |
| Area | convert_area | sq meter, acre, hectare, sq mile (11 units) |
| Energy | convert_energy | joule, kWh, calorie, Btu, electron volt (20 units) |
| Force | convert_force | newton, pound force, dyne, kip (10 units) |
| Pressure | convert_pressure | pascal, bar, atm, psi, mmHg (17 units) |
| Power | convert_power | watt, horsepower, Btu/hr (14 units) |
| Density | convert_density | kg/m³, g/cm³, lb/ft³ (19 units) |
| Time | convert_time | femtoseconds → millennia (18 units) |
| Angle | convert_angle | degrees, radians, arcmin, turns, gons (6 units) |
| Computer Data | convert_computer_data | bits → exabytes (8 units) |
Batch conversion (the killer feature)
convert_batch takes an array of conversion requests and returns all results in one call — ideal for agents handling multi-unit questions.
Verified trace — batch conversion (4 units at once)
Request:
{"jsonrpc":"2.0","method":"tools/call","params":{"name":"convert_batch","arguments":{"requests":[
{"value":100,"from_unit":"fahrenheit","to_unit":"celsius","conversion_type":"temperature","request_id":"temp-1"},
{"value":1,"from_unit":"mile","to_unit":"kilometer","conversion_type":"length","request_id":"len-1"},
{"value":1,"from_unit":"terabytes","to_unit":"gigabytes","conversion_type":"computer_data","request_id":"data-1"},
{"value":100,"from_unit":"miles per hour","to_unit":"kilometers per hour","conversion_type":"speed","request_id":"speed-1"}
]}},"id":3}Response:
{
"batch_results": [
{"request_id":"temp-1","success":true,"original_value":100.0,"original_unit":"fahrenheit","converted_value":37.77777777777778,"converted_unit":"celsius","conversion_type":"temperature"},
{"request_id":"len-1","success":true,"original_value":1.0,"original_unit":"mile","converted_value":1.609344,"converted_unit":"kilometer","conversion_type":"length"},
{"request_id":"data-1","success":true,"original_value":1.0,"original_unit":"terabytes","converted_value":1024.0,"converted_unit":"gigabytes","conversion_type":"computer_data"},
{"request_id":"speed-1","success":true,"original_value":100.0,"original_unit":"miles per hour","converted_value":160.93439999987126,"converted_unit":"kilometers per hour","conversion_type":"speed"}
],
"summary": {"total_requests":4,"successful_conversions":4,"failed_conversions":0}
}All 4 conversions verified correct: 100°F = 37.78°C ✓, 1 mi = 1.609 km ✓, 1 TB = 1024 GB ✓, 100 mph = 160.93 km/h ✓.
Notes
isError: falsecorrectly set.- Structured output includes
successper-request in batch mode — agents can handle partial failures gracefully. list_supported_unitstool lets agents discover available units at runtime.- Unit names in enum fields are human-readable strings (e.g. "miles per hour", not "mph") — match exactly.
- Stderr shows a FastMCP banner and authlib deprecation warning (harmless).
{ "server": "unit-converter-mcp", "version": "0.1.2", "transport": "stdio", "launch": "uvx unit-converter-mcp", "tools": ["convert_temperature", "convert_length", "convert_mass", "convert_speed", "convert_volume", "convert_area", "convert_energy", "convert_force", "convert_pressure", "convert_power", "convert_density", "convert_time", "convert_angle", "convert_computer_data", "convert_batch", "list_supported_units"], "trace": { "method": "tools/call", "params": { "name": "convert_batch", "arguments": { "requests": [ { "value": 100, "from_unit": "fahrenheit", "to_unit": "celsius", "conversion_type": "temperature", "request_id": "temp-1" }, { "value": 1, "from_unit": "mile", "to_unit": "kilometer", "conversion_type": "length", "request_id": "len-1" }, { "value": 1, "from_unit": "terabytes", "to_unit": "gigabytes", "conversion_type": "computer_data", "request_id": "data-1" }, { "value": 100, "from_unit": "miles per hour", "to_unit": "kilometers per hour", "conversion_type": "speed", "request_id": "speed-1" } ] } }, "result": { "batch_results": [ { "request_id": "temp-1", "success": true, "converted_value": 37.78 }, { "request_id": "len-1", "success": true, "converted_value": 1.609344 }, { "request_id": "data-1", "success": true, "converted_value": 1024 }, { "request_id": "speed-1", "success": true, "converted_value": 160.934 } ], "summary": { "total_requests": 4, "successful_conversions": 4, "failed_conversions": 0 } }, "isError": false } }