forge-mcp-server

v0.6.1
@olaservo/forge-mcp-server Checked 14 hours ago Published 3 days ago

MCP server that lets an agent take a seat in a Forge (Card-Forge) network draft or match through a headless Forge client.

These tools were reported by the server itself during our smoke test (tools/list), not copied from the README.

forge_status Forge status

Everything about this seat in one call: bridge connection to the Forge host, lobby slots and event, draft progress (whether a pick is pending), game summary (prompt, buttons, pending decision) and recent chat. `events` has the prefix of this process's event ids (`source`) and whether it serves them over HTTP (`http`) and at which address (`url`). Call this first, and after forge_wait.

forge_connect Join a Forge host

Connect this seat to a Forge host's online lobby (the host clicks Host in Forge's Online Multiplayer screen; default port 36743). Takes an open lobby slot under the given display name.

ParameterTypeDescription
hoststringHostname or IP of the Forge host
namestringDisplay name shown to the other players
portinteger

forge_disconnect Leave the Forge host

Drop the connection to the host. The seat is lost; the host may replace it with an AI.

forge_lobby_ready Set lobby ready

Toggle the Ready flag on our lobby slot. Before a draft or sealed event starts, ready up with no deck. For the match after it, build the deck with forge_draft_deck first: its answer says whether you are ready.

ParameterTypeDescription
readyboolean

forge_lobby_name Set lobby name

Rename our seat in the lobby. Use it when the seat was taken for you under a placeholder name (auto-join) and you want the other players to see your own. Works in the lobby, before the game starts.

ParameterTypeDescription
name *string

forge_lobby_avatars Show lobby avatars

A picture of the avatars a seat can use, 30 per page, each with its index underneath. Look before choosing one with forge_lobby_avatar. Read from Forge's default skin on this machine.

ParameterTypeDescription
pageinteger

forge_lobby_avatar Set lobby avatar

Choose the avatar picture for our lobby slot by its index. forge_lobby_avatars shows the pictures and their indices. Without this the seat uses the avatar from the Forge preferences on the bridge's machine, which matches the host's when both run there.

ParameterTypeDescription
index *integer

forge_lobby_deck Set lobby deck

Choose the deck for our lobby slot. After a draft or sealed event, build the deck with forge_draft_deck instead. `id` picks any deck listed by forge_decks. `name` picks a deck by its name when one deck has it; `dck` submits deck-file text ([metadata]/[Main]/[Sideboard] sections). The answer describes the deck once: `cards` has each card of the main deck with its count, cost, type, power and toughness and rules text. Read it before you ready, since the game does not send these cards' text again.

ParameterTypeDescription
dckstring
idstringA deck id from forge_decks
namestring

forge_decks List decks

The decks this seat can use, read from Forge's deck folders on the server's machine: your own decks, net decks, draft pools, and the preconstructed and quest decks that ship with Forge. `folders` counts every folder, and is left out once you narrow the list. Narrow `decks` with `folder`, `query` (words from the deck name, its path or its commander) and `colors` (the exact colours, such as `WU`; empty for colourless). Net decks are listed only with `folder: "net"`, where `query` matches the category and file name. Give a deck's `id` to forge_lobby_deck to play it. Pass `id` here to read that on…

ParameterTypeDescription
colorsstring
dckbooleanWith id: include the deck file's text
folderstring
idstringRead this one deck instead of listing
limitinteger
offsetinteger
querystring

forge_deck_save Save a deck

Save a deck into Forge's deck folders. Give a deck page `url` (Moxfield, Archidekt, AetherHub, EDHREC, MTGTop8, MTGDecks, Cube Cobra) or the deck as `text`: Forge .dck text, a plain list (`4 Lightning Bolt`, with or without Arena or Magic Online set codes and Sideboard or Commander headings), or a Magic Online .dek file. Card names are checked against the cards Forge implements and rewritten to Forge's spelling. A deck with unknown cards is not saved unless `allowUnknown`. The folder follows from the deck: commander, brawl, oathbreaker, tiny_leaders, cube, network-events for a pool with event…

ParameterTypeDescription
allowUnknownboolean
dryRunboolean
folderstringOverrides the folder chosen from the deck
formatstringcommander, brawl, oathbreaker, tiny leaders, cube, or a constructed format
namestringDeck name. Required for text that carries none.
overwriteboolean
subfolderstringFolder under it, such as Modern, or a net deck category
textstring
urlstring

forge_name_ideas Suggest fantasy names

A few generated fantasy names to choose a seat name from, fetched from donjon's name generator (donjon.bin.sh). Pick one that suits your character or deck and set it with forge_lobby_name. Call it once per naming; if it fails, make up a name. `type` is the kind of name: Wizard, Human Male, Human Female, Elvish Male, Elvish Female, Dwarvish Male, Dwarvish Female, Halfling Male, Halfling Female, Draconic Male, Draconic Female, Drow Male, Drow Female, Orcish Male, Orcish Female, Norse Male, Norse Female, Celtic Male, Celtic Female, Greek Male, Greek Female, Roman Male, Roman Female, Egyptian Male…

ParameterTypeDescription
countinteger
typestring

forge_host Host a Forge lobby

Start a Forge host with no window on this machine, for a match with no desktop host. The host has no seat of its own: every slot is open, and it starts the match once every slot is taken and each seat is ready with a legal deck. Take your own seat with forge_connect at 127.0.0.1 and the port, and set its deck and avatar before forge_lobby_ready: the match starts 3 seconds after the last seat is ready. Other players join from a Forge client at one of `addresses` and the port. A match is one game, or the best of 3 or 5 with `games`. `ai` gives that many of the seats to Forge's AI, which needs no…

ParameterTypeDescription
aiintegerSeats played by Forge's AI, fewer than `seats`. Not in a Limited lobby. Needs forge-agent-bridge 0.1.11
aiDecksarrayA deck id from forge_decks for each AI seat, in order. An AI seat with none plays a precon picked at random
copilotstringThe lobby name of a seat to watch for forge_copilot_view, a human player you advise. Needs forge-agent-bridge 0.1.11
gamesnumberGames per match: 1, or the best of 3 or 5, which needs forge-agent-bridge 0.1.11
limitedbooleanLimited lobby, for 40-card decks
portintegerForge's default is 36743, which a Forge client offers when joining
seatsintegerNumber of players, your own seat and the AI seats included

forge_copilot_view See what the watched seat sees

What the player in the seat named by forge_host's `copilot` is shown now: the prompt, the buttons, the hand, the stack, the selection, an open dialog, both battlefields, and rules text once per card name. It holds what that player may see and nothing of the other player's hidden cards. It is refused while this server holds a seat on that host. It only reads: this tool and this server have no way to act for the watched seat. With `since` set to a `revision` you have read, it waits up to `timeout` seconds for the view to change and says `unchanged` when it did not.

ParameterTypeDescription
sinceintegerA `revision` already read: wait until the view differs from it
timeoutnumberWith `since`, the longest wait in seconds

forge_host_stop Stop hosting

Stop the host started by forge_host. Every player in its lobby or match is dropped.

forge_chat Send lobby chat

Say something in the lobby/game chat. Use it to greet, to explain a play when coaching, or to concede politely.

ParameterTypeDescription
text *string

forge_draft_pack Current draft pack

The pack in front of us. A forge.your_move event of kind draft_pick and a forge_draft_pick answer carry the same, so call this only when you have neither. `packNumber` and `pickNumber` count from 1, and `at` names the pack: pass it to forge_draft_pick. `secondsLeft` is the pick clock when the host set one. `queued` is the host's last count of packs waiting for you behind this one, when there are any: other seats are waiting on your picks. It can be a pack off. `pack` has each card's name, mana cost, type, `pt` and its `rarity` unless Common. Rules text is in `cardText` under the card's name, a…

ParameterTypeDescription
allTextbooleanRules text for every card in the pack, also the ones sent before
fullbooleanThe bridge's own answer, every field with the text on each card

forge_draft_pick Draft pick

Pick a card from the current pack by exact name (or its 0-based index in the pack). `picked` confirms the card. `at` is the `at` of the pack you chose from, and it is needed: a pick that names no pack is not sent. If the pack you name is no longer the one waiting, because the clock ran out and the host picked for you, nothing is sent either. Both answer `stale: true` with no `picked` and what is waiting now: the pack with its `at`, or `waiting: true` when the next pack has not come, in which case you are told when it arrives. `weakCheck: true` means the bridge is older than 0.1.11 and does not…

ParameterTypeDescription
card *string
atstringThe `at` of the pack this pick is from, such as "2:7". Without it nothing is picked

forge_draft_pool Drafted pool

The card pool delivered when the draft ended or the sealed event started. A forge.your_move event of kind deck carries the same, so call this only when you do not have it. `cards` has one entry per card name with its `count`, mana cost, type, `pt` and its `rarity` unless Common, sorted by colour and then cost. `counts` counts the pool by colour, creatures and other spells, lands, and the mana values of the spells in `curve`. Rules text is in `cardText`, and only for names not sent you during the draft. `allText: true` sends every name's text. `full: true` returns the bridge's own answer: one e…

ParameterTypeDescription
allTextbooleanRules text for every card name, also the ones sent before
fullbooleanThe bridge's own answer, one entry per copy with its text

forge_draft_deck Build the deck from the pool

Build the deck for the Limited match from the delivered pool and set it on our lobby slot. `main` names the pool cards to play, one entry per copy. `lands` adds basic lands, which are free in Limited. The rest of the pool becomes the sideboard, and the deck keeps the pool's name and event tags. A card that is not in the pool is an error, and no deck is set. `problem` is null when the deck is legal, which needs at least 40 cards in `size`. With a `problem` the deck is still set on the slot: call this again with a legal deck before the match. Call it again also to change the deck. `ready` is you…

ParameterTypeDescription
main *arrayPool card names, repeated for each copy played
landSetstringSet code for the basic lands. Default: the set most of the pool comes from
landsobjectBasic lands to add, for example {"Swamp": 9, "Mountain": 8}

forge_game_state Game state

Full view of the current game: turn, phase, active player, each player's life and zones (our hand, both battlefields, graveyards), the stack, combat, the current prompt text, the OK/Cancel buttons, and any pending decision that must be answered with forge_game_decide. `selection` lists the cards and `players` the prompt offers, including cards in a zone the state does not show, such as the library during a search, and what is `chosen` so far. `actionable`, when the bridge reports it, lists the cards the host marks as able to act now: playable cards with priority, creatures that can attack or b…

ParameterTypeDescription
allTextbooleanRules text for every card name, also the ones sent before
fullbooleanEvery card field, with the rules text on each card

forge_game_log Game log

Game log lines starting at index `since` (0 for all).

ParameterTypeDescription
sinceinteger

forge_game_act Game action

One click in the match UI. `ok` and `cancel` press the two prompt buttons (OK passes priority or confirms; Cancel declines). `selectCard` with a card `id` plays, activates, taps or targets that card, as the prompt allows. `pay: "auto"` lets Forge pay the cost, and `pass: true` then passes priority so the spell resolves: `{action: "selectCard", id, pay: "auto", pass: true}` casts a spell that needs no target in one call. `ok` with your own spell or ability on top of the stack, and nothing of an opponent's under it, passes until the stack is empty, so your own spells and triggers resolve without…

ParameterTypeDescription
action *string
atintegerThe promptCount this action answers
colorintegerMana color bits for useMana
endTurnbooleanWith ok or a cast: also pass until the end of the turn
idintegerCard, player or stack entry id for selectCard / selectPlayer / selectStack
inarrayWith continue: sideboard cards to bring into the main deck, by name, one entry per copy
oncebooleanWith ok: pass priority one time only
outarrayWith continue: main deck cards to move to the sideboard, by name, one entry per copy
passbooleanAfterwards, pass priority if the action put your own spell or ability on top of the stack
paystringPress Auto if the action leads to the prompt that pays a cost

forge_game_decide Answer a decision

Answer the `pendingDecision` (a choice dialog: which cards to discard, a mode, yes/no, an ordering, a number or text). `choices` are 0-based indices into the decision's options, between its min and max in count; for `order` kinds give all indices in the desired order. `text` answers text or number prompts. A number can also come as kind `choices` with the numbers as options and "Other...", which leads to a number prompt. For kind `assign`, which splits combat damage or a divided amount, give one number per option in `amounts`, adding up to the decision's `amount`. Returns what forge_game_act r…

ParameterTypeDescription
id *integerThe pendingDecision.id
amountsarrayFor kind assign: the amount for each option, in option order
choicesarray
textstring

forge_game_stops Where the seat is asked

The steps where the host asks this seat while the stack is empty: `own` on its own turn, `opponent` on an opponent's. A player sets these on Forge's desktop by clicking a phase. Without arguments it returns them and changes nothing. A list replaces the whole set for that turn, so start from the lists it returns. The defaults are Forge's: own MAIN1, COMBAT_DECLARE_BLOCKERS, MAIN2, and opponent COMBAT_BEGIN, COMBAT_DECLARE_ATTACKERS, COMBAT_DECLARE_BLOCKERS, END_OF_TURN. Leave them unless your deck gives you a reason. Add a step when a card of yours has to be used there, such as your own UPKEEP…

ParameterTypeDescription
opponentarrayEvery step of an opponent's turn where you are asked on an empty stack
ownarrayEvery step of your own turn where you are asked on an empty stack

forge_wait Wait for a change

Block until the seat is asked something (a pick, a prompt, a decision, the lobby before it is ready, the end of a game), another player chats, or `timeout` seconds pass, then return the same payload as forge_status. A change that asks nothing of the seat, such as the opponent holding priority, does not return. Pass the `revision` from the last status so only newer changes wake it. For a client with no event subscription. A seat woken by forge.your_move events ends its turn, and this is refused while a client has a stream of them open.

ParameterTypeDescription
sinceintegerLast seen revision; -1 returns immediately
timeoutinteger