mtg-export

mtg-export

Enables generating Magic: The Gathering proxy PDF sheets from Archidekt decks or text card lists, with configurable image size and caching.

Category
访问服务器

README

mtg-export

A CLI that turns a Magic: The Gathering deck into a printable PDF proxy sheet — a 3×3 grid of card images at true card size (2.5″×3.5″) on US-Letter pages, with faint cut guides. Point it at an Archidekt deck, a text card list, or your clipboard.

Card images come from Scryfall, respecting their usage policy (descriptive User-Agent, request throttling, and on-disk image caching so files are never re-downloaded).

Example proxy sheet

A page from a generated proxy sheet — 3×3 cards at true size with cut guides.

Install

npm install          # pdf-lib + @modelcontextprotocol/sdk

Requires Node 18+ (developed on Node 24). No Python, no native modules.

Optionally link it as a global command:

npm link             # then run `mtg-export ...` anywhere

Usage

# Archidekt deck by id or URL (public/unlisted work with no login)
node index.js 2087352
node index.js https://archidekt.com/decks/2087352/the-public-library

# From a text export file
node index.js --file mydeck.txt

# From the clipboard (macOS pbpaste) — e.g. after "Copy" on Archidekt/Moxfield
node index.js --clipboard

Options

Flag Description
-o, --output <file> Output PDF path (default: derived from the deck/file name)
--size <size> Scryfall image size: small | normal | large | png (default normal)
--include-basics Include basic lands (they are excluded by default)
--single One copy of each card, ignoring deck quantities
--cache-dir <dir> Where to cache images/metadata (default ~/.cache/mtg-export)
-c, --clipboard Read the card list from the clipboard
-h, --help Show help

Text list format

One card per line, in the common Archidekt/Moxfield/MTGA export shape. The set code and collector number are honored when present, so you get the exact printing:

1x Sol Ring (mh1) 213
1 Delver of Secrets (isd) 51        # double-faced: both faces are printed
2 Lightning Bolt (2x2) 117 *F*      # *F* (foil) is accepted and ignored for art
3 Forest                            # basic land — excluded unless --include-basics
Counterspell                        # bare name resolves to a default printing

# ... / // comment lines and section labels (Deck, Sideboard, Commander, …) are ignored. If a collector number doesn't match the named card, it falls back to a name lookup rather than printing the wrong card.

File size (for GitHub)

normal and large are JPEG, which keeps a full ~100-card EDH deck small enough to commit to a repo:

--size Format ≈ per card ≈ 100-card PDF
normal (default) JPEG 488×680 ~90 KB ~9 MB
large JPEG 672×936 ~180 KB ~18 MB
png PNG 745×1040 ~1 MB ~100 MB (too big — local printing only)

Use normal for anything you'll upload; use large for the nicest home prints.

Private Archidekt decks

Public and unlisted decks need no login. For a private deck, provide your Archidekt credentials via environment variables or a .env file (copy .env.example):

ARCHIDEKT_USERNAME=your-username
ARCHIDEKT_PASSWORD=your-password

The tool tries anonymously first and only logs in (JWT) if the deck isn't publicly accessible.

MCP server

The same functionality is exposed as an MCP tool so an agent (Claude Desktop, Claude Code, etc.) can generate proxy sheets.

Run it over stdio:

node mcp.js        # or: npm run mcp   (also installed as the `mtg-export-mcp` bin)

Register it with an MCP client, e.g. Claude Desktop claude_desktop_config.json:

{
  "mcpServers": {
    "mtg-export": {
      "command": "node",
      "args": ["/absolute/path/to/mtg-export/mcp.js"],
      "env": {
        "ARCHIDEKT_USERNAME": "your-username",
        "ARCHIDEKT_PASSWORD": "your-password"
      }
    }
  }
}

(env is only needed for private decks.)

It provides one tool, create_proxy_pdf:

Argument Type Notes
deck string Archidekt deck id or URL. Provide this or cards.
cards string Text card list (one per line). Provide this or deck.
output string Absolute path for the PDF (recommended).
size enum small | normal | large | png (default normal).
include_basics boolean Include basic lands (default false).
single boolean One copy of each card (default false).

It writes the PDF to disk and returns the path plus a summary (cards resolved, basics excluded, pages, size, any unresolved names).

Test with the MCP Inspector

Copy .env.example to .env and fill in your credentials (only needed for private decks):

cp .env.example .env

Run the inspector against the server:

npm run inspect
# equivalently:
npx @modelcontextprotocol/inspector node mcp.js

This opens a local web UI where you can list the tool and call create_proxy_pdf interactively.

How it works

  1. Input → a list of {name, quantity, printing} entries (Archidekt deck, text file, or clipboard).
  2. Resolve → Scryfall. Archidekt entries carry the exact printing's Scryfall id, so images are batch-resolved directly; text entries resolve by set+collector / name+set / name.
  3. Cache → every downloaded image is stored under the cache dir and reused.
  4. Render → pdf-lib lays out a 3×3 grid at true card size with cut guides; double-faced cards contribute a front and a back slot.

Notes

  • Basic lands are excluded by default
  • Deck quantities are printed by default; use --single for one of each.
  • Foil is cosmetic for proxies — the printing is respected but the same art is used.

推荐服务器

Baidu Map

Baidu Map

百度地图核心API现已全面兼容MCP协议,是国内首家兼容MCP协议的地图服务商。

官方
精选
JavaScript
Playwright MCP Server

Playwright MCP Server

一个模型上下文协议服务器,它使大型语言模型能够通过结构化的可访问性快照与网页进行交互,而无需视觉模型或屏幕截图。

官方
精选
TypeScript
Magic Component Platform (MCP)

Magic Component Platform (MCP)

一个由人工智能驱动的工具,可以从自然语言描述生成现代化的用户界面组件,并与流行的集成开发环境(IDE)集成,从而简化用户界面开发流程。

官方
精选
本地
TypeScript
Audiense Insights MCP Server

Audiense Insights MCP Server

通过模型上下文协议启用与 Audiense Insights 账户的交互,从而促进营销洞察和受众数据的提取和分析,包括人口统计信息、行为和影响者互动。

官方
精选
本地
TypeScript
VeyraX

VeyraX

一个单一的 MCP 工具,连接你所有喜爱的工具:Gmail、日历以及其他 40 多个工具。

官方
精选
本地
Kagi MCP Server

Kagi MCP Server

一个 MCP 服务器,集成了 Kagi 搜索功能和 Claude AI,使 Claude 能够在回答需要最新信息的问题时执行实时网络搜索。

官方
精选
Python
graphlit-mcp-server

graphlit-mcp-server

模型上下文协议 (MCP) 服务器实现了 MCP 客户端与 Graphlit 服务之间的集成。 除了网络爬取之外,还可以将任何内容(从 Slack 到 Gmail 再到播客订阅源)导入到 Graphlit 项目中,然后从 MCP 客户端检索相关内容。

官方
精选
TypeScript
e2b-mcp-server

e2b-mcp-server

使用 MCP 通过 e2b 运行代码。

官方
精选
Neon MCP Server

Neon MCP Server

用于与 Neon 管理 API 和数据库交互的 MCP 服务器

官方
精选
Exa MCP Server

Exa MCP Server

模型上下文协议(MCP)服务器允许像 Claude 这样的 AI 助手使用 Exa AI 搜索 API 进行网络搜索。这种设置允许 AI 模型以安全和受控的方式获取实时的网络信息。

官方
精选