This is an Model Context Protocol server that allows an MCP client agents to play a game of Texas Holdem poker game. It is implemented with Node.js and TypeScript, including game server, game client, and a MCP Server.
Most Code in this project is generated by AI(Claude-3.7-Sonnet), and it tooks about 5 hours to improve and debug. Its Amazing!
Online Demo
Texas Holdem Online



Getting started
npm install
npm run build
npm run dev
-
Open Poker Client:
Open your browser visit http://localhost:3000/
-
Configure your MCP client to add the tool. For example, here is how to add the tool to Cline, assuming you cloned the repo at /path/to/poker-mcp-server
:
{
"mcpServers": {
"poker-mcp-server": {
"command": "node",
"args": ["/path/to/poker-mcp-server/dist/mcpServer.js"],
"env": {
"DEBUG": "*"
}
}
}
}

Example prompt
You are a Texas Hold'em poker expert. Please use the name "Super Awesome Pro" to join a Texas Hold'em poker game and win more chips. You can only use the functions provided by the poker-mcp-server MCP server. After joining the game, you must wait for your turn to act before proceeding to the next move.
Enjoy Playing Poker With LLM!
[
{
"description": "login and list all tables in the poker game",
"inputSchema": {
"properties": {
"name": {
"type": "string"
}
},
"required": [
"name"
],
"type": "object"
},
"name": "login"
},
{
"description": "Join a poker table",
"inputSchema": {
"properties": {
"player_id": {
"type": "string"
},
"table_id": {
"type": "string"
}
},
"required": [
"player_id",
"table_id"
],
"type": "object"
},
"name": "join_table"
},
{
"description": "Get the current status of a poker table",
"inputSchema": {
"properties": {
"player_id": {
"type": "string"
},
"table_id": {
"type": "string"
}
},
"required": [
"player_id",
"table_id"
],
"type": "object"
},
"name": "get_table_status"
},
{
"description": "Leave a poker table",
"inputSchema": {
"properties": {
"player_id": {
"type": "string"
},
"table_id": {
"type": "string"
}
},
"required": [
"player_id",
"table_id"
],
"type": "object"
},
"name": "leave_table"
},
{
"description": "do action check",
"inputSchema": {
"properties": {
"player_id": {
"type": "string"
},
"table_id": {
"type": "string"
}
},
"required": [
"player_id",
"table_id"
],
"type": "object"
},
"name": "action_check"
},
{
"description": "do action fold",
"inputSchema": {
"properties": {
"player_id": {
"type": "string"
},
"table_id": {
"type": "string"
}
},
"required": [
"player_id",
"table_id"
],
"type": "object"
},
"name": "action_fold"
},
{
"description": "do action bet",
"inputSchema": {
"properties": {
"amount": {
"type": "number"
},
"player_id": {
"type": "string"
},
"table_id": {
"type": "string"
}
},
"required": [
"player_id",
"table_id",
"amount"
],
"type": "object"
},
"name": "action_bet"
},
{
"description": "do action raise",
"inputSchema": {
"properties": {
"amount": {
"type": "number"
},
"player_id": {
"type": "string"
},
"table_id": {
"type": "string"
}
},
"required": [
"player_id",
"table_id",
"amount"
],
"type": "object"
},
"name": "action_raise"
},
{
"description": "do action call",
"inputSchema": {
"properties": {
"player_id": {
"type": "string"
},
"table_id": {
"type": "string"
}
},
"required": [
"player_id",
"table_id"
],
"type": "object"
},
"name": "action_call"
}
]