Stockfish

🐟 MCP server connecting AI systems to Stockfish chess engine
  • go

8

GitHub Stars

go

Language

6 months ago

First Indexed

2 months ago

Catalog Refreshed

Documentation & install

Readme and setup notes from the catalogue, plus a client-ready config you can copy for your MCP host.

Installation

Add the following to your MCP client configuration file.

Configuration

View docs
{
  "mcpServers": {
    "sonirico-mcp-stockfish": {
      "command": "mcp-stockfish",
      "args": [],
      "env": {
        "MCP_STOCKFISH_PATH": "stockfish",
        "MCP_STOCKFISH_HTTP_HOST": "localhost",
        "MCP_STOCKFISH_HTTP_PORT": "8080",
        "MCP_STOCKFISH_LOG_LEVEL": "info",
        "MCP_STOCKFISH_LOG_FORMAT": "json",
        "MCP_STOCKFISH_LOG_OUTPUT": "stdout",
        "MCP_STOCKFISH_SERVER_MODE": "stdio",
        "MCP_STOCKFISH_MAX_SESSIONS": "10",
        "MCP_STOCKFISH_COMMAND_TIMEOUT": "30s",
        "MCP_STOCKFISH_SESSION_TIMEOUT": "30m"
      }
    }
  }
}

You can run a dedicated MCP server that bridges your AI system with Stockfish to analyze chess positions. It supports multiple concurrent sessions, full UCI command coverage, and JSON-based responses, making it practical to analyze several positions in parallel from an AI workflow.

How to use

You connect to the Stockfish MCP server from your MCP client and send UCI-style commands wrapped in the MCP JSON protocol. Start a session, set up the board with position startpos or a specific FEN, issue go commands to compute moves, and gracefully close the session when you’re done. The server keeps UCI state across commands and enforces session limits to prevent resource exhaustion. Use multiple concurrent sessions to analyze different positions or variations at the same time.

How to install

Prerequisites: you need a working Go toolchain (or the environment used to build the server) and, optionally, Docker if you prefer containerized runs. The server is built to run as an MCP server and exposes both stdio and HTTP modes.

Step-by-step setup and run are shown in the following commands.

Configuration and runtime behavior

Configure how the server runs by choosing stdio or HTTP mode. In stdio mode, you start the server so it communicates via standard input/output with your client. In HTTP mode, you expose a web API endpoint for your web-based tooling or orchestration layer. You can override the path to the Stockfish binary, set session and command timeouts, and tune logging to help diagnose issues in development or production.

Tools and capabilities

The server provides access to a complete set of UCI commands through the MCP interface. You can initialize the engine, check readiness, load positions, start searches, control depth or time, stop ongoing searches, and close sessions. The system is designed for concurrent sessions, robust error handling, and JSON-formatted responses for easy integration with AI workflows.

Security and reliability notes

When running HTTP mode, secure access to the endpoint and limit concurrent sessions to prevent abuse. Use timeouts and proper resource isolation in production. Log levels and formats can be tuned to monitor activity and diagnose issues without exposing sensitive data.

Available tools

uci

Initialize the engine in UCI mode so it can accept standard UCI commands.

isready

Check if the engine is ready; returns readyok when prepared to receive commands.

position_startpos

Set up the board in the starting position.

position_fen

Set up a specific position using a FEN string.

go

Start the engine to think and return the best move or principal variation.

go_depth

Search to a specified depth in plies.

go_movetime

Think for a fixed amount of time in milliseconds.

stop

Stop the current search.

quit

Terminate the session and exit.

Built by
VeilStrat
AI signals for GTM teams
© 2026 VeilStrat. All rights reserved.All systems operational
Stockfish MCP Server - sonirico/mcp-stockfish | VeilStrat