Scry Terminal
Instant Magic: The Gathering card lookups and deck auditing from your terminal. No API keys, no rate limits, completely offline.
scry searches the entire Scryfall Oracle database (~38,000 cards) from a local SQLite index in ~50 ms. Built for MTG brewers, script writers, and AI assistants: human-friendly colored terminal output when interactive, compact JSONL when piped, and a zero-dependency Model Context Protocol (MCP) server for LLMs.
Install • Quick Start • Deck Linter • AI Agents & MCP • Command Reference • Contributing
Install
Requires Python 3.9+ (or use standalone prebuilt binaries) and ~200 MB disk space for the card cache.
pipx install scry-terminal
scry update # one-time: downloads the Oracle cache & builds the search index
Alternative: Standalone Prebuilt Binaries (no Python required)
Prebuilt bundles for macOS (Apple Silicon) and Linux (x86_64) are attached to each GitHub Release as scry-macos-arm64.tar.gz and scry-linux-x86_64.tar.gz.
macOS (Apple Silicon):
curl -L -o scry.tar.gz https://github.com/pigarmahdar/Scry-Terminal/releases/latest/download/scry-macos-arm64.tar.gz
tar xzf scry.tar.gz && sudo mv scry /usr/local/
sudo xattr -d com.apple.quarantine /usr/local/scry/scry # clears macOS Gatekeeper block
sudo ln -sf /usr/local/scry/scry /usr/local/bin/scry
scry update
Linux (x86_64):
curl -L -o scry.tar.gz https://github.com/pigarmahdar/Scry-Terminal/releases/latest/download/scry-linux-x86_64.tar.gz
tar xzf scry.tar.gz && sudo mv scry /usr/local/
sudo ln -sf /usr/local/scry/scry /usr/local/bin/scry
scry update
macOS Gatekeeper note: Because these binaries are not signed with a paid Apple Developer certificate, macOS sets a quarantine attribute. The
xattr -d com.apple.quarantinecommand removes it safely.
Alternative: pip / Git Clone
# Standard pip
pip install scry-terminal
scry update
# Clone for local development
git clone https://github.com/pigarmahdar/Scry-Terminal.git
cd Scry-Terminal && pip install -e .
scry update
Both scry and scryfall (backwards-compatible alias) are placed on your PATH automatically.
Quick Start
scry name "Sol Ring" # all printings of a card
scry fuzzy "sol rng" # typo-tolerant and partial-name search
scry oracle "Sol Ring" # canonical rules text only
scry text "create a treasure token" # search rules text
scry type "enchantment" --commander WG # browse by type and color identity
scry cmc <=2 --legal commander --limit 5 # filter by mana value & format legality
scry image "Sol Ring" # download high-res art to Desktop
scry deck "my_deck.txt" # instant deck architecture & mana audit
Auto-Switching Output (Human vs Agent)
Output formats adapt to how they are called:
- Terminal (Interactive): Formatted, color-coded text.
- Piped (
| jq, scripts, tools): Automatically emits compact JSONL (one JSON card per line). - Overrides: Use
--json,--jsonl,--csv, or--tsv. Stdout is strictly reserved for data; warnings and progress go to stderr.
scry search "counter target spell" --limit 500 \
| jq -r 'select(.legalities.modern=="legal") | .name'
Deck Architecture & Health Linter
Run instant (<20 ms), offline architectural audits on 100-card decklists:
scry deck deck.txt # audit decklist file
cat deck.txt | scry deck # audit from pipe
pbpaste | scry deck # audit macOS clipboard directly
scry deck deck.txt --json # machine-readable diagnostic schema
The 4 Diagnostic Pillars
- Mana Architecture & Vitals: Compares Frank Karsten colored mana sources against colored pip demands to detect early-turn multi-pip hurdles (e.g.
{U}{U}at CMC 2 with insufficient blue sources) and measures early playables density. - Table Dynamic & Political Posture: Categorizes card targets into Self-Focused (advancing board), Targeted (single-target removal/interaction), and Symmetrical (sweepers, group hug, table-wide effects).
- Engine Balance (Fuel vs. Payoff): Balances resource engines (draw, tokens, sacrifice, counters) against payoff listeners (
"Whenever you...") to flag engine chokes or payoff deficits. - Vintage Spectrum & Heritage: Tracks chronological distribution (Classic Pre-2003, Modern Frame 2003–2014, Contemporary 2015+) and surfaces your deck's Heritage Anchor card.
AI Agents & MCP
scry includes a built-in Model Context Protocol (MCP) server running over stdio with zero external dependencies:
scry mcp
Add it to your MCP client configuration (claude_desktop_config.json, Cursor, Windsurf, Claude Code):
{
"mcpServers": {
"scry": {
"command": "scry",
"args": ["mcp"]
}
}
}
- Native MCP Tools:
scryfall_oracle(token-efficient rules text),scryfall_search(filtered card search),scryfall_fuzzy(typo resolution),scryfall_deck(4-pillar deck audit),scryfall_price(market prices), andscryfall_doctor(cache health). - Agent Prompts: Point your AI assistant at AGENT_PROMPT.md for output contracts, schemas, and prompting rules to prevent LLM card hallucinations.
Command Reference
| Command | Purpose | Example |
|---|---|---|
name |
Search by card name (partial match) | scry name "Gilded Drake" |
oracle |
Canonical rules text only (deduplicated) | scry oracle "Sol Ring" |
fuzzy |
Typo-tolerant name lookup | scry fuzzy "thragtuskk" |
text |
Search rules/oracle text | scry text "destroy all creatures" |
type |
Search type line | scry type "enchantment" |
color |
Search by colour identity (WUBRG) | scry color WG |
cmc |
Search by mana value (=, <=, >=) |
scry cmc <=3 |
keyword |
Search keyword abilities | scry keyword flash |
price |
Search with USD, EUR, and TIX pricing | scry price "Rhystic Study" |
deck |
4-pillar static analysis of a decklist | scry deck deck.txt |
image |
Download high-res card art to disk | scry image "Sol Ring" |
search |
General search across name, text, and type | scry search "green creature" |
random |
Fetch a random card | scry random |
mcp |
Start Model Context Protocol server on stdio | scry mcp |
update |
Download latest Oracle cache & rebuild index | scry update |
doctor |
Report cache & search index health | scry doctor |
reindex |
Force rebuild of SQLite search index | scry reindex |
completion |
Generate shell completions (bash, zsh, fish) |
source <(scry completion zsh) |
version |
Print installed version | scry version |
Common Flags
| Flag | Description |
|---|---|
--commander WUBRG |
Filter cards within a commander's colour identity |
--legal <format> |
Restrict to legal cards in a format (commander, modern, standard, etc.) |
--limit N |
Maximum results returned (default: 10) |
--sort <field> |
Sort by name, cmc, or price |
--exact |
Require exact name match for name |
--json / --jsonl / --csv / --tsv |
Explicit output format overrides |
--pretty |
Force color terminal output even when piped |
--out <dir> / --size <s|n|l|png> |
Output directory and size for image |
Cache & Maintenance
Searches run entirely offline against a local SQLite FTS5 index (~102 MB) derived from Scryfall bulk data. The index automatically creates and updates itself on demand.
- Refresh Cache:
scry updatedownloads the latest Oracle dataset (~200 MB) from Scryfall. - Check Health:
scry doctorreports index status, card counts, and staleness. - Rebuild Index:
scry reindexforces a clean rebuild of the SQLite database.
Contributing & Development
Contributions and pull requests are welcome!
See CONTRIBUTING.md for local development setup, architectural invariants (downward-only imports, zero runtime dependencies), and test quality gates (parity.py, cli_golden.py).
Disclaimers & License
Card data and imagery courtesy of Scryfall. Scry Terminal is an unofficial, community-made tool and is not affiliated with Scryfall LLC or Wizards of the Coast LLC. Magic: The Gathering is TM & © Wizards of the Coast LLC.
Released under the MIT License.
Built as part of Kwain.gg (pigar.me/kwaingg) — a project about generosity, attention, and play.
Metadata
Release files for scry-terminal 1.2.0
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | Provenance | Actions |
|---|---|---|---|---|
| scry_terminal-1.2.0.tar.gz | 79.8 kB | With provenance | Details for scry_terminal-1.2.0.tar.gz |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Actions Reset |
|---|---|---|---|---|
| scry_terminal-1.2.0-py3-none-any.whl | Python 3 | none | any | Details for scry_terminal-1.2.0-py3-none-any.whl |
Total release size: 150.8 kB
Release files / scry_terminal-1.2.0.tar.gz
| Download URL | scry_terminal-1.2.0.tar.gz |
|---|---|
| Size | 79.8 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
65961a73cb717a0e4e1a5999ec3960f0374a189d521889cf7668ff43bf019a7f
|
|
BLAKE2b-256 checksum How to use checksums |
8e8de817d020c876582c59df987caada6d841eaeeb8285461542b0791d5b2542
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/7.0.0 CPython/3.13.16
|
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
PyPI Publish Attestation
PyPI verified that this artifact, at this checksum, originated from the publisher listed below.
Signed by GitHub Actions, verified by PyPI on Nov 21, 2026.
Transparency logRelease files / scry_terminal-1.2.0-py3-none-any.whl
| Download URL | scry_terminal-1.2.0-py3-none-any.whl |
|---|---|
| Size | 71.0 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
7893124eb3f3c0720a6184cfc4d49ffd351f603790feb78fdbf7ed46e6c313f4
|
|
BLAKE2b-256 checksum How to use checksums |
58f333965bce0d0f674fd124b8ff9cae9bcb69345d4d29d60db570b513eea4fc
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/7.0.0 CPython/3.13.16
|
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
PyPI Publish Attestation
PyPI verified that this artifact, at this checksum, originated from the publisher listed below.
Signed by GitHub Actions, verified by PyPI on Nov 21, 2026.
Transparency logSecurity for scry-terminal 1.2.0
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
Full provenance
Both files in this release have been uploaded with provenance metadata.
Attestation for scry_terminal-1.2.0.tar.gz
PyPI Publish Attestation
PyPI verified that this artifact, at this checksum, originated from the publisher listed below.
Signed by GitHub Actions, verified by PyPI on Nov 21, 2026.
Transparency logA note on package security
PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.
To learn more about protecting yourself from malicious actors, visit our package security documentation.