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.).
無需輸入參數。

io.github.sw23由 GitHub 帳號 sw23 發布v1.5.1更新於 Nov 7, 2026
Encode, decode, and convert numbers across FP32, FP16, BF16, TF32, FP8/6/4, and integer formats.
本機 MCP 伺服器,讓助理在 FP32、FP16、BF16、FP8 及整數等格式之間編碼、解碼與轉換數值。
Desktop only,透過 STDIO。 STDIO 服務會啟動本機處理程序,因此需要 SourceWeft 桌面主機。
參照 儲存庫 中的啟動說明。
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
來源:packages/fp-conv-mcp/README.md,提交 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.).
無需輸入參數。
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.
value必填format必填overflowModeroundingModeDecode bits
Decode a binary or hexadecimal bit-pattern into a specified format. Returns the decimal value and full component breakdown.
bits必填format必填Convert 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.
bitsvaluenanModeinputFormat必填outputFormat必填overflowModeroundingModeGet format info
Get detailed information about a floating-point or integer format, including value range (max/min normal, subnormal), bias, and special value support.
format必填已滿足適用檢查項的 90%
該評分衡量此收錄條目的完整程度,依據註冊中心條目、端點與公開來源計算得出。它不是對伺服器本身的評價,也不表示伺服器安全或目前可用:可連通性是帶日期的檢查結果,評分也不包含安裝量或使用者評價。
請在註冊中心條目中宣告憑證請求標頭,或保持端點能夠回應探測,以便判定其認證方式。
{ "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