fp-conv MCP server
Commit Nov 11, 2026Converts between floating-point, integer, and custom data formats while analyzing precision loss and binary representations.
Also known as sw23/fp-conv
- Stars
- 8
- Tools
- —
- Downloads, 30 days
- —
- Latest version
- —
- Last commit
- Nov 11, 2026
- License
- MIT
What is fp-conv MCP?
fp-conv converts between floating-point, integer, and custom data formats while analyzing precision loss and binary representations.
Summary generated from the project's README
About fp-conv MCP server
Analyzing precision loss and binary representations during numerical conversions is what fp-conv enables for developers working with machine learning and low-level arithmetic. This local MCP server allows AI agents to perform direct conversions between standard IEEE 754 formats like FP64, FP32, and FP16, as well as specialized ML formats such as BF16 and TF32. It also supports integer types ranging from INT32 down to INT4 and various Open Compute Project microscaling formats.
Users can configure the server via stdio in clients like VS Code to give agents access to complex bit-level manipulations. Beyond standard presets, the tool handles custom bit layouts with up to 15 exponent bits and 112 mantissa bits. It provides detailed insights into rounding modes, overflow behavior, and NaN handling, making it a specialized utility for debugging numerical stability in quantized models or custom hardware simulations.
What you can do with it
- 1Analyze quantization errorCalculate the absolute and relative error when converting a high-precision number to a lower-precision format.
- 2Simulate custom hardware formatsDefine a specific bit layout for a non-standard numerical format to test its behavior.
- 3Inspect binary representationsExamine the exact bit patterns and hex values for specific floating-point numbers.
- 4Test IEEE 754 roundingVerify how a value behaves under different rounding modes like ties to even or toward zero.
Written from the project's README. Every use case is checked against a quote from it.
Automated checks
Ran Nov 14, 2026Full report →Not verified yet. A server needs a score of 80, no serious finding, and enough data for us to check. How checks work · What to fix for more points
- Source repository linked and reachablesw23/fp-conv is public and reachablegithub.com/sw23/fp-conv ↗Pass
- Package names this repository as its sourceNot checked
- Build provenance (Sigstore attestation)Not checked
- Open source license (OSI)MITspdx.org/licenses/MIT.html ↗Pass
- Commit or release in the last yearLast commit or release 2026-11-11github.com/sw23/fp-conv ↗Pass
- OpenSSF ScorecardNot checked
- Package name not close to a popular packageNot checked
- No critical advisory in the package or its dependenciesNot checked
- No hidden instructions to the model0 tool descriptions and the README read; no override phrases, credential paths or hidden charactersPass
- Destructive tools are labelledNot checked
- Remote endpoint answers the MCP handshakeNot checked
README
View on GitHubFloating Point Conversion Calculator
Interactive tool for converting and visualizing floating-point numbers across standard and custom formats. Convert between FP32, FP16, BF16, TF32, FP8, etc. while inspecting binary representations and precision loss.
Live URL: https://sw23.github.io/fp-conv/
Features
- Format presets: FP64, FP32, FP16, BF16, TF32, OCP FP4/FP6/FP8
- Integer formats: INT32, UINT32, INT16, UINT16, INT8, UINT8, INT4, UINT4
- OCP format support: Full support for Open Compute Project FP8 and microscaling formats
- Custom formats: Define any bit layout (0–15 exponent bits, 0–112 mantissa bits)
- Interactive editing: Toggle individual bits and see decimal/hex updates
- Precision analysis: Calculate absolute and relative error between formats
- Special values: Explore zero, infinity, NaN, subnormals, and boundary cases
- Rounding modes: Implements IEEE 754 rounding modes (ties to even, ties away from zero, toward zero, toward +inf, and toward −inf)
- Overflow behavior: Configurable overflow (Infinity/NaN vs. max normal).
- NaN handling: Convert a NaN to the output's canonical quiet NaN, or keep its sign and payload as IEEE 754 §6.2.3 describes (details)
- Fixed-point mode: Set exponent bits to 0 for fractional representations
- Light and dark modes: Switch between light and dark themes based on your preference
- Basic and advanced views: Additional details shown in advanced mode. Defaults based on the screen width until you choose
- Shareable links: Bookmark or share a conversion via URL parameters (input/output format, value, rounding mode, overflow behavior, NaN handling, and view mode)
- Mobile-friendly: Works on screens of all sizes
- WebMCP API: AI agents can perform conversions via WebMCP
Supported Formats
The following standard formats are supported, in addition to any custom format you define (up to 15 exponent bits and 112 mantissa bits). Interactive pages have been created to help explain and visualize each standard format:
- IEEE 754: FP64, FP32, FP16
- ML/AI: TF32, BF16
- Integer: INT32, UINT32, INT16, UINT16, INT8, UINT8, INT4, UINT4
- OCP Microscaling: FP8 E4M3, FP8 E5M2, FP6 E2M3, FP6 E3M2, FP4 E2M1, E8M0 (MX scale), MXINT8
- Custom: Supports a wide range of user-defined formats
MCP Server
The fp-conv-mcp npm package provides
a local Model Context Protocol server, giving
agents direct local access to floating point format conversions.
Example client configuration (VS Code, .vscode/mcp.json):
{
"servers": {
"fp-conv": {
"type": "stdio",
"command": "npx",
"args": ["-y", "fp-conv-mcp"]
}
}
}
See the package README for full usage, per-client setup, and debugging instructions.
Command-Line Tool
The fp-conv-cli npm package provides a
cross-platform command-line version of the converter (Windows, macOS, and Linux),
reusing the same conversion engine as the web app and MCP server. The installed
command is fp-conv.
npx fp-conv-cli convert 3.14 --from fp32 --to fp16
It supports encode, decode, convert, info, and list commands with
human-readable or --json output. See the
package README for full usage and examples.
Development
See CONTRIBUTING.md for local setup, testing, linting, serving the site, and the oracle test-vector workflow.
License
MIT © 2026 Spencer Williams. See LICENSE.
fp-conv MCP questions
What formats are supported for conversion?
The tool supports IEEE 754 (FP64, FP32, FP16), ML/AI formats (TF32, BF16), various integer formats (INT32 to UINT4), and OCP Microscaling formats.
Can I define my own bit layouts?
Yes, you can define custom formats with up to 15 exponent bits and 112 mantissa bits.
Does it support rounding modes?
Yes, it implements IEEE 754 rounding modes including ties to even, ties away from zero, and rounding toward positive or negative infinity.