BUILD

mtgunited-mcp

The MCP server behind Magicians United, so an AI agent can search a member's cards and, when the member allows it, manage their decks.

STACK
PHP · MCP · JSON-RPC 2.0
HOW IT'S BUILT
FROM THE README

What's under it.

  1. The production file

    The repo's server is the file mtgunited.com runs, unchanged except for what it loads. A stand-in store reads a sample collection, so it runs with nothing but PHP.

  2. Access per token

    One token per member, read-only by default. Turning on "Manage decks" adds five deck tools, and tools/list shows only what the token may do, so an agent is never offered an action it would be refused.

  3. Errors an agent can act on

    A refused or bad call comes back as a tool result in plain words, not a transport error, so the agent can put it to the person.

  4. Streamable HTTP

    MCP over HTTP with JSON-RPC 2.0, stateless, with batches. It answers protocol versions 2025-06-18, 2025-03-26 and 2024-11-05.

INTERACTIVE DEMOMAGICIANS UNITED
Send the server's real calls and read its answers, computed in your browser from the repo's sample member.
MCP · STREAMABLE HTTP · JSON-RPC 2.0
Demo Member's cards
REQUEST · POST /mcp · Authorization: Bearer mu_…
{
  "jsonrpc": "2.0",
  "id": 1,
  "method": "tools/call",
  "params": {
    "name": "search_my_cards",
    "arguments": {
      "query": "artifact"
    }
  }
}
RESPONSE · 200
{
  "jsonrpc": "2.0",
  "id": 1,
  "result": {
    "content": [
      {
        "type": "text",
        "text": "(the same JSON as structuredContent, pretty-printed)"
      }
    ],
    "structuredContent": {
      "count": 3,
      "total": 3,
      "rows": [
        {
          "card_id": "fff440c0-7e6a-46c2-9989-f1b5af20fd44",
          "finish": "nonfoil",
          "qty": 2,
          "note": "",
          "for_trade": false,
          "ask_cents": null,
          "binder": "",
          "binder_type": "binder",
          "condition": "near_mint",
          "language": "en",
          "paid_cents": null,
          "updated_at": 1762905600,
          "category": "",
          "card": {
            "id": "fff440c0-7e6a-46c2-9989-f1b5af20fd44",
            "name": "Sol Ring",
            "set": "blc",
            "set_name": "Bloomburrow Commander",
            "collector_number": "129",
            "rarity": "uncommon",
            "mana_cost": "{1}",
            "cmc": 1,
            "type_line": "Artifact",
            "oracle_text": "{T}: Add {C}{C}.",
            "colors": [],
            "color_identity": [],
            "price_usd": "2.29"
          }
        },
        {
          "card_id": "28180667-cc1e-4f64-9a69-00425ef85ba0",
          "finish": "nonfoil",
          "qty": 3,
          "note": "",
          "for_trade": false,
          "ask_cents": null,
          "binder": "",
          "binder_type": "binder",
          "condition": "near_mint",
          "language": "en",
          "paid_cents": null,
          "updated_at": 1762905600,
          "category": "",
          "card": {
            "id": "28180667-cc1e-4f64-9a69-00425ef85ba0",
            "name": "Arcane Signet",
            "set": "blc",
            "set_name": "Bloomburrow Commander",
            "collector_number": "127",
            "rarity": "common",
            "mana_cost": "{2}",
            "cmc": 2,
            "type_line": "Artifact",
            "oracle_text": "{T}: Add one mana of any color in your commander's color identity.",
            "colors": [],
            "color_identity": [],
            "price_usd": "0.86"
          }
        },
        {
          "card_id": "5cf95476-27ed-487d-8459-c97a921bb808",
          "finish": "nonfoil",
          "qty": 2,
          "note": "",
          "for_trade": false,
          "ask_cents": null,
          "binder": "",
          "binder_type": "binder",
          "condition": "near_mint",
          "language": "en",
          "paid_cents": null,
          "updated_at": 1762905600,
          "category": "",
          "card": {
            "id": "5cf95476-27ed-487d-8459-c97a921bb808",
            "name": "Mind Stone",
            "set": "blc",
            "set_name": "Bloomburrow Commander",
            "collector_number": "280",
            "rarity": "uncommon",
            "mana_cost": "{2}",
            "cmc": 2,
            "type_line": "Artifact",
            "oracle_text": "{T}: Add {C}.\n{1}, {T}, Sacrifice this artifact: Draw a card.",
            "colors": [],
            "color_identity": [],
            "price_usd": "0.36"
          }
        }
      ]
    }
  }
}
Answers are computed in your browser from the repo's sample member, with card records trimmed for reading. Deck edits and the deck analysis run on mtgunited.com.