Skip to main content
Glama
CLIENT_USAGE.md•3.68 kB
# Chess MCP Client - Local Testing A simple CLI client to test your Chess MCP server locally without needing ChatGPT. ## Quick Start ### 1. Start the Server In one terminal: ```bash cd /Users/jerel/Documents/Projects/ChessMCP/server python3 main.py ``` ### 2. Start the Client In another terminal: ```bash cd /Users/jerel/Documents/Projects/ChessMCP python3 chess_client.py ``` You should see: ``` šŸ”Œ Connecting to Chess MCP Server at http://localhost:8000 āœ… Server is online ============================================================ ā™Ÿļø Chess MCP Client - Interactive Mode ============================================================ šŸ“Š Getting game status... ā™Ÿļø Game in Progress šŸŽÆ You (White) to move šŸ“Š Move 1 ... ``` ## Available Commands ### Make Moves ``` move e4 move Nf3 move O-O move e8=Q ``` ### Check Status ``` status ``` ### Reset Game ``` reset ``` ### Load Puzzle ``` puzzle easy puzzle medium puzzle hard ``` ### Get Analysis ``` stockfish stockfish 20 ``` ### Other Commands ``` tools # List all available tools help # Show help quit # Exit ``` ## Example Game Session ``` ā™Ÿļø > move e4 ā™Ÿļø Making move: e4 āœ… Move played: e4 FEN: rnbqkbnr/pppppppp/8/8/4P3/8/PPPP1PPP/RNBQKBNR b KQkq e3 0 1 Turn: black Status: ongoing ā™Ÿļø > move e5 ā™Ÿļø Making move: e5 āœ… Move played: e5 FEN: rnbqkbnr/pppp1ppp/8/4p3/4P3/8/PPPP1PPP/RNBQKBNR w KQkq e6 0 2 Turn: white Status: ongoing ā™Ÿļø > stockfish šŸ¤– Getting Stockfish analysis (depth 15)... āœ… Stockfish recommends: Nf3 (Evaluation: +0.25) ā™Ÿļø > move Nf3 ā™Ÿļø Making move: Nf3 āœ… Move played: Nf3 ... ā™Ÿļø > status šŸ“Š Getting game status... ā™Ÿļø Game in Progress šŸŽÆ Opponent (Black) to move šŸ“Š Move 2 šŸ‘„ Players: White: You Black: Opponent šŸ“ Last 3 moves: e4, e5, Nf3 ā™Ÿļø > quit šŸ‘‹ Goodbye! Thanks for playing! ``` ## Connecting to Remote Server You can also connect to your ngrok server for testing: ```bash python3 chess_client.py https://shimmery-genevive-wooly.ngrok-free.dev ``` **Note:** This bypasses OAuth since it's a direct HTTP connection. For OAuth-protected servers, you'd need to add authentication headers. ## Features āœ… **No OAuth Required** - Bypasses authentication middleware for local testing āœ… **Interactive CLI** - Simple command-line interface āœ… **All 5 Tools** - Access all chess MCP tools āœ… **Real-time Testing** - Test changes without ChatGPT āœ… **Error Handling** - Shows clear error messages ## Troubleshooting ### "Cannot connect to server" **Solution:** Make sure the server is running: ```bash cd server python3 main.py ``` ### "404 Not Found" **Solution:** Server might be using a different MCP endpoint. Try: - Check server logs for the correct endpoint - Verify FastMCP is configured for HTTP ### "Authentication required" If the server requires OAuth even for `/mcp` endpoint: 1. **Option A:** Temporarily disable auth middleware for local testing 2. **Option B:** Add `/mcp` to `UNAUTHENTICATED_PATHS` in `auth_middleware.py` The `/mcp` endpoint should already be unauthenticated based on our configuration. ## Development Tips - Use this client to quickly test changes - Verify tool responses before deploying - Test error handling - Validate move logic - Check game state persistence ## Advanced: Add Authentication If you want to test with OAuth: ```python # Add Bearer token to requests headers = { "Authorization": f"Bearer {your_jwt_token}", "Content-Type": "application/json" } response = requests.post(url, json=payload, headers=headers) ``` --- **Have fun testing locally!** ā™ŸļøšŸŽ®

Latest Blog Posts

MCP directory API

We provide all the information about MCP servers via our MCP API.

curl -X GET 'https://glama.ai/api/mcp/v1/servers/GeneralJerel/ChessMCP'

If you have feedback or need assistance with the MCP directory API, please join our Discord server