Navigation
Lichess MCP: Strategize & Dominate Chess Battles - MCP Implementation

Lichess MCP: Strategize & Dominate Chess Battles

Lichess MCP: Command chess like a pro—play, analyze, manage, and conquer tournaments by simply chatting with Claude. Your strategy, spoken. ♟️

Research And Data
4.2(63 reviews)
94 saves
44 comments

Ranked in the top 7% of all AI tools in its category

About Lichess MCP

What is Lichess MCP: Strategize & Dominate Chess Battles?

Lichess MCP is a dedicated interface for integrating the Lichess chess platform with AI-driven tools like Claude Desktop. It enables users to interact programmatically with Lichess features, including game management, profile access, and strategic analysis. Built on the Model Context Protocol (MCP), this server empowers chess enthusiasts to automate workflows, analyze gameplay, and enhance their competitive edge through seamless AI integration.

How to Use Lichess MCP: Strategize & Dominate Chess Battles?

  1. Install Dependencies: Clone the repository and install Node.js dependencies via `npm install`.
  2. Configure Token: Set up a `.env` file with your Lichess API token for authentication.
  3. Global Installation: Deploy the server globally using `npm install -g` for Claude Desktop compatibility.
  4. Integrate with Claude: Modify the Claude Desktop configuration to link the MCP server, specifying environment variables.
  5. Execute Commands: Interact via natural language queries like "Analyze my recent games" or "Challenge opponent with 5+0 time control."

Lichess MCP Features

Key Features of Lichess MCP: Strategize & Dominate Chess Battles?

  • End-to-End Automation: Automate game creation, analysis, and opponent challenges without manual intervention.
  • AI-Driven Strategy: Leverage Claude's language models to interpret gameplay data and suggest tactical improvements.
  • Multi-Platform Support: Cross-platform functionality for macOS, Windows, and Linux environments.
  • Diagnostic Logging: Built-in debug capabilities for troubleshooting API token issues or connectivity failures.
  • Modular Integration: Seamlessly combine with other MCP servers (e.g., file systems) for holistic workflow management.

Use Cases of Lichess MCP: Strategize & Dominate Chess Battles?

  • Tournament Preparation: Simulate opponent strategies and analyze historical matches to refine gameplay.
  • Real-Time Analysis: Get instant feedback on live games using AI-powered move suggestions.
  • Batch Processing: Automatically archive or analyze multiple games at scale for statistical insights.
  • Competitive Edge: Programmatic access to Lichess features enables faster decision-making during timed matches.
  • Education & Coaching: Create interactive learning modules using Lichess's vast dataset of ranked games.

Lichess MCP FAQ

FAQ from Lichess MCP: Strategize & Dominate Chess Battles?

Q: How do I generate a valid Lichess API token?
A: Access your Lichess account settings, navigate to the "Applications" tab, and generate an API access token with appropriate permissions.
Q: Why does my MCP server fail to start?
A: Ensure global installation via `npm install -g` and verify the `.env` file contains a correctly formatted `LICHESS_TOKEN`.
Q: Can I use this with chess engines like Stockfish?
A: While Lichess MCP focuses on API integration, external engines can be combined through custom script workflows.
Q: What query formats work with Claude Desktop?
A: Use natural language commands like "Show my top 10 opponents by rating" or "Annotate game ID 12345678."
Q: Is there rate limiting for API requests?
A: Lichess enforces standard API rate limits; see official documentation for details.

Content

Lichess MCP

Speak to Lichess in natural language to interact with the chess platform. Use it with Claude Desktop to play games, analyze positions, and manage your chess activities.

Built using the Model Context Protocol.

Lichess MCP server

The server enables:

  • Managing your Lichess account
  • Playing chess games and challenges
  • Analyzing positions and games
  • Joining tournaments and teams
  • Interacting with other players

Configuration

The Lichess API token can be set in two ways:

  1. Environment variables: Add it to your .env file in the project root or set it directly:

    LICHESS_TOKEN=your-lichess-api-token

  2. Using the set_token tool during runtime:

    set_token({
    token: "your-lichess-api-token"

});

The token can be generated at https://lichess.org/account/oauth/token

Available Tools

1. Account Management

// Set your Lichess API token
set_token({
  token: "your-lichess-api-token"
});

// Get your Lichess profile
get_my_profile();

// Get another user's profile
get_user_profile({
  username: "player_name",
  trophies: true  // include trophies, optional
});

2. Game Play

// Create a challenge against another player
create_challenge({
  username: "opponent_username",
  timeControl: "10+0",  // 10 minutes, no increment
  color: "random"       // or "white", "black"
});

// Make a move in a game
make_move({
  gameId: "abcd1234",
  move: "e2e4",
  offeringDraw: false
});

// Get your ongoing games
get_ongoing_games({
  nb: 10  // number of games to fetch
});

3. Game Analysis

// Export a game in PGN format
export_game({
  gameId: "abcd1234",
  clocks: true,
  evals: true
});

// Get cloud evaluation for a position
get_cloud_eval({
  fen: "rnbqkbnr/ppp1pppp/8/3p4/4P3/8/PPPP1PPP/RNBQKBNR w KQkq - 0 2"
});

4. Tournaments

// List current tournaments
get_arena_tournaments();

// Join a tournament
join_arena({
  tournamentId: "abc123"
});

// Create a new tournament
create_arena({
  name: "My Tournament",
  clockTime: 3,
  clockIncrement: 2,
  minutes: 45
});

Chess Notation

Move Formats

The Lichess API accepts moves in these formats:

  • UCI : Universal Chess Interface format (e.g., e2e4, g8f6)
  • SAN : Standard Algebraic Notation (e.g., e4, Nf6) - only for some endpoints

FEN Format

The Forsyth-Edwards Notation (FEN) is used to represent chess positions:

rnbqkbnr/pppppppp/8/8/8/8/PPPPPPPP/RNBQKBNR w KQkq - 0 1

This represents:

  • Piece positions (from 8th rank to 1st rank)
  • Active color (w/b)
  • Castling availability (KQkq)
  • En passant target square
  • Halfmove clock
  • Fullmove number

Error Handling

The server provides detailed error messages for:

  • Invalid moves or positions
  • Authentication issues
  • Rate limits
  • Resource not found cases

Setup Instructions

  1. Clone the repository:

    git clone https://github.com/karayaman/lichess-mcp.git

cd lichess-mcp
  1. Install dependencies:

    npm install

  2. Configure environment variables: Create a .env file in the root directory:

    LICHESS_TOKEN=your-lichess-api-token

  3. Build the project:

    npm run build

  4. Install the package globally (recommended for Claude Desktop integration):

    npm install -g

  5. Start the server (for standalone usage):

    npm start

Configuring Claude Desktop

To use this MCP server with Claude Desktop:

  1. Locate your Claude Desktop configuration file:
* macOS: `~/Library/Application Support/Claude/claude_desktop_config.json`
* Windows: `%APPDATA%\Claude\claude_desktop_config.json`
* Linux: `~/.config/Claude/claude_desktop_config.json`
  1. Add the Lichess MCP server to your configuration:

    {
    "mcpServers": {
    "lichess": {
    "command": "lichess-mcp",
    "env": {
    "LICHESS_TOKEN": "your-lichess-api-token",
    "DEBUG": "*"
    }
    }
    }

}

Note: Replace your-lichess-api-token with your actual Lichess API token. The DEBUG environment variable is optional but helpful for troubleshooting.

  1. (Optional) You can add other MCP servers as well:

    {
    "mcpServers": {
    "filesystem": {
    "command": "npx",
    "args": [
    "-y",
    "@modelcontextprotocol/server-filesystem",
    "/Users/username/Desktop",
    "/Users/username/Downloads"
    ]
    },
    "lichess": {
    "command": "lichess-mcp",
    "env": {
    "LICHESS_TOKEN": "your-lichess-api-token"
    }
    }
    }

}
  1. Restart Claude Desktop to apply the changes.
* Make sure to completely close Claude Desktop (including from the system tray/menu bar)
* Launch Claude Desktop again
* Look for a hammer icon in the interface, which indicates that MCP servers are connected
  1. Test the integration by asking Claude about your Lichess account:
* "Show me my Lichess profile"
* "Start a new chess game with 10 minutes time control"

Troubleshooting

If you encounter issues with the MCP server connection:

  1. Ensure you've installed the package globally with npm install -g
  2. Verify that the lichess-mcp command is available in your PATH (which lichess-mcp)
  3. Check that your configuration file has the correct format (the newer mcpServers format instead of mcp_servers)
  4. Restart Claude Desktop completely
  5. Try enabling Developer Mode in Claude Desktop (if available) for additional logging
  6. Verify your Lichess API token is valid

References

Related MCP Servers & Clients