mcp-stockfish

mcp-stockfish

A Model Context Protocol server that connects AI systems to the Stockfish chess engine.

4
Stars
5
Forks
4
Watchers
1
Issues
mcp-stockfish provides a server implementing the Model Context Protocol (MCP) to enable seamless integration between AI models and the Stockfish chess engine. It supports multiple concurrent sessions, full UCI command support, and offers both stdio and HTTP server modes. Built for robust, concurrent usage, it handles session and command management, exposes a JSON-based API response, and offers Docker support for easy deployment.

Key Features

Model Context Protocol (MCP) server implementation
Full UCI (Universal Chess Interface) command support
Concurrent session management with configurable limits
JSON-based API responses
Supports both stdio and HTTP server modes
Customizable Stockfish binary path
Containerized deployment with Docker
Session and command timeouts
Configurable logging system
Handles multi-instance Stockfish analysis

Use Cases

Integrating chess analysis into AI assistants or large language models
Automating multi-session chess position evaluations for research
Building web or desktop tools leveraging Stockfish via standardized protocol
Batch chess puzzle solving or annotation workflows
Running scalable chess analysis in cloud environments
Concurrent analysis of multiple chess games or engines
Custom UCI command automation for advanced chess applications
Enabling LLMs to interface with a chess engine via a structured protocol
Developing chess tutoring or commentary bots
Rapid prototyping of chess-based AI integrations

README

mcp-stockfish 🐟

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.

Claude Desktop with mcp-stockfish

🧠⚡🖥️ Your LLM thinks, Stockfish calculates, you pretend you understand the resulting 15-move tactical sequence.

What is this?

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 figuring out why your knight is hanging.

Built on mark3labs/mcp-go. Because reinventing wheels is for people with too much time.

Features

  • 🔄 Concurrent Sessions: Run multiple Stockfish instances without your CPU crying
  • ⚡ Full UCI Support: All the commands you need, none of the ones you don't
  • 🎯 Actually Works: Unlike your last side project, this one has proper error handling
  • 📊 JSON Everything: Because apparently we can't just use plain text anymore
  • 🐳 Docker Ready: Containerized for when you inevitably break your local setup

Supported UCI Commands ♟️

Command Description
uci Initializes the engine in UCI mode
isready Checks if the engine is ready. Returns readyok
position startpos Sets up the board to the starting position
position fen [FEN] Sets up a position using FEN notation
go Starts the engine to compute the best move
go depth [n] Searches n plies deep. Example: go depth 10
go movetime [ms] Thinks for a fixed amount of time in milliseconds. Example: go movetime 1000
stop Stops current search
quit Closes the session

Quick Start

Installation

bash
git clone https://github.com/sonirico/mcp-stockfish
cd mcp-stockfish
make install

Usage

bash
# Default mode (stdio, because we're old school)
mcp-stockfish

# With custom Stockfish path (for the special snowflakes)
MCP_STOCKFISH_PATH=/your/special/stockfish mcp-stockfish

# HTTP mode (for the web-scale crowd)
MCP_STOCKFISH_SERVER_MODE=http mcp-stockfish

Configuration ⚙️

Environment Variables

Server Configuration

  • MCP_STOCKFISH_SERVER_MODE: "stdio" or "http" (default: "stdio")
  • MCP_STOCKFISH_HTTP_HOST: HTTP host (default: "localhost")
  • MCP_STOCKFISH_HTTP_PORT: HTTP port (default: 8080)

Stockfish 🐟 Configuration

  • MCP_STOCKFISH_PATH: Path to Stockfish binary (default: "stockfish")
  • MCP_STOCKFISH_MAX_SESSIONS: Max concurrent sessions (default: 10)
  • MCP_STOCKFISH_SESSION_TIMEOUT: Session timeout (default: "30m")
  • MCP_STOCKFISH_COMMAND_TIMEOUT: Command timeout (default: "30s")

Logging

  • MCP_STOCKFISH_LOG_LEVEL: debug, info, warn, error, fatal
  • MCP_STOCKFISH_LOG_FORMAT: json, console
  • MCP_STOCKFISH_LOG_OUTPUT: stdout, stderr

Tool Parameters

  • command: UCI command to execute
  • session_id: Session ID (optional, we'll make one up if you don't)

Response Format

json
{
  "status": "success|error", 
  "session_id": "some-uuid",
  "command": "what you asked for",
  "response": ["what stockfish said"],
  "error": "what went wrong (if anything)"
}

Session Management

Sessions do what you'd expect:

  • Spawn Stockfish processes on demand
  • Keep UCI state between commands
  • Clean up when you're done (or when they timeout)
  • Enforce limits so you don't fork-bomb yourself

Integration

Claude Desktop

json
{
  "mcpServers": {
    "chess": {
      "command": "mcp-stockfish",
      "env": {
        "MCP_STOCKFISH_LOG_LEVEL": "info"
      }
    }
  }
}

Development

bash
make deps     # Get dependencies
make build    # Build the thing
make test     # Run tests (when they exist)
make fmt      # Make it pretty

Credits 🐟

Powered by Stockfish, the chess engine that's stronger than both of us combined. Created by people who actually understand chess, unlike this wrapper.

Thanks to:

License

MIT - Do whatever you want, just don't blame me when it breaks.

Star History

Star History Chart

Repository Owner

sonirico
sonirico

User

Repository Details

Language Go
Default Branch master
Size 155 KB
Contributors 1
License MIT License
MCP Verified Nov 12, 2025

Programming Languages

Go
83.02%
Makefile
13.13%
Dockerfile
3.85%

Tags

Topics

ai chess go golang mcp mcp-server mcp-server-golang model-context-protocol model-context-protocol-server stockfish

Join Our Newsletter

Stay updated with the latest AI tools, news, and offers by subscribing to our weekly newsletter.

We respect your privacy. Unsubscribe at any time.

Related MCPs

Discover similar Model Context Protocol servers

  • MCP Tic-Tac-Toe

    MCP Tic-Tac-Toe

    A Model Context Protocol server for playing and analyzing tic-tac-toe games through standardized tool interfaces.

    MCP Tic-Tac-Toe is a server implementation that provides a complete set of MCP tools for playing, managing, and analyzing tic-tac-toe games. It supports interactions with AI assistants such as Claude, enabling features like creating multiple parallel sessions, making moves, providing strategic analysis, and managing game context. The server is designed for easy integration with clients through various transport methods, including stdio and SSE, and supports seamless AI-human collaboration.

    • 2
    • MCP
    • tomholford/mcp-tic-tac-toe
  • ws-mcp

    ws-mcp

    WebSocket bridge for MCP stdio servers.

    ws-mcp wraps Model Context Protocol (MCP) stdio servers with a WebSocket interface, enabling seamless integration with web-based clients and tools. It allows users to configure and launch multiple MCP servers via a flexible configuration file or command-line arguments. The tool is designed to be compatible with services such as wcgw, fetch, and other MCP-compliant servers, providing standardized access to system operations, HTTP requests, and more. Integration with tools like Kibitz enables broader applications in model interaction workflows.

    • 19
    • MCP
    • nick1udwig/ws-mcp
  • MCP Zotero

    MCP Zotero

    Model Context Protocol server for seamless Zotero integration with AI tools.

    MCP Zotero provides a Model Context Protocol server enabling AI models such as Claude to access and interact with Zotero libraries. Users can securely link their Zotero accounts and perform actions including listing collections, retrieving papers, searching the library, and getting details about specific items. Integration is designed for both standalone operation and as an extension for tools like Claude Desktop.

    • 137
    • MCP
    • kaliaboi/mcp-zotero
  • mcp-server-chatsum

    mcp-server-chatsum

    Summarize and query chat messages using the MCP Server protocol.

    mcp-server-chatsum is an MCP Server designed to summarize and query chat messages. It provides tools to interact with chat data, enabling users to extract and summarize message content based on specified prompts. The server can be integrated with Claude Desktop and supports communication over stdio, offering dedicated debugging tools via the MCP Inspector. Environment variable support and database integration ensure flexible deployment for chat data management.

    • 1,024
    • MCP
    • chatmcp/mcp-server-chatsum
  • Graphlit MCP Server

    Graphlit MCP Server

    Integrate and unify knowledge sources for RAG-ready AI context with the Graphlit MCP Server.

    Graphlit MCP Server provides a Model Context Protocol interface, enabling seamless integration between MCP clients and the Graphlit platform. It supports ingestion from a wide array of sources such as Slack, Discord, Google Drive, email, Jira, and GitHub, turning them into a searchable, RAG-ready knowledge base. Built-in tools allow for document, media extraction, web crawling, and web search, as well as advanced retrieval and publishing functionalities. The server facilitates easy configuration, sophisticated data operations, and automated notifications for diverse workflows.

    • 369
    • MCP
    • graphlit/graphlit-mcp-server
  • mcp-log-proxy

    mcp-log-proxy

    Web-based proxy for inspecting Model Context Protocol traffic in real time.

    mcp-log-proxy enables users to observe and debug messages exchanged between MCP clients and servers through a user-friendly web interface. It supports the STDIO interface and can operate multiple proxy instances, each accessible via a web dashboard. The tool allows customization of ports, web page titles, and log file locations, making it suitable for managing and troubleshooting MCP-based model communication. Installation is straightforward via Homebrew or Go, and it supports real-time switching between different running proxies.

    • 26
    • MCP
    • emicklei/mcp-log-proxy
  • Didn't find tool you were looking for?

    Be as detailed as possible for better results