- Explore MCP Servers
- base64_server
Base64 Server
What is Base64 Server
base64_server is a simple and efficient MCP server focused on providing Base64 encoding and decoding functionalities, supporting both text and image conversions.
Use cases
Use cases include converting text to Base64 for web transmission, encoding images for embedding in HTML, and decoding Base64 strings back to their original formats.
How to use
To use base64_server, you can install it via ‘uv’, create a virtual environment, and run the server using MCP Inspector or integrate it with an MCP client by adding the server configuration.
Key features
Key features include text and image Base64 encoding and decoding, support for Data URL format, a simple API, and dependency management using ‘uv’.
Where to use
base64_server can be used in various fields such as web development, data processing, and AI workflows where Base64 encoding and decoding are required.
Clients Supporting MCP
The following are the main client software that supports the Model Context Protocol. Click the link to visit the official website for more information.
Overview
What is Base64 Server
base64_server is a simple and efficient MCP server focused on providing Base64 encoding and decoding functionalities, supporting both text and image conversions.
Use cases
Use cases include converting text to Base64 for web transmission, encoding images for embedding in HTML, and decoding Base64 strings back to their original formats.
How to use
To use base64_server, you can install it via ‘uv’, create a virtual environment, and run the server using MCP Inspector or integrate it with an MCP client by adding the server configuration.
Key features
Key features include text and image Base64 encoding and decoding, support for Data URL format, a simple API, and dependency management using ‘uv’.
Where to use
base64_server can be used in various fields such as web development, data processing, and AI workflows where Base64 encoding and decoding are required.
Clients Supporting MCP
The following are the main client software that supports the Model Context Protocol. Click the link to visit the official website for more information.
Content
Base64编码解码MCP服务器
一个简单高效的MCP服务器,专注于提供Base64编码和解码功能,支持文本和图片的Base64转换。
功能特点
- 文本Base64编码和解码
- 图片Base64编码和解码
- 支持Data URL格式
- 简单易用的API
- 使用uv进行依赖管理
安装
使用uv安装
# 创建虚拟环境
uv venv
# 激活虚拟环境(Linux/macOS)
source .venv/bin/activate
# 激活虚拟环境(Windows)
.venv\Scripts\activate
# 安装包(开发模式)
uv pip install -e .
# 安装带开发依赖的包
uv pip install -e ".[dev]"
安装Smithery
使用Smithery为Claude桌面安装Base64编码解码MCP服务器,使用以下命令:
npx -y @smithery/cli install @liuyazui/base64_server --client claude
使用方法
使用MCP Inspector测试
# 使用MCP Inspector测试服务器
uv run mcp dev base64_server.py
与MCP client集成
-
添加服务器配置:
{ "mcpServers": { "base64-encoder": { "command": "uv", "args": [ "run", "--with", "mcp[cli]", "mcp", "run", "[path to base64_server.py]" ] } } }
API参考
工具(Tools)
- base64_encode_text(text: str) -> str:将文本转换为Base64编码
- base64_decode_text(encoded: str) -> str:将Base64编码解码为文本
- base64_encode_image(image_path: str) -> str:将图片转换为Base64编码
- base64_decode_image(encoded: str, output_path: str, mime_type: str = “image/png”) -> str:将Base64编码解码为图片
资源(Resources)
- encode://base64/text/{text}:获取文本的Base64编码
- decode://base64/text/{encoded}:获取Base64编码的解码结果
- encode://base64/image/{image_path}:获取图片的Base64编码
- decode://base64/image/{encoded}:获取Base64编码的解码图片
提示模板(Prompts)
- base64_usage_guide(): 提供Base64服务的基本使用指南
- encode_text_prompt(text: str): 文本编码提示模板
- encode_image_prompt(image_path: str): 图片编码提示模板
- error_handling_prompt(error_message: str): 错误处理提示模板
使用示例:
# 获取使用指南提示
messages = await client.get_prompt("base64_usage_guide")
# 获取文本编码提示
messages = await client.get_prompt("encode_text_prompt", {"text": "Hello World"})
开发
许可证
MIT
Dev Tools Supporting MCP
The following are the main code editors that support the Model Context Protocol. Click the link to visit the official website for more information.