Metadata-Version: 2.4
Name: mcp-base64
Version: 0.1.4
Summary: MCP server for Base64 file conversion (stdio transport)
Author: Stefan Kuhn
License: MIT
License-File: LICENSE
Keywords: base64,cli,fastmcp,mcp
Classifier: Intended Audience :: Developers
Classifier: License :: OSI Approved :: MIT License
Classifier: Programming Language :: Python :: 3
Classifier: Programming Language :: Python :: 3.10
Classifier: Programming Language :: Python :: 3.11
Classifier: Programming Language :: Python :: 3.12
Requires-Python: >=3.10
Requires-Dist: fastmcp>=0.2.0
Requires-Dist: pydantic>=2.0.0
Provides-Extra: dev
Requires-Dist: hatch; extra == 'dev'
Requires-Dist: pytest-asyncio>=0.21.0; extra == 'dev'
Requires-Dist: pytest>=7.0.0; extra == 'dev'
Requires-Dist: ruff>=0.1.0; extra == 'dev'
Description-Content-Type: text/markdown

# 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

## Usage

### IDE Configuration
For IDE plugins, add this server to your MCP configuration JSON:
```json
{
  "mcpServers": {
    "base64": {
      "command": "uvx",
      "args": [
        "mcp-base64"
      ]
    }
  }
}
```

### Direct Execution
```bash
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:

```bash
./.venv/bin/python -m pip install -e .[dev]
```

Run tests:

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

Run linting:

```bash
./.venv/bin/python -m ruff check .
```
