
elicitation blackjack example mcp
A demo of MCP elicitations. For sharing purposes.
Repository Info
About This Server
A demo of MCP elicitations. For sharing purposes.
Model Context Protocol (MCP) - This server can be integrated with AI applications to provide additional context and capabilities, enabling enhanced AI interactions and functionality.
Documentation
Blackjack MCP - Exploring Elicitations
Goal
This project demonstrates MCP Elicitations through an interactive blackjack game! Elicitations allow MCP servers to request structured input from users during interactions. By playing blackjack, you'll experience how elicitations work in a fun, easy-to-understand way:
- Betting prompts - Server asks for your bet amount with validation
- Action prompts - Server asks "hit or stand?" during gameplay
- Structured responses - Your inputs are validated against JSON schemas
- Interactive flow - Game progresses based on your elicited responses
Perfect for learning how MCP servers can create dynamic, user-driven experiences!
Setup with UV
1. Project Structure
blackjack_mcp/
├── src/
│ └── blackjack_server.py
├── requirements.txt
└── README.md
2. Create requirements.txt
mcp[cli]>=1.0.0
3. Install dependencies with UV
# From project root
uv add -r requirements.txt
Or alternatively:
uv add "mcp[cli]"
4. Test with MCP Inspector
uv run mcp dev src/blackjack_server.py
5. Install in Claude Desktop
uv run mcp install src/blackjack_server.py --name "Blackjack Casino"
How to Play
- Start a new hand: Use
start_game()tool - it will ask for your bet amount - Make your moves: Use
player_action()tool - hit or stand - Check game state: Use
show_game_state()tool anytime - Reset chips: Use
reset_chips()if you go broke
Game Flow
start_game()- Prompts for bet, deals 2 cards eachplayer_action()- You choose hit or stand via elicitation- Dealer plays automatically (hits on 16, stands on 17)
- Winner determined, chips updated
Example Session
You: start_game()
MCP: [Prompts for bet amount]
You: [Enter "50"]
MCP: 🎲 NEW BLACKJACK HAND! Your cards: A♠ 7♥ (Value: 18)...
You: player_action()
MCP: [Prompts hit or stand]
You: [Choose "stand"]
MCP: Dealer reveals 10♦ 6♣, hits 9♠, busts! You win $100!
Features
- Real blackjack rules with proper ace handling
- Betting system with chip management
- Elicitation prompts for bets and actions
- Dealer AI follows house rules
- Blackjack payouts (3:2 for natural 21)
- Visual card display with suits
Perfect for learning MCP elicitation while playing a fun game!
Quick Start
Clone the repository
git clone https://github.com/angrypenguinpng/elicitation-blackjack-example-mcpInstall dependencies
cd elicitation-blackjack-example-mcp
npm installFollow the documentation
Check the repository's README.md file for specific installation and usage instructions.
Repository Details
Recommended MCP Servers
Discord MCP
Enable AI assistants to seamlessly interact with Discord servers, channels, and messages.
Knit MCP
Connect AI agents to 200+ SaaS applications and automate workflows.
Apify MCP Server
Deploy and interact with Apify actors for web scraping and data extraction.
BrowserStack MCP
BrowserStack MCP Server for automated testing across multiple browsers.
Zapier MCP
A Zapier server that provides automation capabilities for various apps.