base64hub

com.base64hub由 base64hub.com 發布v1.0.0更新於 Nov 22, 2026

Exact Base64 for AI agents: encode, decode and validate (standard, URL-safe, data URIs).

已驗證STDIO僅桌面檔案與儲存開發者工具

概覽

AI 產生的概覽

本機 stdio MCP 伺服器,讓助理取得逐位元組精確的 Base64 編碼、解碼與驗證,支援 URL 安全字母表與 data URI。

可以做什麼
  • 將 UTF-8 文字編碼為 Base64,可選用 URL 安全字母表、填充控制與依行換行。
  • 解碼 Base64 或 data URI,相容兩種字母表、缺少填充與空白字元,二進位結果以十六進位回傳。
  • 在不進行解碼的情況下驗證字串,回傳是否有效、字母表類型、填充狀態、位元組大小與錯誤訊息。
  • 三個工具皆為唯讀,可離線使用。
適用情境
適合助理需要可靠 Base64 結果而非憑猜測的情境:產生權杖或酬載、檢查已編碼字串、判斷某個值是否為合法 Base64,或轉換 data URI。
執行需求
需要本機執行環境:Node.js 18 或更新版本,由 MCP 用戶端透過 npx 啟動。不需 API 金鑰、帳號或網路存取。
安裝前請注意
工具皆為唯讀,README 表示資料不會離開本機且不使用網路。編碼或解碼並不等於保護機密,請勿隨意把敏感值貼進對話,除非你能接受它出現在聊天記錄中。

安裝

在 SourceWeft 中

  1. 開啟 儀表板中的 base64hub,將其新增到工作區。
  2. 為需要使用其工具的對話啟用該服務。

Desktop only,透過 STDIO。 STDIO 服務會啟動本機處理程序,因此需要 SourceWeft 桌面主機。

其他 MCP 客戶端

參照 儲存庫 中的啟動說明。

README

base64hub-mcp

An MCP server that gives AI assistants exact Base64: encode, decode and validate. Language models are unreliable at Base64 by hand; with this server Claude, Cursor, VS Code and any other Model Context Protocol client get byte-exact results from three small tools.

  • Runs locally over stdio, nothing leaves your machine, no network access, no API key
  • Zero dependencies, a few hundred lines of plain Node.js (18 or newer)
  • Standard and URL-safe alphabets, padding control, line wrapping, data URIs
  • Lenient decoding with precise errors: invalid character '!' at position 4
  • Binary results are reported as hex instead of mangled text

Setup

The server is started by your MCP client with npx -y base64hub-mcp. Node.js 18 or newer must be installed.

Claude Code

sh
claude mcp add base64hub -- npx -y base64hub-mcp

Add --scope user to make it available in every project.

Claude Desktop

Open Settings → Developer → Edit Config and add the server to claude_desktop_config.json (macOS: ~/Library/Application Support/Claude/, Windows: %APPDATA%\Claude\), then restart Claude:

json
{  "mcpServers": {    "base64hub": {      "command": "npx",      "args": ["-y", "base64hub-mcp"]    }  }}

Cursor

Add it to ~/.cursor/mcp.json (all projects) or .cursor/mcp.json (one project):

json
{  "mcpServers": {    "base64hub": {      "command": "npx",      "args": ["-y", "base64hub-mcp"]    }  }}

VS Code

From a terminal:

sh
code --add-mcp '{"name":"base64hub","type":"stdio","command":"npx","args":["-y","base64hub-mcp"]}'

Or in a workspace file. .vscode/mcp.json uses a top-level servers object:

json
{  "servers": {    "base64hub": {      "type": "stdio",      "command": "npx",      "args": ["-y", "base64hub-mcp"]    }  }}

The portable .mcp.json at the workspace root (also read by Copilot) uses mcpServers with the same command and args as the Cursor example.

Other clients

Any client that launches stdio servers works with command npx and arguments -y base64hub-mcp. On Windows, if a client can't find npx, use command cmd with arguments /c npx -y base64hub-mcp.

Tools

All tools are read-only and work offline.

base64_encode

Encode text (as UTF-8) to Base64.

ArgumentTypeDefaultMeaning
textstringrequiredText to encode
url_safebooleanfalseURL-safe alphabet (- and _, RFC 4648 §5)
paddingbooleantrueAdd = padding
wrapinteger0Line break after every N characters (76 = MIME)

{"text": "Hello, hub!"} → SGVsbG8sIGh1YiE=

base64_decode

Decode Base64 to text. Accepts both alphabets (even mixed), missing padding, spaces, tabs and line breaks, and data:...;base64, URIs.

ArgumentTypeMeaning
datastringBase64 text or a data URI

{"data": "SGVsbG8sIGh1YiE"} → Hello, hub!

When the bytes are not valid UTF-8 (an image, for example), the result says so and gives them as hex. Invalid input returns a tool error with the reason, such as Invalid Base64: invalid character '!' at position 4.

base64_validate

Check a string without decoding it. Returns JSON, also as structured content:

FieldMeaning
validtrue exactly when base64_decode would succeed
variantstandard (+ or / seen), url (- or _ seen), mixed (both) or either (neither)
paddedthe length including = is a multiple of 4
bytesdecoded size in bytes
errorthe error base64_decode would report (only when valid is false)

{"data": "a+b_"} → {"valid":true,"variant":"mixed","padded":true,"bytes":3}

Protocol

JSON-RPC 2.0 over stdio, one message per line, written without an SDK. Supported MCP revisions: 2026-07-28 (stateless requests with per-request _meta and server/discover) and, through the initialize handshake, 2025-11-25, 2025-06-18, 2025-03-26 and 2024-11-05. Logs go to stderr only.

Links

License

MIT

來源:README.md,提交 70ad43d

工具

3

base64_encode

Base64 encode

Encode text to Base64. The text is converted to UTF-8 bytes first, so any language and emoji work. Set url_safe for the URL- and filename-safe alphabet (- and _ instead of + and /, as in JWTs and URLs), padding=false to drop the trailing '=' characters, and wrap to break the output into lines (76 for MIME email). Returns only the Base64 string.

輸入參數text必填wrappaddingurl_safe

base64_decode

Base64 decode

Decode Base64 back to text. Accepts the standard and the URL-safe alphabet (even mixed), missing '=' padding, spaces and line breaks, and data URIs such as data:image/png;base64,... Returns the decoded UTF-8 text exactly. If the bytes are not valid UTF-8 (an image, compressed or encrypted data), says so and returns them as hex instead. Invalid input fails with the reason and the position of the offending character.

輸入參數data必填

base64_validate

Base64 validate

Check whether a string is valid Base64 and describe it, without returning the decoded content. Uses the same lenient rules as base64_decode. Returns JSON: valid, variant (standard if + or / occurs, url if - or _ occurs, mixed if both, either if neither), padded (whether the '=' padding is complete) and bytes (decoded size); or valid: false with the error base64_decode would report, such as the offending character and its position.

輸入參數data必填

版本歷史

1
  1. v1.0.0最新Nov 22, 2026

評分

已滿足適用檢查項的 90%

該評分衡量此收錄條目的完整程度,依據註冊中心條目、端點與公開來源計算得出。它不是對伺服器本身的評價,也不表示伺服器安全或目前可用:可連通性是帶日期的檢查結果,評分也不包含安裝量或使用者評價。

  • 近 30 天內可連通25 分
  • 已宣告認證方式10 分

    請在註冊中心條目中宣告憑證請求標頭,或保持端點能夠回應探測,以便判定其認證方式。

  • 已列出工具必需15 分
  • 描述必需15 分
  • 圖示10 分
  • 文件15 分
  • 授權條款10 分