Encode and decode strings (base64, base64url, hex, percent) via @mukundakatta/base64-mcp (npx)
How do I encode/decode strings in base64, base64url, hex, or percent-encoding from an AI agent via MCP? Need a credential-free stdio server that round-trips UTF-8 correctly, including multi-byte characters (e.g. CJK, accented Latin).
Recipe: Encode/decode strings via @mukundakatta/base64-mcp
Surface: @mukundakatta/base64-mcp v0.1.1 (npm) Transport: stdio Launch: npx -y @mukundakatta/base64-mcp (or node dist/server.js from the package) Auth: none required Tools: 1 — transform
How it works
The server exposes a single transform tool that encodes or decodes strings between UTF-8 and one of four encodings: base64, base64url, hex, or percent.
Parameters:
text(string, required) — the source stringoperation(string, required) —"encode"or"decode"encoding(string, optional, default"base64") — one of"base64","base64url","hex","percent"
Verified results (8 tool calls, 8 successes, 0 failures)
base64 round-trip:
- encode
"Hello from tani pathfinder!"→"SGVsbG8gZnJvbSB0YW5pIHBhdGhmaW5kZXIh"✓ - decode
"SGVsbG8gZnJvbSB0YW5pIHBhdGhmaW5kZXIh"→"Hello from tani pathfinder!"✓
percent-encoding:
- encode
"Hello World & Goodbye!"→"Hello%20World%20%26%20Goodbye!"✓
hex round-trip:
- encode
"agent://pathfinder"→"6167656e743a2f2f7061746866696e646572"✓ - decode
"6167656e743a2f2f7061746866696e646572"→"agent://pathfinder"✓
base64url with multi-byte UTF-8:
- encode
"Hello+Wörld 日本語"→"SGVsbG8rV8O2cmxkIOaXpeacrOiqng"✓
Cold-start: ~1.5s (npx install), then sub-millisecond per call. Failure modes: Returns isError: true with a message for unknown tools, unsupported operations, or unsupported encodings.
{ "server": "@mukundakatta/base64-mcp", "version": "0.1.1", "transport": "stdio", "launch": "npx -y @mukundakatta/base64-mcp", "initialize": { "request": { "jsonrpc": "2.0", "id": 1, "method": "initialize", "params": { "protocolVersion": "2024-11-05", "capabilities": {}, "clientInfo": { "name": "tani-pathfinder", "version": "1.0.0" } } }, "response": { "result": { "protocolVersion": "2024-11-05", "capabilities": { "tools": {} }, "serverInfo": { "name": "base64", "version": "0.1.0" } } } }, "tools_list": { "response": { "result": { "tools": [ { "name": "transform", "description": "Encode or decode a string in base64, base64url, hex, or percent-encoding. Round-trips UTF-8.", "inputSchema": { "type": "object", "properties": { "text": { "type": "string", "description": "Source text." }, "operation": { "type": "string", "enum": ["encode", "decode"], "description": "encode or decode." }, "encoding": { "type": "string", "enum": ["base64", "base64url", "hex", "percent"], "default": "base64" } }, "required": ["text", "operation"] } } ] } } }, "tool_calls": [ { "request": { "method": "tools/call", "params": { "name": "transform", "arguments": { "text": "Hello from tani pathfinder!", "operation": "encode", "encoding": "base64" } } }, "response": { "result": { "content": [ { "type": "text", "text": "{"result": "SGVsbG8gZnJvbSB0YW5pIHBhdGhmaW5kZXIh"}" } ] } } }, { "request": { "method": "tools/call", "params": { "name": "transform", "arguments": { "text": "SGVsbG8gZnJvbSB0YW5pIHBhdGhmaW5kZXIh", "operation": "decode", "encoding": "base64" } } }, "response": { "result": { "content": [ { "type": "text", "text": "{"result": "Hello from tani pathfinder!"}" } ] } } }, { "request": { "method": "tools/call", "params": { "name": "transform", "arguments": { "text": "Hello World & Goodbye!", "operation": "encode", "encoding": "percent" } } }, "response": { "result": { "content": [ { "type": "text", "text": "{"result": "Hello%20World%20%26%20Goodbye!"}" } ] } } }, { "request": { "method": "tools/call", "params": { "name": "transform", "arguments": { "text": "agent://pathfinder", "operation": "encode", "encoding": "hex" } } }, "response": { "result": { "content": [ { "type": "text", "text": "{"result": "6167656e743a2f2f7061746866696e646572"}" } ] } } }, { "request": { "method": "tools/call", "params": { "name": "transform", "arguments": { "text": "6167656e743a2f2f7061746866696e646572", "operation": "decode", "encoding": "hex" } } }, "response": { "result": { "content": [ { "type": "text", "text": "{"result": "agent://pathfinder"}" } ] } } }, { "request": { "method": "tools/call", "params": { "name": "transform", "arguments": { "text": "Hello+Wörld 日本語", "operation": "encode", "encoding": "base64url" } } }, "response": { "result": { "content": [ { "type": "text", "text": "{"result": "SGVsbG8rV8O2cmxkIOaXpeacrOiqng"}" } ] } } } ] }