TexasSolver MCP Server
A Model Context Protocol (MCP) server that enables Claude and other LLMs to interact with the TexasSolver console poker solver through structured parameters.
Features
Run Solver: Execute the TexasSolver with custom game parameters (pot, stack, ranges, board, bet sizes)
Load Ranges: List and load preflop range files from the TexasSolver ranges directory
Build Game Trees: Generate game tree configurations without running the solver (for inspection/editing)
List Outputs: Query previously generated solver outputs
Structured Input: LLM provides structured parameters - no natural language parsing needed
Installation
1. Prerequisites
Node.js 18.0.0 or higher
TexasSolver binary (v0.2.0 or compatible)
2. Install Dependencies
3. Configure Environment
Copy .env.example to .env and update the TEXAS_SOLVER_PATH:
Example:
Usage
Running the MCP Server
The server will start and listen for MCP requests via stdio.
Claude Desktop Integration
Add the following to your Claude Desktop configuration file at:
~/Library/Application Support/Claude/claude_desktop_config.json
MCP Tools
run_solver
Execute the TexasSolver with game parameters.
Parameters:
pot(number): Starting pot sizeeffective_stack(number): Player stack sizeboard(string): Board cards (e.g., "Qs,8d,7h" for flop, empty for preflop)range_ip(string): In-position player range (e.g., "AA-22,AK-AJ")range_oop(string): Out-of-position player rangebet_sizes(object, optional): Custom bet sizes by position, street, and actionsolver_config(object, optional): Solver settings (thread_num, accuracy, max_iteration, etc.)output_name(string, optional): Custom output filename
Example:
Returns:
list_ranges
Discover available preflop range files.
Parameters:
filter(string, optional): Filter by position or scenariorange_set(string, optional): "6max", "qb", or all (default)
Returns:
load_range
Load and parse a specific range file.
Parameters:
range_path(string): Path fromlist_rangesor absolute path
Returns:
build_game_tree_config
Generate a game tree configuration without running the solver.
Parameters: Same as run_solver (without solver_config)
Returns:
list_outputs
List previously generated solver outputs.
Parameters:
limit(number, optional): Maximum results (default: 20)sort_by(string, optional): "date" (default) or "size"
Returns:
Project Structure
How It Works
Solver Execution Flow
Input Validation: Validates all parameters (ranges, board, bet sizes)
Command Generation: Builds a command file with solver settings
Process Spawning: Spawns the console_solver binary
Command Piping: Pipes the command file to solver stdin
Output Capture: Captures solver stdout/stderr for logging
Completion: Waits for solver to finish (timeout: 10 minutes)
Result Return: Returns paths to output JSON and command file
Range File Format
Ranges are stored as comma-separated hands with optional weights:
AA:1.0- Always include AAAKo:0.75- Include AKo 75% of the timeJJ- Implicit weight of 1.0 if not specified
Error Handling
The server provides detailed error messages for:
Invalid solver path or missing binary
Invalid game parameters (pot, stack, ranges, board)
Invalid bet sizes
Solver process failures
Output file not created
Timeout (10 minutes)
All errors include:
Human-readable message
Error type (VALIDATION_ERROR, EXECUTION_ERROR, OUTPUT_ERROR)
Detailed context (command file, solver log, exit code)
Development
Running Tests
Testing with Sample Data
The TexasSolver includes sample command files in:
Troubleshooting
"Solver binary not found"
Verify
TEXAS_SOLVER_PATHin.envpoints to the actual binaryCheck file permissions:
ls -la /path/to/console_solver
"Permission denied"
Make sure the binary is executable:
chmod +x /path/to/console_solver
"Solver timed out"
Complex game trees can take time to solve
Reduce accuracy or max_iteration in solver_config
Increase SOLVER_TIMEOUT_MS in .env if needed
"Output file not created"
Check available disk space
Verify the data/outputs/ directory is writable
Check solver_log in error response for solver-specific errors
License
MIT
Support
For issues or feature requests, please refer to the documentation or check the MCP server logs.