A Model Context Protocol server that lets your AI talk to Stockfish. Because apparently we needed to make chess engines even more accessible to our silicon overlords. This creates a bridge between AI systems and the Stockfish chess engine via the MCP protocol. It handles multiple concurrent sessions because your AI probably wants to analyze seventeen positions simultaneously while you're still fig
Add this skill
npx mdskills install sonirico/mcp-stockfishWell-documented Stockfish bridge with clear UCI command support and proper session management
1# mcp-stockfish ๐23A Model Context Protocol server that lets your AI talk to Stockfish. Because apparently we needed to make chess engines even more accessible to our silicon overlords.4567> ๐ง โก๐ฅ๏ธ *Your LLM thinks, Stockfish calculates, you pretend you understand the resulting 15-move tactical sequence.*89## What is this?1011This creates a bridge between AI systems and the Stockfish chess engine via the MCP protocol. It handles multiple concurrent sessions because your AI probably wants to analyze seventeen positions simultaneously while you're still figuring out why your knight is hanging.1213Built on [mark3labs/mcp-go](https://github.com/mark3labs/mcp-go). Because reinventing wheels is for people with too much time.1415## Features1617- **๐ Concurrent Sessions**: Run multiple Stockfish instances without your CPU crying18- **โก Full UCI Support**: All the commands you need, none of the ones you don't19- **๐ฏ Actually Works**: Unlike your last side project, this one has proper error handling20- **๐ JSON Everything**: Because apparently we can't just use plain text anymore21- **๐ณ Docker Ready**: Containerized for when you inevitably break your local setup2223## Supported UCI Commands โ๏ธ2425| **Command** | **Description** |26| -------------------- | ------------------------------------------------------------------------------ |27| `uci` | Initializes the engine in UCI mode |28| `isready` | Checks if the engine is ready. Returns `readyok` |29| `position startpos` | Sets up the board to the starting position |30| `position fen [FEN]` | Sets up a position using FEN notation |31| `go` | Starts the engine to compute the best move |32| `go depth [n]` | Searches `n` plies deep. Example: `go depth 10` |33| `go movetime [ms]` | Thinks for a fixed amount of time in milliseconds. Example: `go movetime 1000` |34| `stop` | Stops current search |35| `quit` | Closes the session |3637## Quick Start3839### Installation4041```bash42git clone https://github.com/sonirico/mcp-stockfish43cd mcp-stockfish44make install45```4647### Usage4849```bash50# Default mode (stdio, because we're old school)51mcp-stockfish5253# With custom Stockfish path (for the special snowflakes)54MCP_STOCKFISH_PATH=/your/special/stockfish mcp-stockfish5556# HTTP mode (for the web-scale crowd)57MCP_STOCKFISH_SERVER_MODE=http mcp-stockfish58```5960## Configuration โ๏ธ6162### Environment Variables6364#### Server Configuration6566- `MCP_STOCKFISH_SERVER_MODE`: "stdio" or "http" (default: "stdio")67- `MCP_STOCKFISH_HTTP_HOST`: HTTP host (default: "localhost")68- `MCP_STOCKFISH_HTTP_PORT`: HTTP port (default: 8080)6970#### Stockfish ๐ Configuration7172- `MCP_STOCKFISH_PATH`: Path to Stockfish binary (default: "stockfish")73- `MCP_STOCKFISH_MAX_SESSIONS`: Max concurrent sessions (default: 10)74- `MCP_STOCKFISH_SESSION_TIMEOUT`: Session timeout (default: "30m")75- `MCP_STOCKFISH_COMMAND_TIMEOUT`: Command timeout (default: "30s")7677#### Logging7879- `MCP_STOCKFISH_LOG_LEVEL`: debug, info, warn, error, fatal80- `MCP_STOCKFISH_LOG_FORMAT`: json, console81- `MCP_STOCKFISH_LOG_OUTPUT`: stdout, stderr8283## Tool Parameters8485- `command`: UCI command to execute86- `session_id`: Session ID (optional, we'll make one up if you don't)8788## Response Format8990```json91{92 "status": "success|error",93 "session_id": "some-uuid",94 "command": "what you asked for",95 "response": ["what stockfish said"],96 "error": "what went wrong (if anything)"97}98```99100## Session Management101102Sessions do what you'd expect:103104- Spawn Stockfish processes on demand105- Keep UCI state between commands106- Clean up when you're done (or when they timeout)107- Enforce limits so you don't fork-bomb yourself108109## Integration110111### Claude Desktop112113```json114{115 "mcpServers": {116 "chess": {117 "command": "mcp-stockfish",118 "env": {119 "MCP_STOCKFISH_LOG_LEVEL": "info"120 }121 }122 }123}124```125126## Development127128```bash129make deps # Get dependencies130make build # Build the thing131make test # Run tests (when they exist)132make fmt # Make it pretty133```134135## Credits ๐136137Powered by [Stockfish](https://stockfishchess.org/), the chess engine that's stronger than both of us combined. Created by people who actually understand chess, unlike this wrapper.138139Thanks to:140141- The [Stockfish team](https://github.com/official-stockfish/Stockfish) for making chess engines that don't suck142- [MCP SDK for Go](https://github.com/mark3labs/mcp-go) for handling the protocol so I don't have to143- Coffee144145## License146147MIT - Do whatever you want, just don't blame me when it breaks.148
Full transparency โ inspect the skill content before installing.