Skip to main content
Glama
mcp-unit-converter

mcp-unit-converter

by sfo007

mcp-unit-converter

A small Model Context Protocol (MCP) server that lets Claude convert length, weight, and temperature units accurately instead of guessing.

Tools

Tool

What it does

Units

convert_length

Convert a length

mm, cm, m, km, in, ft, yd, mi

convert_weight

Convert a weight

mg, g, kg, oz, lb

convert_temperature

Convert a temperature

c, f, k

list_units

Show all supported units

-

Related MCP server: Unit Converter MCP Server

Installation

Requires Python 3.10+.

git clone https://github.com/sfo007/mcp-unit-converter.git
cd mcp-unit-converter
python -m venv .venv
source .venv/bin/activate        # Windows: .venv\Scripts\activate
pip install -e ".[dev]"

Run the tests

pytest

Try it with the MCP Inspector

npx @modelcontextprotocol/inspector mcp-unit-converter

Connect to Claude Desktop

Open Settings > Developer > Edit Config and add this to claude_desktop_config.json (see claude_desktop_config.example.json):

{
  "mcpServers": {
    "unit-converter": {
      "command": "/ABSOLUTE/PATH/TO/mcp-unit-converter/.venv/bin/mcp-unit-converter"
    }
  }
}

On Windows, use .venv\\Scripts\\mcp-unit-converter.exe as the command path. Restart Claude Desktop afterwards.

Connect to Claude Code

claude mcp add unit-converter -- /ABSOLUTE/PATH/TO/mcp-unit-converter/.venv/bin/mcp-unit-converter

Example prompts

  • "Convert 10 km to miles."

  • "What is 100 Celsius in Fahrenheit?"

  • "How many pounds is 72 kg?"

Project layout

src/unit_converter/converter.py   # pure conversion logic
src/unit_converter/server.py      # MCP tool definitions
tests/test_converter.py           # unit tests

Adding a new unit

Add one line to the LENGTH or WEIGHT dict in converter.py (size relative to the base unit), then add a test.

License

MIT

Tool Schema Changelog

Recent tool additions, removals, and schema changes observed during successful MCP inspections.

Loading tool schema changelog…

    Related MCP Connectors

    Related MCP Servers