# Local Chess MCP Testing Guide
Play chess locally without ChatGPT using the built-in test client!
## Quick Start
```bash
cd /Users/jerel/Documents/Projects/ChessMCP
python3 chess_local_test.py
```
That's it! You can now play chess in your terminal.
## Available Commands
### Playing Chess
```
move e4 # Pawn to e4
move Nf3 # Knight to f3
move O-O # Castle kingside
move e8=Q # Promote to queen
```
### Game Management
```
status # Show current game state
reset # Start new game
```
### Puzzles & Analysis
```
puzzle easy # Load easy puzzle
puzzle medium # Load medium puzzle
puzzle hard # Load hard puzzle
stockfish # Get engine analysis (depth 15)
stockfish 20 # Get deeper analysis
```
### Other
```
help # Show help
quit # Exit
```
## Example Session
```
โ๏ธ Chess MCP Local Tester
============================================================
๐ Initial game status...
โ
โ๏ธ Game in Progress
๐ฏ You (White) to move
โ๏ธ > move e4
โ๏ธ Making move: e4
โ
Move played: e4
FEN: rnbqkbnr/pppppppp/8/8/4P3/8/PPPP1PPP/RNBQKBNR b KQkq - 0 1
Turn: black
Status: ongoing
โ๏ธ > move e5
โ๏ธ Making move: e5
โ
Move played: e5
โ๏ธ > stockfish
๐ค Stockfish analysis (depth 15)...
โ
Stockfish recommends: Nf3 (Evaluation: +0.25)
โ๏ธ > move Nf3
โ
Move played: Nf3
โ๏ธ > status
๐ Game status...
โ
โ๏ธ Game in Progress
๐ฏ Opponent (Black) to move
๐ Move 2
๐ Last 3 moves: e4, e5, Nf3
โ๏ธ > puzzle hard
๐งฉ Loading hard puzzle...
โ
๐งฉ Mate in 1 Puzzle (Hard)
White to move and checkmate in one move!
๐ก Hint: The king cannot escape the back rank!
โ๏ธ > quit
๐ Goodbye! Thanks for playing!
```
## How It Works
The local tester:
1. Imports chess functions directly from `server/main.py`
2. Sets up a mock user context (bypasses OAuth)
3. Calls functions directly (no HTTP overhead)
4. Shows formatted results in terminal
## Benefits
โ
**No Server Required** - Runs standalone
โ
**No OAuth** - Bypasses authentication
โ
**Instant Testing** - No HTTP latency
โ
**Per-User State** - Maintains game state per session
โ
**Full Functionality** - All 5 tools available
## vs HTTP Client (`chess_client.py`)
| Feature | Local Tester | HTTP Client |
|---------|-------------|-------------|
| Server needed | โ No | โ
Yes |
| OAuth required | โ No | โ
Yes (or disable) |
| Speed | โก Instant | ๐ HTTP latency |
| Use case | Dev/testing | Integration testing |
## Troubleshooting
### "ModuleNotFoundError"
**Cause:** Can't find server modules
**Solution:** Make sure you're running from the project root:
```bash
cd /Users/jerel/Documents/Projects/ChessMCP
python3 chess_local_test.py
```
### "Authentication required"
This shouldn't happen with the mock user context. If it does, the context variable might not be set properly.
### Import Errors
If you see import errors, ensure all dependencies are installed:
```bash
cd server
pip3 install -r requirements.txt
```
## Development Workflow
Use this for rapid development:
1. Make changes to `server/main.py`
2. Test with `python3 chess_local_test.py`
3. Iterate quickly without restarting server
4. Once working, test with ChatGPT
## Note on Game State
Each time you run the local tester, it creates a **fresh game state** since it imports the modules new. Your game is isolated to that session.
For ChatGPT/HTTP server, game state persists per user across requests.
---
**Happy local testing!** โ๏ธ๐ฎ