list_formats
List formats
List all available floating-point and integer format presets supported by this converter. Returns format keys, names, categories, and parameters (bits, exponent, mantissa, etc.).
Takes no parameters.

io.github.sw23Published by GitHub account sw23v1.5.1Updated Nov 7, 2026
Encode, decode, and convert numbers across FP32, FP16, BF16, TF32, FP8/6/4, and integer formats.
Local MCP server that lets an assistant encode, decode and convert numbers across floating-point and integer formats such as FP32, FP16, BF16, FP8 and int8.
Desktop only via STDIO. STDIO servers start a local process, so they need the SourceWeft desktop host.
Follow the launch instructions in the repository.
A Model Context Protocol (MCP) server that gives AI agents direct, local tools for floating-point conversions. It is the server-side companion to the fp-conv web app and reuses the same conversion library.
Encode, decode, and convert numbers across FP32, FP64, FP16, BF16, TF32, FP8, FP6, FP4, MX scale/element types, signed/unsigned ints, and custom formats. Supports rounding modes, overflow (saturation) behavior, and calculates precision loss.
For convert_format, the source is either a value, constructed using the input
format's standard defaults, or bits, a binary or hex bit pattern in the input format
used exactly as given; exactly one of the two is required. Its roundingMode and
overflowMode parameters apply only when encoding the output format. encode_number
applies those parameters to its sole format.
convert_format also takes nanMode, which decides what a NaN source becomes:
canonical (default) gives the output format's canonical quiet NaN, and preserve keeps
the sign and as many high-order payload bits as fit, quieted (IEEE 754-2019 §6.2.3). A
NaN's sign and payload exist only in its bit pattern, so give it as bits:
{ "bits": "0xFFC00000", "inputFormat": "fp32", "outputFormat": "fp16", "nanMode": "preserve" }
returns 0xFE00, where canonical returns 0x7E00. See
NaN behavior.
All tools accept either a preset key (string) or a custom format object.
For floating-point:
For integers:
Precision note: encoding, decoding and conversion are exact at every width. A value a JSON number could not name exactly (a 64-bit integer's maximum, a mantissa wider than 53 bits, a magnitude outside fp64's range) is returned as a decimal digit string rather than a rounded number. Every flag in a custom format, when given, must be a JSON boolean.
Refer to the following examples with details on how to configure the MCP server:
.vscode/mcp.json).cursor/mcp.json) / Windsurf / Claude Desktop~/.gemini/config/mcp_config.json)Alternatively, the server can run a local Streamable HTTP endpoint:
Security: The HTTP transport has no authentication and binds to
127.0.0.1by default. Do not bind it to a non-loopback interface unless you add your own authentication and understand the implications.To block DNS-rebinding and cross-site requests from web pages, the server refuses (403) a request whose
Hostis not a loopback name or the--hostaddress, and one whoseOriginnames any other host. A wildcard bind (--host 0.0.0.0) cannot know its own names, so it skips theHostcheck and only accepts anOriginthat is loopback or matches theHost. Request bodies are capped at 1 MiB, and a session idle for 30 minutes is closed.
Once connected, you can ask an agent things like:
0x3E00 decode to?"Use the MCP Inspector:
Then open the Tools tab, click List Tools, and try any tool.
This package lives in the fp-conv repository as an
npm workspace. The published bundle (dist/index.js) inlines the shared conversion
engine (lib/floating-point.js) and tool definitions (src/webmcp.js) from the repo
root via esbuild, keeping a single source of truth.
MIT © Spencer Williams
Source: packages/fp-conv-mcp/README.md at commit 1fd706a
List formats
List all available floating-point and integer format presets supported by this converter. Returns format keys, names, categories, and parameters (bits, exponent, mantissa, etc.).
Takes no parameters.
Encode number
Encode a decimal number (or special value like Infinity / NaN) into a specified floating-point or integer format. Returns binary, hex, and component breakdown.
valuerequiredformatrequiredoverflowModeroundingModeDecode bits
Decode a binary or hexadecimal bit-pattern into a specified format. Returns the decimal value and full component breakdown.
bitsrequiredformatrequiredConvert format
Convert a value or bit pattern from one floating-point or integer format to another. Returns full encoding details for both formats and precision loss analysis.
bitsvaluenanModeinputFormatrequiredoutputFormatrequiredoverflowModeroundingModeGet format info
Get detailed information about a floating-point or integer format, including value range (max/min normal, subnormal), bias, and special value support.
formatrequired90% of the applicable checks met
How complete this listing is, computed from the registry entry, the endpoint and public sources. Not a rating of the server and not a statement that it is safe or working today: reachability is a dated check, and no installs or reviews go into the score.
Declare the credential headers in the registry entry, or keep the endpoint answering the probe so its auth can be classified.
{ "signBits": 1, "exponentBits": 5, "mantissaBits": 10, "bias": 15, "hasInfinity": true, "hasNaN": true }{ "bits": 16, "signed": true }{ "servers": { "fp-conv": { "type": "stdio", "command": "npx", "args": ["-y", "fp-conv-mcp"] } }}claude mcp add fp-conv -- npx -y fp-conv-mcpcopilot mcp add fp-conv -- npx -y fp-conv-mcp{ "mcpServers": { "fp-conv": { "command": "npx", "args": ["-y", "fp-conv-mcp"] } }}{ "mcpServers": { "fp-conv": { "command": "npx", "args": ["-y", "fp-conv-mcp"] } }}npm install -g fp-conv-mcpfp-conv-mcp --http --host 127.0.0.1 --port 3001# endpoint: http://127.0.0.1:3001/mcpnpx @modelcontextprotocol/inspector npx fp-conv-mcpnpm install # from the repo rootnpm run build --workspace fp-conv-mcpnpm test --workspace fp-conv-mcp