utilities
Encode and decode Base64 strings with comprehensive format support through MCP protocol
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 PlansDecodes Base64 encoded data back to original text format
Encodes text or binary data to Base64 format with optional URL-safe encoding
Provides comprehensive information about Base64 encoding formats and usage examples
The Base64 MCP server provides comprehensive Base64 encoding and decoding functionality through the Model Context Protocol (MCP). This server provides comprehensive functionality.
This MCP server exposes 3 tools for AI agents:
encode_base64Purpose: Encode plain text to Base64 format
text (string) - The text to encodedecode_base64Purpose: Decode Base64 encoded string back to plain text
encoded (string) - The Base64 string to decodeget_encoding_infoPurpose: Get information about Base64 encoding
infoType (enum: "overview", "examples", "formats")/api/mcp/utilities/base64/sse/api/utilities/base64/v1Endpoint: https://apistack.online/api/mcp/utilities/base64/sse
Method: POST
Headers:
Content-Type: application/json
Authorization: Bearer YOUR_API_KEY
{
"jsonrpc": "2.0",
"id": "list-tools",
"method": "tools/list"
}
{
"jsonrpc": "2.0",
"id": "encode-1",
"method": "tools/call",
"params": {
"name": "encode_base64",
"arguments": {
"text": "Hello, World!"
}
}
}
{
"jsonrpc": "2.0",
"id": "decode-1",
"method": "tools/call",
"params": {
"name": "decode_base64",
"arguments": {
"encoded": "SGVsbG8sIFdvcmxkIQ=="
}
}
}
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}")
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}`);
})();
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}");
}
}
All tool responses follow the MCP protocol format:
{
"jsonrpc": "2.0",
"id": "request-id",
"result": {
"content": [
{
"type": "text",
"text": "Result content here"
}
]
}
}
{
"jsonrpc": "2.0",
"id": "request-id",
"error": {
"code": -32603,
"message": "Error description",
"data": "Additional error details"
}
}
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.
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
{
"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"]
}
}
{
"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"]
}
}
{
"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"]
}
}
For issues, feature requests, or integration help:
Note: This MCP server requires a PRO or ENTERPRISE subscription and valid API authentication. The server provides comprehensive functionality agents.
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"
}
}
}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.