Card Magic MCP

Card Magic MCP

Implements the Chico & Dico card magic trick by encoding a hidden fifth card within the specific arrangement of four cards. It provides tools to both encode five-card sets into sequences and decode those sequences to reveal the hidden card.

Category
Visit Server

README

card-magic-mcp

License PyPI Downloads CI smithery badge

中文文档

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.

smithery_playground

🎭 Performance Steps

  1. Tell the magician: Help me arrange these playing cards ♠J ♠4 ♣2 ♦3 ♦K
  2. This magician will separate the cards into two piles: the first four cards and the fifth card
  3. 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?

[!NOTE] 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.

📦 Installation

Manual Installation

pip install card-magic-mcp

Installing 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_sse

Add 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 cards
  • decode_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,K
  • Format: Each card should be written as {suit}{rank} with spaces separating multiple cards

Recommended Servers

playwright-mcp

playwright-mcp

A Model Context Protocol server that enables LLMs to interact with web pages through structured accessibility snapshots without requiring vision models or screenshots.

Official
Featured
TypeScript
Magic Component Platform (MCP)

Magic Component Platform (MCP)

An AI-powered tool that generates modern UI components from natural language descriptions, integrating with popular IDEs to streamline UI development workflow.

Official
Featured
Local
TypeScript
Audiense Insights MCP Server

Audiense Insights MCP Server

Enables interaction with Audiense Insights accounts via the Model Context Protocol, facilitating the extraction and analysis of marketing insights and audience data including demographics, behavior, and influencer engagement.

Official
Featured
Local
TypeScript
VeyraX MCP

VeyraX MCP

Single MCP tool to connect all your favorite tools: Gmail, Calendar and 40 more.

Official
Featured
Local
graphlit-mcp-server

graphlit-mcp-server

The Model Context Protocol (MCP) Server enables integration between MCP clients and the Graphlit service. Ingest anything from Slack to Gmail to podcast feeds, in addition to web crawling, into a Graphlit project - and then retrieve relevant contents from the MCP client.

Official
Featured
TypeScript
Kagi MCP Server

Kagi MCP Server

An MCP server that integrates Kagi search capabilities with Claude AI, enabling Claude to perform real-time web searches when answering questions that require up-to-date information.

Official
Featured
Python
Qdrant Server

Qdrant Server

This repository is an example of how to create a MCP server for Qdrant, a vector search engine.

Official
Featured
Neon Database

Neon Database

MCP server for interacting with Neon Management API and databases

Official
Featured
Exa Search

Exa Search

A Model Context Protocol (MCP) server lets AI assistants like Claude use the Exa AI Search API for web searches. This setup allows AI models to get real-time web information in a safe and controlled way.

Official
Featured
E2B

E2B

Using MCP to run code via e2b.

Official
Featured