base64_decode
Decode base64 encoded data to its original text format. Provide a base64 string to retrieve the plain text.
Instructions
decode base64 to text
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| content | Yes | base64 text to decode |
Implementation Reference
- src/service/base64.ts:56-66 (handler)The handler function for the 'base64_decode' tool. It receives the 'content' parameter (base64-encoded text), calls Base64Util.decode() to decode it, and returns the decoded text.
async ({ content }) => { const result = Base64Util.decode(content); return { content: [ { type: "text", text: result, }, ], }; } - src/service/base64.ts:53-54 (schema)The input schema for 'base64_decode': a required 'content' field of type string, describing the base64 text to decode.
{ content: z.string().describe("base64 text to decode"), - src/service/base64.ts:49-67 (registration)The registration of the 'base64_decode' tool via server.tool() with name 'base64_decode', description 'decode base64 to text', and the async handler that decodes input.
// Base64 Decode server.tool( "base64_decode", "decode base64 to text", { content: z.string().describe("base64 text to decode"), }, async ({ content }) => { const result = Base64Util.decode(content); return { content: [ { type: "text", text: result, }, ], }; } ); - src/service/base64.ts:19-21 (helper)The Base64Util.decode() helper method that performs the actual base64 decoding using Buffer.from(input, 'base64').toString('utf-8').
static decode(input: string): string { return Buffer.from(input, 'base64').toString('utf-8'); } - src/index.ts:6-19 (registration)Import of registerBase64Tool from './service/base64.js' into the main entry point.
import { registerBase64Tool } from "./service/base64.js"; import { registerHexTool } from "./service/hex.js"; // Create an MCP server const server = new McpServer({ name: "crypto-mcp", version: "1.0.0", }); // Register tools registerAESTool(server); registerDigestTool(server); registerDESTool(server); registerBase64Tool(server); registerHexTool(server);