Card Magic MCP
Click on "Deploy Server".
Wait a few minutes for the server to deploy. Once ready, it will show a "Started" state.
In the chat, type
@followed by the MCP server name and your instructions, e.g., "@Card Magic MCP Help me arrange these playing cards: ♠J ♠4 ♣2 ♦3 ♦K"
That's it! The server will respond to your query, and you can continue using it as needed.
Here is a step-by-step guide with screenshots.
card-magic-mcp
A Model Context Protocol (MCP) server that implements the Chico & Dico card magic trick.
Chico & Dico's Card Magic: Randomly draw five playing cards, and the audience only needs to recite the first four cards in the order arranged by Chico, and Dico can know what the fifth card is.
You can experience this magic trick in the Smithery Playground.
🎭 Performance Steps
Tell the magician:
Help me arrange these playing cards ♠J ♠4 ♣2 ♦3 ♦KThis magician will separate the cards into two piles: the first four cards and the fifth card
Tell the other magician what the first four cards are, and they can tell you what the fifth card is:
The first four playing cards are [card1 card2 card3 card4], what is the fifth card?
Trust me, it's not through memory that it knows what the fifth card is, but through pure magic. To prevent the current dialog from remembering the fifth card, you can open a new Playground page. Tell it what the first four cards are and see if it can still guess correctly.
Related MCP server: CyberChef MCP Server
📦 Installation
Manual Installation
pip install card-magic-mcpInstalling via Smithery
To install Card Magic MCP Server for Claude Desktop automatically via Smithery:
npx -y @smithery/cli@latest install @luochang212/card-magic-mcp --client claude🚀 Usage
This MCP server can be integrated with Qwen Agent using two connection methods: stdio and sse.
For more examples, see examples/usage_remote.py
stdio: Local Call
Add the following configuration to the function_list parameter:
{
"mcpServers": {
"card_magic": {
"type": "stdio",
"command": "uvx",
"args": [
"--from",
"card-magic-mcp",
"card_magic_stdio"
]
}
}
}sse: Remote Call
Before calling, run the following code in the command line to start the MCP service:
HOST=0.0.0.0 PORT=8385 uvx --from card-magic-mcp card_magic_sseAdd the following configuration to function_list:
{
"mcpServers": {
"card_magic_sse": {
"url": "http://0.0.0.0:8385/sse"
}
}
}🔧 Available Tools
The MCP Server provides two tools for card magic:
encode_cards: Encode 5 cards to hide the 5th card's information in the arrangement of the first 4 cardsdecode_cards: Decode the hidden 5th card from the arrangement information of the first 4 visible cards
🃏 Card Format
Suits:
♠(Spades),♥(Hearts),♦(Diamonds),♣(Clubs)Ranks:
A,2,3,4,5,6,7,8,9,10,J,Q,KFormat: Each card should be written as
{suit}{rank}with spaces separating multiple cards
Available Tools
2 toolsdecode_cards_toolC
本函数实现魔术师 Dico 的操作:根据前四张牌猜第五张牌
Inputs: cards (required). Returns: result
encode_cards_toolB
本函数实现魔术师 Chico 的操作:将五张牌重新排序, 并在排序过程中将第五张牌的信息编码在前四张的排序信息中
Inputs: cards (required). Returns: result
Tool Schema Changelog
Recent tool additions, removals, and schema changes observed during successful MCP inspections.
Loading tool schema changelog…
TDQS
Scored across 2 tools
The two tools have clearly distinct purposes: one encodes information into a card ordering, the other decodes it. There is no overlap or ambiguity.
Both tools follow the same verb_noun_tool pattern consistently (decode_cards_tool and encode_cards_tool).
Two tools is slightly below the typical 3-15 range for a well-scoped server, but for a very focused domain (a specific card trick), it is still reasonable and each tool earns its place.
The tool set covers the complete workflow for the card trick: encoding (arranging five cards to hide the fifth) and decoding (recovering the fifth card from the arrangement). There are no missing operations.
Maintenance
Related MCP Connectors
Supported Balatro scoring and exact small-deck play/discard analysis with verified explanations.
Deck of Cards MCP — wraps deckofcardsapi.com (free, no auth)
Compute, decode and verify the Italian codice fiscale; codici catastali of every era.
Tarot card meanings, spreads and seeded reproducible readings for AI agents, one API key.
Related MCP Servers
- FlicenseNot gradedqualityDmaintenanceEnables Magic: The Gathering players to manage decks and access card information through Claude, supporting gameplay actions like drawing cards and mulligans while providing Scryfall API integration for card lookups.15-
- FlicenseNot gradedqualityDmaintenanceEnables AI agents to discover, execute, and validate CyberChef operations for data encoding, decoding, encryption, and transformation tasks. Provides structured access to CyberChef's extensive catalog of data manipulation tools through natural language interactions.-
- AlicenseNot gradedqualityBmaintenanceProvides tools to interact with the Deck of Cards API (deckofcardsapi.com) for card operations such as drawing, shuffling, and managing decks through natural language.126 npmMIT
- FlicenseNot gradedqualityBmaintenanceProvides Magic: The Gathering card, deck, provider, and statistical evidence tools for LLMs to make informed deckbuilding decisions.-