Lichess MCP
Interact with the Lichess chess platform using natural language.
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.
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:
-
Environment variables: Add it to your
.envfile in the project root or set it directly:LICHESS_TOKEN=your-lichess-api-token -
Using the
set_tokentool 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
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
-
Clone the repository:
git clone https://github.com/karayaman/lichess-mcp.git cd lichess-mcp -
Install dependencies:
npm install -
Configure environment variables: Create a
.envfile in the root directory:LICHESS_TOKEN=your-lichess-api-token -
Build the project:
npm run build -
Install the package globally (recommended for Claude Desktop integration):
npm install -g -
Start the server (for standalone usage):
npm start
Configuring Claude Desktop
To use this MCP server with Claude Desktop:
-
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
- macOS:
-
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-tokenwith your actual Lichess API token. TheDEBUGenvironment variable is optional but helpful for troubleshooting. -
(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" } } } } -
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
-
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:
- Ensure you've installed the package globally with
npm install -g - Verify that the
lichess-mcpcommand is available in your PATH (which lichess-mcp) - Check that your configuration file has the correct format (the newer
mcpServersformat instead ofmcp_servers) - Restart Claude Desktop completely
- Try enabling Developer Mode in Claude Desktop (if available) for additional logging
- Verify your Lichess API token is valid
References
Serveurs connexes
mcp-cli-catalog
An MCP server that publishes CLI tools on your machine for discoverability by LLMs
Learning Hub
AI learning assistant that manages game time rewards based on school grades, homework, and bonus tasks
Bazi Calculation
A professional Bazi (Chinese astrology) calculation server providing full analysis including four pillars, five elements, zodiac, and lunar dates with timezone support.
Medialister
Gateway to editorial ads
Crypto Price & Market Analysis (JJ Fork)
Provides real-time cryptocurrency price data, market analysis, and historical trends using the CoinCap API.
Ingero
eBPF-based GPU causal observability agent with MCP server. Traces CUDA Runtime/Driver APIs via uprobes and host kernel events via tracepoints to build causal chains explaining GPU latency. 7 MCP tools for AI-assisted GPU debugging and root cause analysis. <2% overhead, production-safe.
Natural Disaster Intel MCP
FEMA disaster declarations, NOAA severe weather alerts, and USGS earthquake data. 4 MCP tools for real-time disaster monitoring.
Search Movie
一个基于 Model Context Protocol (MCP) 构建的智能电影和电视剧资源搜索工具,支持多源搜索和链接验证。An intelligent movie and TV series resource search tool based on Model Context Protocol (MCP), supporting multi-source search and link verification.
GuanXing (观星) — Chinese Metaphysics AI Tools
MCP server for AI-powered Chinese metaphysics — BaZi (八字), Tarot, I-Ching, Feng Shui, fortune telling, dream interpretation, and more. 12 tools for spiritual exploration.
sapient-mcp
MCP toAutomate SAP GUI