- Home
- MCP servers
- Base64
Base64
- python
3
GitHub Stars
python
Language
6 months ago
First Indexed
2 months ago
Catalog Refreshed
Documentation & install
Readme and setup notes from the catalogue, plus a client-ready config you can copy for your MCP host.
Installation
Add the following to your MCP client configuration file.
Configuration
View docs{
"mcpServers": {
"liuyazui-base64_server": {
"command": "uv",
"args": [
"run",
"--with",
"mcp[cli]",
"mcp",
"run",
"[path to base64_server.py]"
],
"env": {
"YOUR_PLACEHOLDER": "FOO_BAR"
}
}
}
}You can run a lightweight MCP server that handles Base64 encoding and decoding for both text and images, with Data URL support. It provides simple APIs to convert content to and from Base64, and is designed to be easy to install and integrate with MCP clients and inspectors.
How to use
You integrate the server with an MCP client to perform encoding and decoding tasks. Use it to encode plain text to Base64, decode Base64 back to text, encode images to Base64, and decode Base64 back to image files. You can also work with Data URLs directly for embedded content.
How to install
Prerequisites: ensure you have Python installed (recommended Python 3.8 or newer) and have access to a Python package installer. You will also use the UV tool to manage dependencies and run the server.
# Create a Python virtual environment managed by uv
uv venv
# Activate the virtual environment
# Linux/macOS
source .venv/bin/activate
# Windows
.venv\Scripts\activate
# Install the package in editable (development) mode
uv pip install -e .
# Install development dependencies (optional)
uv pip install -e ".[dev]"
If you want to use Smithery to install this MCP server for a Claude desktop client, run the following command to install via Smithery:
npx -y @smithery/cli install @liuyazui/base64_server --client claude
Testing with an MCP Inspector and starting the server during development is supported as follows:
# Test the server with MCP Inspector in development mode
uv run mcp dev base64_server.py
Configure your MCP client to run the local server. The following configuration shows how to launch the server via UV in a local setup:
{
"mcpServers": {
"base64_encoder": {
"command": "uv",
"args": [
"run",
"--with",
"mcp[cli]",
"mcp",
"run",
"[path to base64_server.py]"
]
}
}
}
Additional content
The server exposes a concise set of tools for base64 operations and links to resources that generate encoded and decoded content. Use these tools to perform text and image conversions and handle Data URL formats as part of your MCP integration.
Available tools
base64_encode_text
Encode a text string to Base64 format.
base64_decode_text
Decode a Base64 string back to plain text.
base64_encode_image
Encode an image file to a Base64 string.
base64_decode_image
Decode a Base64 string back into an image file with a specified mime type.
base64_usage_guide
Provide a basic usage guide for the Base64 service.
encode_text_prompt
Prompt template for text encoding tasks.
encode_image_prompt
Prompt template for image encoding tasks.
error_handling_prompt
Prompt template for handling errors during encoding/decoding.