MCP Server Reference
base64hub-mcp is a local stdio MCP server with three read-only tools. Your client starts it with npx; it needs Node.js 18 or later and no API key.
Client setup
Every client launches the server with the command npx and the arguments -y base64hub-mcp.
claude mcp add base64hub -- npx -y base64hub-mcp
{
"mcpServers": {
"base64hub": {
"command": "npx",
"args": ["-y", "base64hub-mcp"]
}
}
}
{
"mcpServers": {
"base64hub": {
"command": "npx",
"args": ["-y", "base64hub-mcp"]
}
}
}
{
"servers": {
"base64hub": {
"type": "stdio",
"command": "npx",
"args": ["-y", "base64hub-mcp"]
}
}
}
Where each configuration goes:
| Client | Location |
|---|---|
| Claude Code | the command above; add --scope user to make it available in every project |
| Claude Desktop | Settings → Developer → Edit Config opens claude_desktop_config.json (macOS: ~/Library/Application Support/Claude/, Windows: %APPDATA%\Claude\); restart Claude afterwards |
| Cursor | ~/.cursor/mcp.json for all projects, .cursor/mcp.json for one |
| VS Code | .vscode/mcp.json in the workspace, with a top-level servers object |
VS Code can also add it from a terminal:
code --add-mcp '{"name":"base64hub","type":"stdio","command":"npx","args":["-y","base64hub-mcp"]}'
On Windows, if a client cannot find npx, use the command cmd with the arguments /c npx -y base64hub-mcp. Any other client that launches stdio servers works with the same command and arguments.
Tools
All three tools are read-only and work offline.
base64_encode
Encodes text, as UTF-8, to Base64.
| Argument | Type | Default | Meaning |
|---|---|---|---|
text | string | required | Text to encode. |
url_safe | boolean | false | URL-safe alphabet (- and _). |
padding | boolean | true | Add = padding. |
wrap | integer | 0 | Line break after every N characters; 76 is MIME. |
{"text": "Hello, hub!"} returns SGVsbG8sIGh1YiE=. {"text": "Привет", "url_safe": true, "padding": false} returns 0J_RgNC40LLQtdGC.
base64_decode
Decodes Base64 to text. Both alphabets, missing padding, whitespace and data:...;base64, URIs are accepted.
| Argument | Type | Meaning |
|---|---|---|
data | string | Base64 text or a data URI. |
{"data": "SGVsbG8sIGh1YiE"} returns Hello, hub!. When the bytes are not valid UTF-8, the result says so and gives them as hex; for +/+/:
The data decodes to 3 bytes that are not valid UTF-8 text. Hex:
fbffbf
Invalid input returns a tool error with the reason, for example Invalid Base64: invalid character '!' at position 4.
base64_validate
Checks a string without decoding it. The result is JSON, also sent as structured content.
| Field | Meaning |
|---|---|
valid | true exactly when base64_decode would succeed. |
variant | standard, url, mixed or either. |
padded | The length including = is a multiple of 4. |
bytes | Decoded size in bytes. |
error | Why the input is invalid; only when valid is false. |
{"data": "-_-_"} returns {"valid":true,"variant":"url","padded":true,"bytes":3}.
Protocol
JSON-RPC 2.0 over stdio, one message per line, written without an SDK. Logs go to standard error only, so they never mix with protocol messages. A tool call looks like this on the wire:
{"jsonrpc":"2.0","id":3,"method":"tools/call","params":{"name":"base64_encode","arguments":{"text":"Hello, hub!"}}}
{"jsonrpc":"2.0","id":3,"result":{"content":[{"type":"text","text":"SGVsbG8sIGh1YiE="}]}}
The server is published on npm as base64hub-mcp and in the MCP Registry as com.base64hub/mcp.
Updated Nov 22, 2026