Skip to main content
Glama
README.md
# re-kaitai

MCP server exposing [Kaitai Struct](https://kaitai.io/) for custom binary format reverse engineering.

## Tools

| Tool | What it does |
|---|---|
| `check_compiler` | Confirm kaitai-struct-compiler is installed |
| `list_known_formats` | List bundled .ksy formats |
| `download_format` | Download a .ksy from the kaitai-formats gallery |
| `compile_format` | Compile .ksy → Python at runtime |
| `parse_with_format` | Parse a binary with a compiled or precompiled format |
| `visualize` | Same as parse_with_format, named for the intent |
| `diff_parses` | Parse two files and return a structural diff |

## Install

```bash
# System dependency
brew install kaitai-struct-compiler   # macOS
scoop install kaitai-struct-compiler  # Windows
# Linux: download prebuilt from https://github.com/kaitai-io/kaitai_struct_compiler/releases

# Python
pip install kaitaistruct
pip install -e ./servers/re-kaitai
```

## Usage pattern (in Claude Code)

```
1. "Decode this firmware blob"
2. Claude identifies the file magic (e.g. LZMA header)
3. Claude downloads the matching .ksy: download_format("lzma")
4. Claude compiles: compile_format("/path/lzma.ksy")
5. Claude parses: parse_with_format(path="/path/blob", ksy_path="/path/lzma.ksy")
6. Claude inspects the parse tree, iterates on the .ksy, re-parses
```

The Kaitai workflow is iterative: compile → parse → fix the schema → re-compile → parse again.

TDQS

B3.2/5.0

Scored across 8 tools

Disambiguation4/5

Most tools have distinct purposes, but visualize is explicitly described as identical to parse_with_format, causing confusion. One overlapping pair reduces clarity.

Naming Consistency3/5

Mix of verb_noun and verb patterns; 'visualize' is a single verb unlike others, and 'parse_with_format' uses 'with' breaking the convention. Inconsistent but still readable.

Tool Count5/5

8 tools is well-scoped for a Kaitai Struct parsing server, covering compilation, parsing, downloading, listing, diffing, and a specialized format. No unnecessary tools.

Completeness4/5

Covers core workflows (compile, parse, diff, download, list), but lacks tools for format creation or conversion. Minor gaps, e.g., no way to inspect precompiled modules.

Maintenance

ActivityStale
ResponsivenessSyncing