ChessPal Chess Engine (stockfish)

ChessPal Chess Engine (stockfish)

Stockfish-powered chess engine exposed as an MCP server via FastMCP (SSE/stdio).

4
Stars
2
Forks
4
Releases

Overview

ChessPal Chess Engine is a Stockfish-powered chess engine exposed as an MCP server using FastMCP. It calculates the best moves via MCP tools accessible over SSE (default) or stdio transports using an MCP client library. The server implements the Model Context Protocol (MCP) to expose core chess engine capabilities as MCP endpoints. It supports UCI for move generation and provides endpoints such as get_best_move_tool, validate_move_tool, get_legal_moves_tool, and get_game_status_tool. The engine is designed with robust process management, configurable engine binaries, and flexible environment-based configuration. It includes a comprehensive test suite with a Test-Driven Development approach, robust error handling and recovery mechanisms to maintain availability, and support for FEN positions and move history to reproduce and analyze games. Prerequisites include Python 3.10+, Poetry for dependency management, and Stockfish (version 17.1 recommended). It can be run via SSE or stdio transports and is configurable through environment variables (CHESSPAL_ENGINE_*, MCP_HOST/PORT, and logging settings). The project emphasizes integration readiness, testing, and CI/CD with a development workflow and documentation.

Details

Owner
wilson-urdaneta
Language
Python
License
GNU General Public License v3.0
Updated
2025-12-07

Features

Robust Stockfish engine integration

Stable integration of Stockfish with proper lifecycle and process management.

MCP exposure via FastMCP

Engine functionality is exposed through the MCP using the FastMCP protocol.

Supports SSE and stdio MCP transports

Client interaction is supported over both SSE (default) and stdio transports.

UCI protocol implementation

Implements the UCI chess protocol for move generation and validation.

Comprehensive test suite with TDD

Extensive tests follow a Test-Driven Development approach for reliability.

Error handling and recovery

Robust error handling and recovery mechanisms to maintain availability.

FEN and move history support

Supports FEN positions and move history for game reproduction and analysis.

Flexible engine binary configuration

Engine binary can be configured via environment variables or a predefined directory structure.

Audience

DevelopersIntegrate MCP-based chess engine features via SSE or stdio transports for applications and tools.

Tags

StockfishMCPFastMCPSSEstdiochessUCIengineserverAPI