DeckCosmos for AI agents and developers
Everything the website does is available to AI assistants and code, free and without a key: card search, synergies with reasons, complete deck building at a chosen power bracket, deck checks, mana simulations, draw odds, combos, buy links and the Comprehensive Rules, for Magic: The Gathering with Commander as the main format. The tools run the same code as the website, on the same weekly-updated data.
AI agent reading this: connect to the MCP server at https://deckcosmos.com/mcp (Streamable HTTP, no auth), or call the REST endpoints below; llms-full.txt has this whole page as plain text.
- MCP server (for Claude, ChatGPT, Cursor, VS Code and other AI apps):
https://deckcosmos.com/mcp
- REST API:
https://deckcosmos.com/api/v1/, described by OpenAPI 3.1
- Static JSON for every card page:
https://deckcosmos.com/api/v1/cards/<slug>.json, plus cards.json and commanders.json
- For language models: llms.txt (summary) and llms-full.txt (every tool, argument and result field)
Connect an AI assistant (MCP)
The server speaks the Model Context Protocol over Streamable HTTP. No sign-in. Add it as a remote server with the URL https://deckcosmos.com/mcp:
Then ask things like “Build me a bracket 3 Chatterfang deck under $200”, “What works with Blood Artist?” or paste a decklist and ask “Check this deck and simulate its mana”.
Ready-made prompts
The server also offers MCP prompts, which some apps show as one-click actions (in Claude Code, type /):
- Build a Commander deck (
build_commander_deck: commander, bracket?, budget?): Build a complete 100-card Commander deck around a commander, explained card by card.
- Deck from an idea (
deck_from_idea: idea, bracket?): Find the right commander for a theme, creature type or color combination and build the deck.
- Review my deck (
review_my_deck: decklist, bracket?): Check a decklist: legality, role balance, mana, bracket, combos, what to cut and what to add.
- What works with this card? (
card_synergies: card, commander_colors_only?): The best cards to pair with a card, each with the reason, plus its combos.
- Rules question (
rules_question: question): Answer a rules question, quoting the Comprehensive Rules.
Discovery
Listed in the official MCP Registry as com.deckcosmos/deckcosmos. Machine-readable descriptions: MCP Server Card (also /.well-known/mcp.json), AI Catalog, API catalog (RFC 9727), OpenAPI 3.1. Every tool declares an output schema, so results can be validated and used by code directly.
REST API
Each tool is an endpoint under /api/v1/. Send GET with query parameters (lists repeated or separated by |), or POST a JSON body with the same arguments; deck lists are easier as POST. Responses are JSON; errors are {"error": "..."} with status 400, and unknown card names come with suggestions.
curl 'https://deckcosmos.com/api/v1/synergies?card=Blood+Artist&limit=5'
curl 'https://deckcosmos.com/api/v1/build?commander=Krenko,+Mob+Boss&bracket=3&budget=150'
curl -X POST https://deckcosmos.com/api/v1/check -H 'Content-Type: application/json' \
-d '{"decklist": "Commander\n1 Krenko, Mob Boss\n\nDeck\n1 Sol Ring\n30 Mountain"}'
Builds and checks return deck_text (paste it into DeckCosmos, Moxfield, Archidekt or Arena), a share_url that opens the deck in the DeckCosmos app and a buy_url that puts the cards in a TCGplayer cart; card results carry a buy_url too.
Limits and fair use
About 30 requests a minute per client; deck builds, checks and simulations count as 4 because each takes a few seconds of computing. Over the limit you get status 429 with Retry-After. Results of identical requests are cached for 15 minutes. For bulk card data, use the static JSON files (or Scryfall for raw card data).
Tools
Search cards · MCP search_cards · REST /api/v1/search
Find cards with a plain-words query, the same as the website's card finder. Words are read as creature types ("rat"), keywords ("deathtouch", "first strike"), card types ("artifact", "legendary"), colors ("black") or rules-text words ("sacrifice", "draw"); e.g. "elf lord", "black rat deathtouch", "artifact sacrifice draw". Optionally filter by role (what the card does, see reference/roles), format, color identity and price. Sorted by popularity unless asked otherwise.
| Argument | Type | Meaning |
|---|
query | string | Plain words, e.g. "goblin haste" or "enchantment draw a card". |
role | string | Only cards with this role key, e.g. sac_outlet, token_payoff, landfall (see reference what=roles). |
sort | string: popularity name mv | Default popularity (most-played first). |
format | string: commander standard pioneer modern legacy vintage pauper any | Format whose legal cards are considered. Default: any. |
colors | string | Only cards within this color identity, e.g. "BG". Empty = any. |
max_price | number | Only cards at or under this USD price. |
limit | integer | Default 20. |
offset | integer | For paging. Default 0. |
Returns
| Field | Type | Meaning |
|---|
query | string | The query as given. |
understood_as | object | How the query words were read: creature_types, keywords, card_types, colors, text. |
role | string or null | Role filter applied. |
format | string | Format filter applied. |
total | integer | Matching cards in all. |
offset | integer | Offset of the first card returned. |
cards | list of {name, mana_cost, type, color_identity, price_usd, mana_value, oracle_text, roles, popularity_rank} | Matching cards. |
Card details · MCP get_card · REST /api/v1/card
Everything DeckCosmos knows about one card: rules text, type, color identity, legality, price, popularity rank, Game Changer status, its roles (what it provides and rewards), whether it can be a commander, and for commanders a build plan (strategy summary, key cards, finishers). Accepts exact names, front-face names of double-faced cards, and close spellings.
| Argument | Type | Meaning |
|---|
name required | string | Card name, e.g. "Krenko, Mob Boss". |
Returns
| Field | Type | Meaning |
|---|
name | string | Card name. |
mana_cost | string | Mana cost. |
mana_value | number | Mana value. |
type | string | Type line. |
oracle_text | string | Rules text (both faces for double-faced cards). |
color_identity | string | Color identity letters in WUBRG order, e.g. "BG"; "" for colorless. |
keywords | list of string | Keyword abilities. |
power | integer or string or null | Power, for creatures. |
legal_in | list of string | Formats it is legal in. |
price_usd | number or null | Approximate price in USD (Scryfall), or null if unknown. |
popularity_rank | integer or null | Rank by how many decks play it (1 = most). |
game_changer | boolean | On the official Commander Game Changers list. |
can_be_commander | boolean | Can be a Commander deck's commander. |
roles | list of string | Role keys: what the card provides and rewards (see reference what=roles). |
image | string or null | Card image URL (Scryfall). |
page_url | string | The card's page on deckcosmos.com. |
app_url | string | The card in the deckcosmos.com synergy map. |
buy_url | string | The card on TCGplayer (product search). |
build_plan | {summary, key_cards, finishers, creatures, lands, tribe} or null | For commanders: the strategy DeckCosmos builds around. |
combos_count | integer | Known combos including the card (see find_combos). |
Synergies for a card · MCP get_synergies · REST /api/v1/synergies
The cards that work best with a given card, ranked, each with the reason it works ("Ashnod's Altar sacrifices creatures on demand; Blood Artist pays off every time a creature dies"). The website's synergy map for one card. Synergies are mechanical (roles that fit together, tribes, keyword payoffs, known combos), weighted by popularity.
| Argument | Type | Meaning |
|---|
card required | string | Card name. |
format | string: commander standard pioneer modern legacy vintage pauper any | Format whose legal cards are considered. Default: commander if the card is legal there, else any. |
limit | integer | Default 20. |
same_colors | boolean | Only cards within the card's color identity (useful for a commander). Default false. |
categories | array | Only these synergy categories (keys from reference what=categories), e.g. ["sacrifice", "tokens"]. |
Returns
| Field | Type | Meaning |
|---|
card | string | The card. |
format | string | Format considered. |
same_colors | boolean | Limited to the card's color identity. |
synergies | list of {name, mana_cost, type, color_identity, price_usd, score, categories, why} | Best partners first. |
app_url | string | This view on deckcosmos.com. |
Synergies within a group of cards · MCP deck_synergies · REST /api/v1/deck-synergies
For a group of cards (a deck idea, a pile of favorites): which pairs work together and why, and the cards that work with several of them at once, the best additions. The website's deck tray view.
| Argument | Type | Meaning |
|---|
cards required | array | Card names. |
format | string: commander standard pioneer modern legacy vintage pauper any | Format whose legal cards are considered. Default: commander. |
limit | integer | Suggestions to return. Default 20. |
same_colors | boolean | Only suggest cards within the group's combined colors. Default false. |
Returns
| Field | Type | Meaning |
|---|
format | string | Format considered. |
cards | list of string | The cards, as recognized. |
pairs_with_synergy | list of {cards, categories, why} | Pairs within the group that work together. |
pairs_without | integer | Pairs with no synergy found. |
suggestions | list of {name, mana_cost, type, color_identity, price_usd, score, works_with, why} | Best additions: cards that work with several of the group. |
app_url | string | This group in the deckcosmos.com deck tray. |
Find combos · MCP find_combos · REST /api/v1/combos
Known combos from Commander Spellbook. With "card": the most-played combos that include it. With "cards" (a deck or a pile): the combos already complete in it, and the ones a single added card would complete. Each combo lists its cards, results (e.g. "Infinite mana"), popularity and a link to its steps.
| Argument | Type | Meaning |
|---|
card | string | One card: its combos. |
cards | array | A list of card names: complete and one-card-away combos. |
commander | string | The commander, for combos that need a specific commander. |
limit | integer | Default 20. |
Returns
| Field | Type | Meaning |
|---|
card | string | With "card": the card. |
total | integer | With "card": its known combos in all. |
combos | list of {cards, results, extra_requirements, commander_must_be, popularity, bracket_tag, url} | With "card": its most-played combos. |
cards | list of string | With "cards": the cards, as recognized. |
commander | string or null | With "cards": the commander. |
complete_combos | list of {cards, results, extra_requirements, commander_must_be, popularity, bracket_tag, url} | With "cards": combos complete in the list. |
one_card_away | list of {add, cards, results, extra_requirements, commander_must_be, popularity, bracket_tag, url} | With "cards": combos one added card would complete (within the colors). |
source | string | Data source. |
Build a deck · MCP build_deck · REST /api/v1/build
Build a complete, legal deck, the same as the website's deck builder. Commander (default): 100 cards around a commander, using its build plan, synergies, a role balance (ramp, draw, removal, wipes, protection), a mana base sized by Frank Karsten's formulas, and a target power bracket (2 core, 3 upgraded, 4 optimized; Game Changers and infinite combos follow the bracket). Three ways to choose: give a commander (or any card to build around), or criteria (theme, creature type, colors) and the best-fitting commander is picked, or nothing for a random popular commander. Also builds 60-card Standard, Pioneer, Modern, Legacy and Pauper decks around a card. Returns the list in sections with a reason per card, the bracket estimate, combos in the deck, warnings, a paste-ready deck_text and a share_url. A build takes a few seconds.
| Argument | Type | Meaning |
|---|
commander | string | The commander (or for 60-card formats, the card to build around). |
card | string | Any card to build around; a fitting commander is chosen if it can't be one. |
mode | string: card criteria random | Usually inferred: card if a commander/card is given, criteria if theme/tribe/colors are, else random. |
theme | string | Criteria builds: a theme, by key or name. Keys: tokens, sacrifice (aristocrats), counters, lifegain, graveyard, spells (spellslinger), artifacts, enchantments, landfall, blink, voltron (equipment & auras), combat, draw, big (big creatures), flying, trample, deathtouch, strike (first/double strike), haste, evasion (menace & unblockable), lifelink, defenders. See reference what=themes. |
tribe | string | Criteria builds: a creature type, e.g. "squirrel". |
colors | string | Criteria builds: color identity letters, e.g. "BG". Empty = any. |
format | string: commander standard pioneer modern legacy pauper | Default commander. |
bracket | integer | Commander power bracket: 2, 3 (default) or 4. |
max_price_per_card | number | Skip cards above this USD price. |
budget | number | Total deck budget in USD; expensive cards are swapped for cheaper options. |
variation | boolean | Add randomness for a different take on the same request. Default false (deterministic). |
Returns
| Field | Type | Meaning |
|---|
format | string | Format built for. |
commander | string or null | The commander (Commander format). |
built_around | list of string | Cards the deck was built around. |
theme | string or null | Theme key, for criteria builds. |
tribe | string or null | Creature type, for criteria builds. |
total_cards | integer | Cards in the deck (100 for Commander, commander included). |
colors | string | Color identity of the deck. |
price_usd | number | Approximate total price in USD. |
bracket | {bracket, reasons} or null | Power-bracket estimate. |
requested_bracket | integer or null | Bracket asked for. |
build_plan | string or null | The commander's strategy the build followed. |
land_count_note | string | How the land count was chosen. |
warnings | list of string | Problems the builder could not solve (e.g. budget not reachable). |
combos | list of {cards, results, extra_requirements, commander_must_be, popularity, bracket_tag, url} | Combos complete in the deck. |
sections | list of {name, cards} | The deck by section. |
deck_text | string | The whole list as plain text ("1 Card Name" lines with a Commander header), ready to show, paste into deck sites or pass to check_deck. |
share_url | string | Opens this deck on deckcosmos.com. |
buy_url | string | A TCGplayer cart with the deck's cards (basic lands left out). |
note | string | How to use the result. |
Check a deck · MCP check_deck · REST /api/v1/check
Analyze an existing deck, the same as the website's "Check a deck": legality (size, singleton, color identity), counts of ramp, card draw, removal, board wipes and protection against typical ranges, color sources per color vs. what the most demanding card needs, mana curve, bracket estimate with reasons (Game Changers, combos), complete and one-card-away combos, the commander's build-plan key cards it has and lacks, the cards least connected to the deck (cut candidates) and upgrade ideas. Takes a few seconds.
| Argument | Type | Meaning |
|---|
decklist | string | The deck as text: one "1 Card Name" per line. Moxfield, Archidekt and Arena exports, .dek XML and CSV work; a "Commander" header line (or *CMDR*) marks the commander. |
cards | array | Alternative to decklist: [{"name": "Sol Ring", "qty": 1}, ...] or plain names. |
commander | string | Commander name, if the list does not mark it. Otherwise it is detected like on the website. |
bracket | integer | Bracket to aim upgrade ideas at. Default: the deck's estimated bracket. |
Returns
| Field | Type | Meaning |
|---|
commander | string or null | The commander, as detected or given. |
total_cards | integer | Cards in the deck. |
average_mana_value | number | Average mana value of nonland cards. |
unrecognized | list of string | Lines that matched no card. |
legality_problems | list of string | Size, singleton, color identity and legality problems. |
role_counts | list of {role, count, ok, status, typical} | Role balance against typical ranges. |
color_sources | list of {color, sources, wanted, wanted_for, ok} | Mana sources per color. |
mana_curve | object | Nonland cards by mana value: keys "0" to "6" and "7+". |
bracket | {bracket, reasons} or null | Power-bracket estimate. |
combos | list of {cards, results, extra_requirements, commander_must_be, popularity, bracket_tag, url} | Combos complete in the deck. |
one_card_from_combo | list of {add, cards, results, extra_requirements, commander_must_be, popularity, bracket_tag, url} | Combos one added card would complete. |
build_plan | string or null | The commander's build plan. |
plan_key_cards | {have, missing, total} or null | The build plan's key cards. |
consider_cutting | list of string | Cards least connected to the rest of the deck. |
upgrade_ideas | list of {name, why} | Additions that fit the deck and bracket. |
share_url | string | Opens the deck on deckcosmos.com. |
buy_url | string | A TCGplayer cart with the deck's cards (basic lands left out). |
Simulate a deck's mana · MCP simulate_deck · REST /api/v1/simulate
Monte Carlo consistency test, the same as the website's playtest simulator: plays the deck alone thousands of times and reports mulligan, mana screw and flood rates, lands and mana by turn, when the commander gets cast, how often a build-plan key card is drawn by turn 4, and how much mana gets used.
| Argument | Type | Meaning |
|---|
decklist | string | The deck as text: one "1 Card Name" per line. Moxfield, Archidekt and Arena exports, .dek XML and CSV work; a "Commander" header line (or *CMDR*) marks the commander. |
cards | array | Alternative to decklist: [{"name": "Sol Ring", "qty": 1}, ...] or plain names. |
commander | string | Commander name, if the list does not mark it. Otherwise it is detected like on the website. |
games | integer | Default 3000. |
on_play | boolean | On the play (default) or the draw. |
Returns
| Field | Type | Meaning |
|---|
cards | integer | Cards in the deck. |
games | integer | Games simulated. |
on_the_play | boolean | On the play (else on the draw). |
commander | string or null | The commander. |
unrecognized | list of string | Lines that matched no card. |
mulligan_percent | number | Opening hands mulliganed (too few or too many lands), %. |
mana_screw_percent | number | Games stuck on lands, %. |
flood_percent | number | Games drawing too many lands, %. |
key_card_by_turn_4_percent | number or null | Games with a build-plan key card in hand by turn 4, %. |
mana_used_percent | number | Share of available mana spent, %. |
by_turn | list of {turn, lands, mana, commander_cast_percent} | Averages by turn. |
method | string | How the simulation plays. |
Draw odds · MCP draw_odds · REST /api/v1/odds
Exact (hypergeometric) chance of drawing at least N of something by a given turn, with the table for turns 1-10, the same as the website's odds calculator. Target: "lands", "role:<role key>" (e.g. role:land_ramp) or a card name.
| Argument | Type | Meaning |
|---|
decklist | string | The deck as text: one "1 Card Name" per line. Moxfield, Archidekt and Arena exports, .dek XML and CSV work; a "Commander" header line (or *CMDR*) marks the commander. |
cards | array | Alternative to decklist: [{"name": "Sol Ring", "qty": 1}, ...] or plain names. |
commander | string | Commander name, if the list does not mark it. Otherwise it is detected like on the website. |
target | string | "lands", "role:<key>" or a card name. Default lands. |
at_least | integer | Default 1. |
turn | integer | Default 3. |
on_play | boolean | Default true. |
Returns
| Field | Type | Meaning |
|---|
target | string | What was counted. |
copies_in_library | integer | Copies of the target in the library. |
library_size | integer | Library size. |
at_least | integer | How many needed. |
on_the_play | boolean | On the play (no draw on turn 1). |
turn | integer | Turn asked about. |
percent | number | Chance by that turn, %. |
by_turn | list of {turn, cards_seen, percent} | Turns 1-10. |
method | string | How it was calculated. |
Sample opening hand · MCP sample_hand · REST /api/v1/hand
Shuffle the deck and draw a random 7-card opening hand (the commander stays in the command zone), plus optionally the next draws.
| Argument | Type | Meaning |
|---|
decklist | string | The deck as text: one "1 Card Name" per line. Moxfield, Archidekt and Arena exports, .dek XML and CSV work; a "Commander" header line (or *CMDR*) marks the commander. |
cards | array | Alternative to decklist: [{"name": "Sol Ring", "qty": 1}, ...] or plain names. |
commander | string | Commander name, if the list does not mark it. Otherwise it is detected like on the website. |
draws | integer | Also show the next N draws. Default 0. |
Returns
| Field | Type | Meaning |
|---|
commander | string or null | The commander (in the command zone, not the hand). |
hand | list of {name, mana_cost, type} | Seven cards. |
lands_in_hand | integer | Lands in the hand. |
next_draws | list of string | The next draws, if asked. |
Comprehensive Rules lookup · MCP lookup_rules · REST /api/v1/rules
Look up the official Comprehensive Rules: by number ("702.19" trample, with its subrules and examples; "702" lists the keyword abilities) or by term ("deathtouch", "dies", "state-based actions"), including the glossary.
| Argument | Type | Meaning |
|---|
rule | string | A rule number, e.g. "702.19", "702.19b", "702", "7". |
query | string | A term or keyword, e.g. "trample", "commander tax", "dies". |
Returns
| Field | Type | Meaning |
|---|
effective | string | Date of the Comprehensive Rules used. |
source | string | Where the rules come from. |
rule | string | With "rule": the rule number. |
text | string | With "rule": its text. |
examples | list of string | With "rule": its examples. |
subrules | list of {rule, text, examples} | With "rule": its subrules. |
children | list of {rule, title} | With a section number (e.g. "702"): the rules in it. |
query | string | With "query": the term. |
results | list of {term, glossary, rule, text, subrules, examples} | With "query": matching glossary entries and rules. |
Reference lists · MCP reference · REST /api/v1/reference
The keys other tools accept: deck-builder themes, formats, card roles (for search_cards and draw_odds), synergy categories (for get_synergies) and power brackets.
| Argument | Type | Meaning |
|---|
what | string: themes formats roles categories brackets | Omit for all of them. |
Returns
| Field | Type | Meaning |
|---|
themes | list of {key, label, group} | Deck-builder themes. |
formats | list of {name, label, deck_builder} | Formats. |
roles | list of {key, label, category, searchable} | Card roles. |
categories | list of {key, label} | Synergy categories (get_synergies categories). |
brackets | list of {bracket, label, rules} | Commander power brackets. |
Data and credits
Card data and images: Scryfall. Combos: Commander Spellbook. Rules: Wizards of the Coast Comprehensive Rules. Prices are approximate (USD). Build plans and card roles come from an AI pass over every card's rules text, checked against the text. DeckCosmos is unofficial Fan Content permitted under the Fan Content Policy, not approved or endorsed by Wizards.