Skip to main content
Glama
Wuodan

mcp-base64

by Wuodan

MCP Base64 Server

A Python MCP (Model Context Protocol) server for Base64 file conversion with stdio transport.

Features

  • encode_file_to_base64: Encode any file to base64 string

  • decode_base64_to_file: Decode base64 content to file

  • Binary-safe: Handles both text and binary files correctly

Related MCP server: Local Utilities MCP Server

Usage

IDE Configuration

For IDE plugins, add this server to your MCP configuration JSON:

{
  "mcpServers": {
    "base64": {
      "command": "uvx",
      "args": [
        "mcp-base64"
      ]
    }
  }
}

Direct Execution

git clone https://github.com/Wuodan/mcp-base64.git
cd mcp-base64
python3 -m venv .venv
./.venv/bin/python -m pip install -e .
./.venv/bin/python -m mcp_base64.server

Tools

encode_file_to_base64(file_path: str) -> str

Encodes a file to base64 string.

Parameters:

  • file_path (str): Absolute path to file to encode

Returns: Base64 encoded string

decode_base64_to_file(base64_content: str, file_path: str) -> str

Decodes base64 string to file.

Parameters:

  • base64_content (str): Base64 encoded content

  • file_path (str): Absolute path where to save decoded file

Returns: Success message with file path

Development

Install development dependencies:

./.venv/bin/python -m pip install -r requirements-dev.txt -e .

Run tests:

./.venv/bin/python -m pytest -q

Run linting:

./scripts/lint.sh

Available Tools

2 tools
decode_base64_to_fileDecode Base64 To FileA

Decode a base64 string and write it to a file.

This tool takes base64 encoded content and writes the decoded binary data to a file. Only absolute paths are allowed for security reasons.

ParametersJSON Schema
NameRequiredDescriptionDefault
file_pathYesAbsolute path where to save the decoded file
base64_contentYesBase64 encoded content to decode and write to file

Output Schema

ParametersJSON Schema
NameRequiredDescription
resultYes

TDQS

A4/5.0
Behavior3/5

Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?

No annotations are provided, so the description carries the full burden. It discloses the mutation (writes to a file) and the absolute-path restriction, but omits other important behaviors such as whether an existing file is overwritten, whether directories are created, or how invalid base64 input is handled. These gaps are material for a file-writing tool.

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness5/5

Is the description appropriately sized, front-loaded, and free of redundancy?

The description is two sentences with zero redundancy. The primary purpose is front-loaded in the first sentence, and the security constraint is a concise, valuable addition. Every sentence earns its place without any fluff.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness4/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

For a tool with only two required parameters and an output schema (signal indicates true), the description covers the essential purpose and a key constraint. It lacks explicit details on overwrite behavior and error handling, but the tool's simplicity and the presence of an output schema reduce the need for exhaustive elaboration. It is adequate but not flawless.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters3/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

Schema description coverage is 100% (both parameters have clear descriptions in the schema), so the baseline is 3. The tool description adds only the absolute-path security constraint, which is more behavioral than parameter-specific. It does not enrich the meaning of either parameter beyond what the schema already provides.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose5/5

Does the description clearly state what the tool does and how it differs from similar tools?

The description explicitly states the action ('Decode a base64 string and write it to a file') with a clear verb and resource, and it naturally differentiates from the sibling encode_file_to_base64 by being the reverse operation. No ambiguity remains about what the tool accomplishes.

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines4/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

The description provides a concrete usage constraint ('Only absolute paths are allowed for security reasons'), which is directly actionable. It does not explicitly name when to use this tool versus the sibling, but the opposite nature of the sibling makes the choice obvious. There are no exclusion conditions beyond the path requirement.

Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.

encode_file_to_base64Encode File To Base64A

Encode a file to a base64 string.

This tool reads a file in binary mode and returns its contents encoded as a base64 string. Only absolute paths are allowed for security reasons.

ParametersJSON Schema
NameRequiredDescriptionDefault
file_pathYesAbsolute path to the file to encode to base64

Output Schema

ParametersJSON Schema
NameRequiredDescription
resultYes

TDQS

A4.1/5.0
Behavior4/5

Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?

No annotations exist, so the description carries the transparency burden. It discloses that the file is read in binary mode, that contents are returned as base64, and that relative paths are disallowed for security. It does not mention missing-file or permission errors, but the read-only nature is clear.

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness5/5

Is the description appropriately sized, front-loaded, and free of redundancy?

Two sentences, front-loaded with the action, followed by a relevant behavioral and security constraint. No filler or repetition of schema details.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness5/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

With one well-documented parameter, a strict path rule, and an output schema available, the definition gives an agent everything needed to invoke the tool correctly. The sibling decode tool is visible in context, so the encode/decode relationship is clear even without in-text mention.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters3/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

The single parameter is already fully described in the schema with examples at 100% coverage. The description mostly reinforces the absolute-path expectation and adds the security rationale, which is useful but not a substantial semantic addition.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose5/5

Does the description clearly state what the tool does and how it differs from similar tools?

States a specific verb ('Encode'), a resource ('a file'), and the output format ('base64 string'). It further specifies binary mode and the absolute-path restriction, which separates it from the decode sibling. The purpose is unambiguous and distinct from decode_base64_to_file.

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines3/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

No explicit when-to-use or alternative routing is given; the decode sibling is never mentioned. The correct use is only implied by the encode/decode naming and the action description, and the only stated constraint is absolute paths.

Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.

Tool Schema Changelog

Recent tool additions, removals, and schema changes observed during successful MCP inspections.

  1. 2 tool updatesv0.1.0
    • First observeddecode_base64_to_file
    • First observedencode_file_to_base64

TDQS

A4.4/5.0

Scored across 2 tools

Disambiguation5/5

The two tools are exact opposites with non-overlapping purposes: one encodes a file to base64, the other decodes base64 to a file. There is no ambiguity about which tool to select for a given direction.

Naming Consistency5/5

Both names follow the same verb_object_preposition_object pattern: encode_file_to_base64 and decode_base64_to_file. The naming is symmetric, predictable, and clearly indicates the input and output of each operation.

Tool Count5/5

Two tools is exactly the right scope for a focused base64 file conversion server. Each tool earns its place, and adding more tools would likely introduce redundancy or scope creep.

Completeness5/5

The server fully covers its stated domain: converting between file contents and base64 strings in both directions. There are no obvious missing operations for a file-based base64 utility.

Maintenance

ActivityActive
ResponsivenessNo issues

Related MCP Connectors

Related MCP Servers