MCP Servers/Base64 Encoder/Decoder

Base64 Encoder/Decoder

utilities

active

Encode and decode Base64 strings with comprehensive format support through MCP protocol

utilitiesmcputilitiesai-tools

API Access Requires Subscription

While you can view all details here, using this MCP server's API requires a Enterprise subscription. API calls with FREE plan keys will return an access error.

View Pricing Plans

Available Tools

decode_base64

tool

Decodes Base64 encoded data back to original text format

decodingbase64text-processing

encode_base64

tool

Encodes text or binary data to Base64 format with optional URL-safe encoding

encodingbase64text-processing

get_encoding_info

tool

Provides comprehensive information about Base64 encoding formats and usage examples

informationhelpbase64

Documentation

Base64 Encoder/Decoder Documentation

Base64 Encoder/Decoder MCP Server

Overview

The Base64 MCP server provides comprehensive Base64 encoding and decoding functionality through the Model Context Protocol (MCP). This server provides comprehensive functionality.

๐Ÿ”ง Exposed Tools

This MCP server exposes 3 tools for AI agents:

1. encode_base64

Purpose: Encode plain text to Base64 format

  • Input: text (string) - The text to encode
  • Output: Base64 encoded string
  • Example: "Hello, World!" โ†’ "SGVsbG8sIFdvcmxkIQ=="

2. decode_base64

Purpose: Decode Base64 encoded string back to plain text

  • Input: encoded (string) - The Base64 string to decode
  • Output: Original plain text
  • Example: "SGVsbG8sIFdvcmxkIQ==" โ†’ "Hello, World!"

3. get_encoding_info

Purpose: Get information about Base64 encoding

  • Input: infoType (enum: "overview", "examples", "formats")
  • Output: Educational information about Base64 encoding
  • Use case: Help AI agents understand Base64 format and usage

๐Ÿ”— Server Details

  • Category: Utilities
  • Transport: Server-Sent Events (SSE)
  • Endpoint: /api/mcp/utilities/base64/sse
  • Authentication: Required (PRO/ENTERPRISE plans)
  • Wrapped API: /api/utilities/base64/v1

๐Ÿ“‹ Prerequisites

  • Subscription: PRO or ENTERPRISE plan
  • API Key: Valid API key with Base64 access
  • MCP Client: Any MCP-compatible client or AI agent

๐Ÿš€ Quick Start

Connection Setup

Endpoint: https://apistack.online/api/mcp/utilities/base64/sse
Method: POST
Headers:
  Content-Type: application/json
  Authorization: Bearer YOUR_API_KEY

Basic MCP Requests

List Available Tools

{
  "jsonrpc": "2.0",
  "id": "list-tools",
  "method": "tools/list"
}

Encode Text to Base64

{
  "jsonrpc": "2.0",
  "id": "encode-1",
  "method": "tools/call",
  "params": {
    "name": "encode_base64",
    "arguments": {
      "text": "Hello, World!"
    }
  }
}

Decode Base64 to Text

{
  "jsonrpc": "2.0",
  "id": "decode-1",
  "method": "tools/call",
  "params": {
    "name": "decode_base64",
    "arguments": {
      "encoded": "SGVsbG8sIFdvcmxkIQ=="
    }
  }
}

๐Ÿ’ป Implementation Examples

Python Example

import requests
import json

class Base64MCPClient:
    def __init__(self, base_url, api_key):
        self.base_url = base_url
        self.headers = {
            "Content-Type": "application/json",
            "Authorization": f"Bearer {api_key}"
        }
        self.endpoint = f"{base_url}/api/mcp/utilities/base64/sse"
    
    def encode_text(self, text):
        request = {
            "jsonrpc": "2.0",
            "id": "encode",
            "method": "tools/call",
            "params": {
                "name": "encode_base64",
                "arguments": {"text": text}
            }
        }
        
        response = requests.post(self.endpoint, headers=self.headers, json=request)
        result = response.json()
        return result["result"]["content"][0]["text"]
    
    def decode_text(self, encoded):
        request = {
            "jsonrpc": "2.0",
            "id": "decode",
            "method": "tools/call",
            "params": {
                "name": "decode_base64",
                "arguments": {"encoded": encoded}
            }
        }
        
        response = requests.post(self.endpoint, headers=self.headers, json=request)
        result = response.json()
        return result["result"]["content"][0]["text"]

# Usage
client = Base64MCPClient("https://apistack.online", "YOUR_API_KEY")
encoded = client.encode_text("Hello, World!")
decoded = client.decode_text(encoded)
print(f"Encoded: {encoded}")
print(f"Decoded: {decoded}")

JavaScript/Node.js Example

const axios = require('axios');

class Base64MCPClient {
    constructor(baseUrl, apiKey) {
        this.baseUrl = baseUrl;
        this.endpoint = `${baseUrl}/api/mcp/utilities/base64/sse`;
        this.headers = {
            'Content-Type': 'application/json',
            'Authorization': `Bearer ${apiKey}`
        };
    }

    async encodeText(text) {
        const request = {
            jsonrpc: "2.0",
            id: "encode",
            method: "tools/call",
            params: {
                name: "encode_base64",
                arguments: { text }
            }
        };

        const response = await axios.post(this.endpoint, request, { headers: this.headers });
        return response.data.result.content[0].text;
    }

    async decodeText(encoded) {
        const request = {
            jsonrpc: "2.0",
            id: "decode",
            method: "tools/call",
            params: {
                name: "decode_base64",
                arguments: { encoded }
            }
        };

        const response = await axios.post(this.endpoint, request, { headers: this.headers });
        return response.data.result.content[0].text;
    }
}

// Usage
(async () => {
    const client = new Base64MCPClient("https://apistack.online", "YOUR_API_KEY");
    
    const encoded = await client.encodeText("Hello, World!");
    const decoded = await client.decodeText(encoded);
    
    console.log(`Encoded: ${encoded}`);
    console.log(`Decoded: ${decoded}`);
})();

.NET Core Example

using System;
using System.Net.Http;
using System.Text;
using System.Text.Json;
using System.Threading.Tasks;

public class Base64MCPClient
{
    private readonly HttpClient _httpClient;
    private readonly string _endpoint;

    public Base64MCPClient(string baseUrl, string apiKey)
    {
        _httpClient = new HttpClient();
        _endpoint = $"{baseUrl}/api/mcp/utilities/base64/sse";
        _httpClient.DefaultRequestHeaders.Add("Authorization", $"Bearer {apiKey}");
    }

    public async Task<string> EncodeTextAsync(string text)
    {
        var request = new
        {
            jsonrpc = "2.0",
            id = "encode",
            method = "tools/call",
            @params = new
            {
                name = "encode_base64",
                arguments = new { text }
            }
        };

        var json = JsonSerializer.Serialize(request);
        var content = new StringContent(json, Encoding.UTF8, "application/json");
        
        var response = await _httpClient.PostAsync(_endpoint, content);
        var responseJson = await response.Content.ReadAsStringAsync();
        
        using var doc = JsonDocument.Parse(responseJson);
        return doc.RootElement.GetProperty("result")
                  .GetProperty("content")[0]
                  .GetProperty("text").GetString();
    }

    public async Task<string> DecodeTextAsync(string encoded)
    {
        var request = new
        {
            jsonrpc = "2.0",
            id = "decode",
            method = "tools/call",
            @params = new
            {
                name = "decode_base64",
                arguments = new { encoded }
            }
        };

        var json = JsonSerializer.Serialize(request);
        var content = new StringContent(json, Encoding.UTF8, "application/json");
        
        var response = await _httpClient.PostAsync(_endpoint, content);
        var responseJson = await response.Content.ReadAsStringAsync();
        
        using var doc = JsonDocument.Parse(responseJson);
        return doc.RootElement.GetProperty("result")
                  .GetProperty("content")[0]
                  .GetProperty("text").GetString();
    }
}

// Usage
class Program
{
    static async Task Main(string[] args)
    {
        var client = new Base64MCPClient("https://apistack.online", "YOUR_API_KEY");
        
        var encoded = await client.EncodeTextAsync("Hello, World!");
        var decoded = await client.DecodeTextAsync(encoded);
        
        Console.WriteLine($"Encoded: {encoded}");
        Console.WriteLine($"Decoded: {decoded}");
    }
}

๐Ÿ”’ Security & Authentication

  • Authentication Required: All requests must include a valid Bearer token
  • Plan Restrictions: Only PRO and ENTERPRISE users can access this MCP server
  • Rate Limiting: 60 requests/minute, 1000 requests/hour
  • Input Validation: All inputs are validated for type and format
  • Error Handling: Comprehensive error responses following MCP protocol

๐Ÿ“Š Response Format

All tool responses follow the MCP protocol format:

Success Response

{
  "jsonrpc": "2.0",
  "id": "request-id",
  "result": {
    "content": [
      {
        "type": "text",
        "text": "Result content here"
      }
    ]
  }
}

Error Response

{
  "jsonrpc": "2.0",
  "id": "request-id",
  "error": {
    "code": -32603,
    "message": "Error description",
    "data": "Additional error details"
  }
}

๐Ÿงช Testing

Use the provided test script to verify functionality:

node scripts/test-base64-mcp-server.js

This script tests all three tools without requiring database setup.

๐Ÿ—๏ธ Architecture

AI Agent/Client
       โ†“
MCP Protocol (JSON-RPC 2.0)
       โ†“
Base64 MCP Server (/api/mcp/utilities/base64/sse)
       โ†“
Authentication & Validation
       โ†“
Base64 API (/api/utilities/base64/v1)
       โ†“
Response via MCP Protocol

๐Ÿ“ Tool Schemas

encode_base64 Schema

{
  "name": "encode_base64",
  "description": "Encode a string to Base64 format",
  "inputSchema": {
    "type": "object",
    "properties": {
      "text": {
        "type": "string",
        "description": "The text to encode in Base64"
      }
    },
    "required": ["text"]
  }
}

decode_base64 Schema

{
  "name": "decode_base64",
  "description": "Decode a Base64 encoded string",
  "inputSchema": {
    "type": "object",
    "properties": {
      "encoded": {
        "type": "string",
        "description": "The Base64 encoded string to decode"
      }
    },
    "required": ["encoded"]
  }
}

get_encoding_info Schema

{
  "name": "get_encoding_info",
  "description": "Get information about Base64 encoding",
  "inputSchema": {
    "type": "object",
    "properties": {
      "infoType": {
        "type": "string",
        "enum": ["overview", "examples", "formats"],
        "description": "Type of encoding information to retrieve"
      }
    },
    "required": ["infoType"]
  }
}

๐Ÿค Support

For issues, feature requests, or integration help:

  • Check the API documentation
  • Review the examples above
  • Test with the provided scripts
  • Contact support for PRO/ENTERPRISE users

Note: This MCP server requires a PRO or ENTERPRISE subscription and valid API authentication. The server provides comprehensive functionality agents.

Quick Info

Endpoint
/api/mcp/utilities/base64/sse
Transport
Server-Sent Events (SSE)
Tools Available
3
Plan Required
PRO, ENTERPRISE

MCP Configuration

Add this configuration to your MCP client:

Note: Replace "YOUR_API_KEY" with a valid Enterprise API key. FREE plan keys will receive access errors.

{
  "mcpServers": {
    "base64-utilities": {
      "command": "curl",
      "args": [
        "-X",
        "POST",
        "https://apistack.online/api/mcp/utilities/base64/sse",
        "-H",
        "Content-Type: application/json",
        "-H",
        "Authorization: Bearer YOUR_API_KEY",
        "--data-raw",
        "@-"
      ],
      "transport": "sse"
    }
  }
}

Try It Out

Use the MCP configuration above in your AI client, or test the underlying APIs in our playground.

API playground requires a Enterprise subscription for access.

Open in Playground