ChessPal Stockfish MCP Server Chess Engine
Deploy a Stockfish-powered MCP server to calculate best moves with HTTP/SSE and stdio transports for seamless engine integration.
npx -y @wilson-urdaneta/chesspal-mcp-engineOverview
ChessPal Stockfish MCP Server is a lightweight engine adapter that exposes a Stockfish chess engine over the Model Context Protocol (MCP) using two common transports: HTTP/SSE for network clients and stdio for process-based integrations. It lets you run Stockfish as a microservice so other applications (web UIs, bots, analysis tools) can request best moves, multi-variation analysis, or streaming principal variations without embedding the engine directly.
This server is useful when you want a standard, language-agnostic interface to Stockfish. HTTP/SSE provides easy integration for web apps and remote services (fetch/cURL/EventSource), while stdio lets you spawn the MCP server as a child process from any application and exchange line-delimited JSON messages. The design focuses on predictable I/O, configurable engine options, and minimal operational friction (Docker-friendly, configurable via env or YAML).
Features
- Runs Stockfish as an MCP-compliant engine backend
- Two transport modes:
- HTTP with JSON request/response
- SSE (Server-Sent Events) for streaming analysis updates
- stdio (line-delimited JSON) for process integration
- Configure Stockfish UCI options (threads, hash, multipv, skill level)
- Simple JSON protocol for requests and responses
- Docker-friendly deployment and lightweight server binary
- Suitable for web apps, bots, automated analysis pipelines
Installation / Configuration
Clone the repository and run with Docker (recommended):
# Example: run with local Stockfish binary mounted into the container
Or build and run locally (assuming a Go or similar toolchain is present in the repo):
# build (if a Go project)
Example config.yaml (engine options and server settings):
server:
host: "0.0.0.0"
port: 8080
engine:
path: "/usr/local/bin/stockfish"
threads: 4
hash_mb: 64
multipv: 1
logging:
level: "info"
Common environment variables (supported by the server):
- STOCKFISH_PATH: path to the Stockfish binary
- PORT: HTTP port (default 8080)
- LOG_LEVEL: log verbosity (info/debug/error)
Adjust Stockfish UCI options (threads, hash, multipv) in the YAML or via env vars depending on your deployment.
Available Resources
- GitHub repository: https://github.com/wilson-urdaneta/chesspal-mcp-engine
- Stockfish official: https://stockfishchess.org
- Example clients: use any HTTP/SSE-capable client (curl, fetch, EventSource) or spawn as a child process for stdio integration
Transport comparison:
| Transport | Best for | Notes |
|---|---|---|
| HTTP JSON | REST-style requests | Simple POST/response workflows |
| SSE | Streaming analysis | Receive progressive principal variations / evaluation updates |
| stdio | Embedded processes | Low-latency IPC when spawning the server locally |
Use Cases
- Web UI: request best move and stream analysis to display improving principal variations.
- Example HTTP POST (get one-time best move):
- Live analysis over SSE: stream multi-pv updates as they are computed.
- Example with curl to keep the event stream open: