Lichess MCP

Lichess MCP

By karayaman GitHub

A Model Context Protocol (MCP) server that enables Claude Desktop to interact with Lichess chess platform through natural language. Play games, analyze positions, manage your account, and participate in tournaments—all by simply talking to Claude.

ai mcp
Overview

What is Lichess MCP?

Lichess MCP is a Model Context Protocol server that allows users to interact with the Lichess chess platform using natural language through Claude Desktop. Users can play games, analyze positions, manage their accounts, and participate in tournaments by simply speaking to Claude.

How to use Lichess MCP?

To use Lichess MCP, set up your Lichess API token and integrate it with Claude Desktop. You can then issue commands in natural language to manage your chess activities.

Key features of Lichess MCP?

  • Manage your Lichess account effortlessly.
  • Play chess games and challenges through voice commands.
  • Analyze chess positions and games with ease.
  • Join and create tournaments seamlessly.
  • Interact with other players using natural language.

Use cases of Lichess MCP?

  1. Playing chess games against friends or AI.
  2. Analyzing past games to improve skills.
  3. Managing chess tournaments and team activities.
  4. Accessing player profiles and statistics.

FAQ from Lichess MCP?

  • How do I set up my Lichess API token?

You can set it in your .env file or use the set_token tool during runtime.

  • Is Lichess MCP free to use?

Yes! Lichess MCP is free to use for everyone.

  • Can I use Lichess MCP without Claude Desktop?

No, Lichess MCP is designed to work with Claude Desktop for natural language interaction.

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
    
  2. Install dependencies:

    npm install
    
  3. Configure environment variables: Create a .env file in the root directory:

    LICHESS_TOKEN=your-lichess-api-token
    
  4. Build the project:

    npm run build
    
  5. Install the package globally (recommended for Claude Desktop integration):

    npm install -g
    
  6. 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
  2. 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.

  3. (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"
          }
        }
      }
    }
    
  4. 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
  5. 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

No tools information available.
School MCP
School MCP by 54yyyu

A Model Context Protocol (MCP) server for academic tools, integrating with Canvas and Gradescope platforms.

canvas mcp
View Details
repo-template
repo-template by loonghao

A Model Context Protocol (MCP) server for Python package intelligence, providing structured queries for PyPI packages and GitHub repositories. Features include dependency analysis, version tracking, and package metadata retrieval for LLM interactions.

-

google-calendar mcp
View Details
strava-mcp
strava-mcp by jeremysilva1098

MCP server for strava

strava mcp
View Details

Model Context Protocol (MCP) server implementation for Rhinoceros/Grasshopper integration, enabling AI models to interact with parametric design tools

grasshopper mcp
View Details

MCP configuration to connect AI agent to a Linux machine.

security mcp
View Details

AI assistant built with Streamlit, NVIDIA NIM (LLaMa 3.3:70B) / Ollama, and Model Control Protocol (MCP).

python mcp
View Details