Lichess
About
Integrates with the Lichess chess platform to enable natural language-driven gameplay, analysis, and tournament participation through its API.
Details
- Author
- karayaman
- Repository
- karayaman/lichess-mcp
- GitHub stars
- 2
- Downloads
- 368
- License
- MIT License
- Categories
- Other, API, Community, Design, Developer Tools, AI, Infrastructure
Jump to
- Manage your Lichess account and view profiles
- Create challenges, make moves, and manage games
- Analyze positions with cloud evaluations and PGN export
- Join and create arena tournaments
- Interactive chess UIs: puzzles, game viewer, opening explorer (in supported clients)
Setting up with Highlight
This MCP is not yet compatible with Highlight’s one-click setup. However, you can still use it with Highlight by following these steps:
- Download and install Highlight from highlightai.com/download
- Navigate to the plugins tab and select "Add Custom Plugin"
-
Configure the plugin with the settings below
Plugin Name
LichessCommand (node, npx, python, etc.)lichess-mcpEnvironment-
DEBUG
* -
LICHESS_TOKEN
your-lichess-api-token
Please refer to the README for specific instructions on how to obtain API keys or other required environment variables.
-
DEBUG
- Enable "Start Automatically" if you want the plugin to start when Highlight launches
From the repository
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
To install Lichess Integration for Claude Desktop automatically via Smithery:
npx -y @smithery/cli install @karayaman/lichess-mcp --client claude
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
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"
set_token
Set your Lichess API token. Parameters: token (string)
get_my_profile
Get your Lichess profile.
get_user_profile
Get another user's profile. Parameters: username (string), trophies (optional boolean)
create_challenge
Create a challenge against another player. Parameters: username (string), timeControl (string), color (string)
make_move
Make a move in a game. Parameters: gameId (string), move (string), offeringDraw (boolean)
get_ongoing_games
Get your ongoing games. Parameters: nb (integer)
export_game
Export a game in PGN format. Parameters: gameId (string), clocks (boolean), evals (boolean)
get_cloud_eval
Get cloud evaluation for a position. Parameters: fen (string)
get_arena_tournaments
List current tournaments.
join_arena
Join a tournament. Parameters: tournamentId (string)
create_arena
Create a new tournament. Parameters: name (string), clockTime (integer), clockIncrement (integer), minutes (integer)
play_puzzle
Open today's daily puzzle (or a specific id) as an interactive solver. Parameters: puzzleId (string)
view_pgn
Step through a Lichess game or raw PGN with prev/next/play controls. Parameters: gameId (string) or pgn (string)
explore_openings
Walk the opening tree. Parameters: source (string)
Claude Desktop / Cursor
Paste into your MCP client config file to install this server.
{
"mcpServers": {
"lichess": {
"env": {
"DEBUG": "*",
"LICHESS_TOKEN": "your-lichess-api-token"
},
"args": [],
"command": "lichess-mcp"
}
}
}
Linux
{
"env": {
"DEBUG": "*",
"LICHESS_TOKEN": "your-lichess-api-token"
},
"args": [],
"command": "lichess-mcp"
}
Macos
{
"env": {
"DEBUG": "*",
"LICHESS_TOKEN": "your-lichess-api-token"
},
"args": [],
"command": "lichess-mcp"
}
Windows
{
"env": {
"DEBUG": "*",
"LICHESS_TOKEN": "your-lichess-api-token"
},
"args": [],
"command": "lichess-mcp"
}
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.
<a href="https://glama.ai/mcp/servers/x7iuw37s1v">
</a>
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
});
5. Interactive UIs (Claude Desktop)
These tools open a real chess board inside the chat — drag pieces, navigate
moves, and click through opening trees — using the MCP Apps
extension. In clients without UI support, each tool falls back to a
text response containing FEN/PGN/Lichess links.
// Open today's daily puzzle (or a specific id) as an interactive solver.
play_puzzle({ puzzleId: "Bmfot" });
// Step through a Lichess game or raw PGN with prev/next/play controls.
view_pgn({ gameId: "abcd1234" });
view_pgn({ pgn: "1. e4 e5 2. Nf3 ..." });
// Walk the opening tree: click moves to drill down; toggle masters/lichess.
explore_openings({ source: "masters" });
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
Installing via Smithery
To install Lichess Integration for Claude Desktop automatically via Smithery:
npx -y @smithery/cli install @karayaman/lichess-mcp --client claude
Manual Installation
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
Sign in to leave a review
Use Google, GitHub, or an email account so ratings stay tied to real people.
No reviews posted yet.




