angrypenguinpng
MCP Serverangrypenguinpngpublic

elicitation blackjack example mcp

A demo of MCP elicitations. For sharing purposes.

Repository Info

2
Stars
1
Forks
2
Watchers
0
Issues
Python
Language
MIT License
License

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

  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 Start

1

Clone the repository

git clone https://github.com/angrypenguinpng/elicitation-blackjack-example-mcp
2

Install dependencies

cd elicitation-blackjack-example-mcp
npm install
3

Follow the documentation

Check the repository's README.md file for specific installation and usage instructions.

Repository Details

Ownerangrypenguinpng
Repoelicitation-blackjack-example-mcp
LanguagePython
LicenseMIT License
Last fetched8/10/2025

Recommended MCP Servers

💬

Discord MCP

Enable AI assistants to seamlessly interact with Discord servers, channels, and messages.

integrationsdiscordchat
🔗

Knit MCP

Connect AI agents to 200+ SaaS applications and automate workflows.

integrationsautomationsaas
🕷️

Apify MCP Server

Deploy and interact with Apify actors for web scraping and data extraction.

apifycrawlerdata
🌐

BrowserStack MCP

BrowserStack MCP Server for automated testing across multiple browsers.

testingqabrowsers

Zapier MCP

A Zapier server that provides automation capabilities for various apps.

zapierautomation