SuperAPIAI Directory

mcp-stockfish

github.com · AI developer platforms

Access the Stockfish chess engine.

Open website Alternatives
PricingOpen source开源项目(可免费自部署)
PlatformsLinux

About this tool

mcp-stockfish is an MCP (Model Context Protocol) server designed to enable AI systems to communicate with the Stockfish chess engine. It establishes a bridge between AI and Stockfish through the MCP protocol, allowing AI to invoke Stockfish's chess calculation capabilities.

Purpose

The main purpose of this project is to enable AI systems (such as LLMs) to access the Stockfish chess engine for tasks such as game analysis and move calculation. The AI is responsible for thinking, and Stockfish is responsible for precise calculation.

Main Capabilities

  • Concurrent sessions: Supports running multiple Stockfish instances simultaneously, can handle multiple concurrent analysis requests, with a default maximum number of sessions of 10.
  • Full UCI support: Provides support for all required UCI commands.
  • Error handling: Has appropriate error handling mechanisms to ensure stable operation.
  • JSON responses: All responses use JSON format.
  • Docker ready: Provides containerized deployment support for environment isolation and quick startup.

Usage

This project is built on mark3labs/mcp-go and can be configured through environment variables:

  • MCP_STOCKFISH_SERVER_MODE: server mode, optional "stdio" or "http", default "stdio".
  • MCP_STOCKFISH_HTTP_HOST: HTTP host address, default "localhost".
  • MCP_STOCKFISH_HTTP_PORT: HTTP port, default 8080.
  • MCP_STOCKFISH_PATH: Stockfish binary file path, default "stockfish".
  • MCP_STOCKFISH_MAX_SESSIONS: maximum number of concurrent sessions, default 10.
  • MCP_STOCKFISH_SESSION_TIMEOUT: session timeout, default "30m".
  • MCP_STOCKFISH_COMMAND_TIMEOUT: command timeout, default "30s".
  • MCP_STOCKFISH_LOG_LEVEL: log level, optional debug, info, warn, error, fatal.
  • MCP_STOCKFISH_LOG_FORMAT: log format, optional json, console.
  • MCP_STOCKFISH_LOG_OUTPUT: log output location, optional stdout, stderr.

Tool parameters include:

  • command: the UCI command to execute.
  • session_id: session ID (optional, automatically generated if not provided).

Session management features include: spawning Stockfish processes on demand, maintaining UCI state between commands, cleanup after task completion (or cleanup on timeout), and limiting resources to prevent process explosion.

Applicable Scenarios

Suitable for scenarios that require integrating chess engine capabilities into AI systems, such as AI game analysis, position evaluation, move suggestions, etc. Supports multiple concurrent sessions, suitable for scenarios that require analyzing multiple chess games simultaneously.

Limitations

Depends on the Stockfish binary file and the MCP protocol environment. For specific features and usage details, refer to the project repository documentation; other limitations are not yet provided.

Up/Down to navigate · Enter to open · ESC to closeBrowse all tools