.mtgr: Magic: The Gathering game records
.mtgr is a plain-text format for recording games of Magic: The Gathering, modelled on chess's PGN. Any tool can write a game record, and any tool can read, replay, and check one.
[Mtgr "0.3.0"]
[Event "?"]
[Site "MTGO"]
...
[Perspective "PlayerA"]
...
1:52 #2 "Sowing Mycospawn" cast from hand
1:52 #2 "Sowing Mycospawn" choose cost "kicker"
1:52 "PlayerA" pay {G}{C}{C}{C}{C}{C} by cost:#2
1:53 new ability #33 triggered of #2 "Sowing Mycospawn" "When you cast this spell, search your library for a land card, put it onto the battlefield, then shuffle." controller "PlayerA" in stack
1:56 new ability #34 triggered of #2 "Sowing Mycospawn" "When you cast this spell, if it was kicked, exile target land." controller "PlayerA" in stack
1:56 #34 target #17 "Urza's Tower"
...
2:02 #34 resolve
2:02 #17 "Urza's Tower" move battlefield -> exile by #34
...
1-0A record says what happened and why: every event has a cause, every choice and cost is recorded, every object has an ID (even cards the recording player cannot see), and the full game state is written at the start of every turn so a viewer can jump straight to it.
Status: pre-1.0 and changing. Breaking changes are still allowed.
Where to start
- Reading a file: the walkthrough
examples/mycospawn-turn-5.md. For a whole match, with sideboarding, clocks, and annotations, seeexamples/match.md. - Writing a recorder or a parser: the specification,
spec/mtgr.md, the keyword reference, and the conformance fixtures to test against. - Why something is the way it is: the decision records in
decisions/. - Proposing a change:
CONTRIBUTING.md. - What changed between versions:
CHANGELOG.md.
Documentation site
The documentation is built with VitePress:
npm install
npm run docs:devSources and readers
The first writer records from MTGO. Readers include the replay package used by mtgreplay.app and MyMTGO. The format itself is not tied to any client: client-specific data is prefixed (for example MTGO_Version) and every file is meaningful without it.
References
- Magic: The Gathering Comprehensive Rules, effective 2026-09-25: https://magic.wizards.com/en/rules
- PGN standard (1994): https://www.saremba.de/chessgml/standards/pgn/pgn-complete.htm