MCP Servers

A collection of Model Context Protocol servers, templates, tools and more.

E
Elicitation Blackjack Example MCP

A demo of MCP elicitations. For sharing purposes.

Created 5/30/2025
Updated 3 days ago
Repository documentation and setup instructions

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

  1. Start a new hand: Use start_game() tool - it will ask for your bet amount
  2. Make your moves: Use player_action() tool - hit or stand
  3. Check game state: Use show_game_state() tool anytime
  4. Reset chips: Use reset_chips() if you go broke

Game Flow

  1. start_game() - Prompts for bet, deals 2 cards each
  2. player_action() - You choose hit or stand via elicitation
  3. Dealer plays automatically (hits on 16, stands on 17)
  4. 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 Setup
Installation guide for this server

Install Package (if required)

uvx elicitation-blackjack-example-mcp

Cursor configuration (mcp.json)

{ "mcpServers": { "angrypenguinpng-elicitation-blackjack-example-mcp": { "command": "uvx", "args": [ "elicitation-blackjack-example-mcp" ] } } }