DeckCosmos

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.

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 /):

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.

ArgumentTypeMeaning
querystringPlain words, e.g. "goblin haste" or "enchantment draw a card".
rolestringOnly cards with this role key, e.g. sac_outlet, token_payoff, landfall (see reference what=roles).
sortstring: popularity name mvDefault popularity (most-played first).
formatstring: commander standard pioneer modern legacy vintage pauper anyFormat whose legal cards are considered. Default: any.
colorsstringOnly cards within this color identity, e.g. "BG". Empty = any.
max_pricenumberOnly cards at or under this USD price.
limitintegerDefault 20.
offsetintegerFor paging. Default 0.
Returns
FieldTypeMeaning
querystringThe query as given.
understood_asobjectHow the query words were read: creature_types, keywords, card_types, colors, text.
rolestring or nullRole filter applied.
formatstringFormat filter applied.
totalintegerMatching cards in all.
offsetintegerOffset of the first card returned.
cardslist 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.

ArgumentTypeMeaning
name requiredstringCard name, e.g. "Krenko, Mob Boss".
Returns
FieldTypeMeaning
namestringCard name.
mana_coststringMana cost.
mana_valuenumberMana value.
typestringType line.
oracle_textstringRules text (both faces for double-faced cards).
color_identitystringColor identity letters in WUBRG order, e.g. "BG"; "" for colorless.
keywordslist of stringKeyword abilities.
powerinteger or string or nullPower, for creatures.
legal_inlist of stringFormats it is legal in.
price_usdnumber or nullApproximate price in USD (Scryfall), or null if unknown.
popularity_rankinteger or nullRank by how many decks play it (1 = most).
game_changerbooleanOn the official Commander Game Changers list.
can_be_commanderbooleanCan be a Commander deck's commander.
roleslist of stringRole keys: what the card provides and rewards (see reference what=roles).
imagestring or nullCard image URL (Scryfall).
page_urlstringThe card's page on deckcosmos.com.
app_urlstringThe card in the deckcosmos.com synergy map.
buy_urlstringThe card on TCGplayer (product search).
build_plan{summary, key_cards, finishers, creatures, lands, tribe} or nullFor commanders: the strategy DeckCosmos builds around.
combos_countintegerKnown 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.

ArgumentTypeMeaning
card requiredstringCard name.
formatstring: commander standard pioneer modern legacy vintage pauper anyFormat whose legal cards are considered. Default: commander if the card is legal there, else any.
limitintegerDefault 20.
same_colorsbooleanOnly cards within the card's color identity (useful for a commander). Default false.
categoriesarrayOnly these synergy categories (keys from reference what=categories), e.g. ["sacrifice", "tokens"].
Returns
FieldTypeMeaning
cardstringThe card.
formatstringFormat considered.
same_colorsbooleanLimited to the card's color identity.
synergieslist of {name, mana_cost, type, color_identity, price_usd, score, categories, why}Best partners first.
app_urlstringThis 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.

ArgumentTypeMeaning
cards requiredarrayCard names.
formatstring: commander standard pioneer modern legacy vintage pauper anyFormat whose legal cards are considered. Default: commander.
limitintegerSuggestions to return. Default 20.
same_colorsbooleanOnly suggest cards within the group's combined colors. Default false.
Returns
FieldTypeMeaning
formatstringFormat considered.
cardslist of stringThe cards, as recognized.
pairs_with_synergylist of {cards, categories, why}Pairs within the group that work together.
pairs_withoutintegerPairs with no synergy found.
suggestionslist of {name, mana_cost, type, color_identity, price_usd, score, works_with, why}Best additions: cards that work with several of the group.
app_urlstringThis 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.

ArgumentTypeMeaning
cardstringOne card: its combos.
cardsarrayA list of card names: complete and one-card-away combos.
commanderstringThe commander, for combos that need a specific commander.
limitintegerDefault 20.
Returns
FieldTypeMeaning
cardstringWith "card": the card.
totalintegerWith "card": its known combos in all.
comboslist of {cards, results, extra_requirements, commander_must_be, popularity, bracket_tag, url}With "card": its most-played combos.
cardslist of stringWith "cards": the cards, as recognized.
commanderstring or nullWith "cards": the commander.
complete_comboslist of {cards, results, extra_requirements, commander_must_be, popularity, bracket_tag, url}With "cards": combos complete in the list.
one_card_awaylist of {add, cards, results, extra_requirements, commander_must_be, popularity, bracket_tag, url}With "cards": combos one added card would complete (within the colors).
sourcestringData 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.

ArgumentTypeMeaning
commanderstringThe commander (or for 60-card formats, the card to build around).
cardstringAny card to build around; a fitting commander is chosen if it can't be one.
modestring: card criteria randomUsually inferred: card if a commander/card is given, criteria if theme/tribe/colors are, else random.
themestringCriteria 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.
tribestringCriteria builds: a creature type, e.g. "squirrel".
colorsstringCriteria builds: color identity letters, e.g. "BG". Empty = any.
formatstring: commander standard pioneer modern legacy pauperDefault commander.
bracketintegerCommander power bracket: 2, 3 (default) or 4.
max_price_per_cardnumberSkip cards above this USD price.
budgetnumberTotal deck budget in USD; expensive cards are swapped for cheaper options.
variationbooleanAdd randomness for a different take on the same request. Default false (deterministic).
Returns
FieldTypeMeaning
formatstringFormat built for.
commanderstring or nullThe commander (Commander format).
built_aroundlist of stringCards the deck was built around.
themestring or nullTheme key, for criteria builds.
tribestring or nullCreature type, for criteria builds.
total_cardsintegerCards in the deck (100 for Commander, commander included).
colorsstringColor identity of the deck.
price_usdnumberApproximate total price in USD.
bracket{bracket, reasons} or nullPower-bracket estimate.
requested_bracketinteger or nullBracket asked for.
build_planstring or nullThe commander's strategy the build followed.
land_count_notestringHow the land count was chosen.
warningslist of stringProblems the builder could not solve (e.g. budget not reachable).
comboslist of {cards, results, extra_requirements, commander_must_be, popularity, bracket_tag, url}Combos complete in the deck.
sectionslist of {name, cards}The deck by section.
deck_textstringThe 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_urlstringOpens this deck on deckcosmos.com.
buy_urlstringA TCGplayer cart with the deck's cards (basic lands left out).
notestringHow 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.

ArgumentTypeMeaning
deckliststringThe 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.
cardsarrayAlternative to decklist: [{"name": "Sol Ring", "qty": 1}, ...] or plain names.
commanderstringCommander name, if the list does not mark it. Otherwise it is detected like on the website.
bracketintegerBracket to aim upgrade ideas at. Default: the deck's estimated bracket.
Returns
FieldTypeMeaning
commanderstring or nullThe commander, as detected or given.
total_cardsintegerCards in the deck.
average_mana_valuenumberAverage mana value of nonland cards.
unrecognizedlist of stringLines that matched no card.
legality_problemslist of stringSize, singleton, color identity and legality problems.
role_countslist of {role, count, ok, status, typical}Role balance against typical ranges.
color_sourceslist of {color, sources, wanted, wanted_for, ok}Mana sources per color.
mana_curveobjectNonland cards by mana value: keys "0" to "6" and "7+".
bracket{bracket, reasons} or nullPower-bracket estimate.
comboslist of {cards, results, extra_requirements, commander_must_be, popularity, bracket_tag, url}Combos complete in the deck.
one_card_from_combolist of {add, cards, results, extra_requirements, commander_must_be, popularity, bracket_tag, url}Combos one added card would complete.
build_planstring or nullThe commander's build plan.
plan_key_cards{have, missing, total} or nullThe build plan's key cards.
consider_cuttinglist of stringCards least connected to the rest of the deck.
upgrade_ideaslist of {name, why}Additions that fit the deck and bracket.
share_urlstringOpens the deck on deckcosmos.com.
buy_urlstringA 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.

ArgumentTypeMeaning
deckliststringThe 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.
cardsarrayAlternative to decklist: [{"name": "Sol Ring", "qty": 1}, ...] or plain names.
commanderstringCommander name, if the list does not mark it. Otherwise it is detected like on the website.
gamesintegerDefault 3000.
on_playbooleanOn the play (default) or the draw.
Returns
FieldTypeMeaning
cardsintegerCards in the deck.
gamesintegerGames simulated.
on_the_playbooleanOn the play (else on the draw).
commanderstring or nullThe commander.
unrecognizedlist of stringLines that matched no card.
mulligan_percentnumberOpening hands mulliganed (too few or too many lands), %.
mana_screw_percentnumberGames stuck on lands, %.
flood_percentnumberGames drawing too many lands, %.
key_card_by_turn_4_percentnumber or nullGames with a build-plan key card in hand by turn 4, %.
mana_used_percentnumberShare of available mana spent, %.
by_turnlist of {turn, lands, mana, commander_cast_percent}Averages by turn.
methodstringHow 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.

ArgumentTypeMeaning
deckliststringThe 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.
cardsarrayAlternative to decklist: [{"name": "Sol Ring", "qty": 1}, ...] or plain names.
commanderstringCommander name, if the list does not mark it. Otherwise it is detected like on the website.
targetstring"lands", "role:<key>" or a card name. Default lands.
at_leastintegerDefault 1.
turnintegerDefault 3.
on_playbooleanDefault true.
Returns
FieldTypeMeaning
targetstringWhat was counted.
copies_in_libraryintegerCopies of the target in the library.
library_sizeintegerLibrary size.
at_leastintegerHow many needed.
on_the_playbooleanOn the play (no draw on turn 1).
turnintegerTurn asked about.
percentnumberChance by that turn, %.
by_turnlist of {turn, cards_seen, percent}Turns 1-10.
methodstringHow 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.

ArgumentTypeMeaning
deckliststringThe 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.
cardsarrayAlternative to decklist: [{"name": "Sol Ring", "qty": 1}, ...] or plain names.
commanderstringCommander name, if the list does not mark it. Otherwise it is detected like on the website.
drawsintegerAlso show the next N draws. Default 0.
Returns
FieldTypeMeaning
commanderstring or nullThe commander (in the command zone, not the hand).
handlist of {name, mana_cost, type}Seven cards.
lands_in_handintegerLands in the hand.
next_drawslist of stringThe 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.

ArgumentTypeMeaning
rulestringA rule number, e.g. "702.19", "702.19b", "702", "7".
querystringA term or keyword, e.g. "trample", "commander tax", "dies".
Returns
FieldTypeMeaning
effectivestringDate of the Comprehensive Rules used.
sourcestringWhere the rules come from.
rulestringWith "rule": the rule number.
textstringWith "rule": its text.
exampleslist of stringWith "rule": its examples.
subruleslist of {rule, text, examples}With "rule": its subrules.
childrenlist of {rule, title}With a section number (e.g. "702"): the rules in it.
querystringWith "query": the term.
resultslist 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.

ArgumentTypeMeaning
whatstring: themes formats roles categories bracketsOmit for all of them.
Returns
FieldTypeMeaning
themeslist of {key, label, group}Deck-builder themes.
formatslist of {name, label, deck_builder}Formats.
roleslist of {key, label, category, searchable}Card roles.
categorieslist of {key, label}Synergy categories (get_synergies categories).
bracketslist 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.