Why an assistant needs a Base64 tool
A model writes Base64 one token at a time, predicting what usually comes next. Short, common strings often come out right; long strings, non-ASCII text and URL-safe variants are where it slips, and a single wrong character changes the bytes. A tool call moves the work to code that follows RFC 4648 exactly, and the assistant gets back a result it can quote.
base64hub-mcp offers three tools:
| Tool | Arguments | Result |
|---|---|---|
base64_encode | text, optional url_safe, padding, wrap | the encoded text |
base64_decode | data | UTF-8 text, or hex with a note when the bytes are not text |
base64_validate | data | JSON with valid, variant, padded, bytes, error |
Decoding is as forgiving as the rest of base64hub: whitespace, a data: prefix, missing padding and either alphabet are fine. This helps assistants, which often receive Base64 copied out of logs, JWTs or JSON.
Add it to your client
The server is an npm package started with npx, so Node.js is the only requirement. In Claude Code it is one command:
claude mcp add base64hub -- npx -y base64hub-mcp
Claude Desktop and Cursor read a JSON file with an mcpServers block:
{
"mcpServers": {
"base64hub": {
"command": "npx",
"args": ["-y", "base64hub-mcp"]
}
}
}
VS Code uses servers in .vscode/mcp.json. File locations for every client are in the MCP docs.
How it works
The server speaks JSON-RPC 2.0 over stdio: the client starts it as a child process and exchanges messages through stdin and stdout. It is written by hand without an SDK and has no dependencies, so npx fetches one small package. Nothing listens on a network port. Its name in the MCP Registry is com.base64hub/mcp.
When the model asks for base64_encode with {"text": "Hello, hub!"}, the tool returns SGVsbG8sIGh1YiE=. With {"text": "Привет", "url_safe": true, "padding": false} it returns 0J_RgNC40LLQtdGC.
Without MCP
If your assistant can run code, it can also call Python’s base64 module or b64 from a shell; the CLI and the Python package give the same results as this server. If you only need a quick check yourself, paste the string into the Base64 decoder in your browser.
FAQ
What is a Base64 MCP server?
A small program that speaks the Model Context Protocol and offers Base64 tools to an AI assistant. When the assistant needs to encode or decode, it calls the tool and gets an exact answer instead of predicting the characters.
Does base64hub-mcp send my data anywhere?
No. It runs as a local process started by your MCP client and talks to it over stdin and stdout. The only download is the npm package itself, the first time npx runs it.
Which AI clients can use it?
Any client that runs stdio MCP servers. The MCP docs have ready configs for Claude Desktop, Claude Code, Cursor and VS Code.
What happens when decoded data is not text?
base64_decode returns the bytes as hex with a note that they are not UTF-8, so the assistant does not show mangled characters as if they were text.