Lichess MCP
一个 MCP 服务器,它支持与 Lichess 国际象棋平台进行自然语言交互,允许用户通过 Claude 来下棋、分析棋局、管理账户以及参与比赛。
Tools
unblock_user
Unblock a user
get_user_profile
Get a user's Lichess profile information
get_my_email
Get your email address
get_kid_mode
Get kid mode status
set_kid_mode
Set kid mode status
create_challenge
Create a new challenge
set_token
Set your Lichess API token
get_my_profile
Get your Lichess profile information
make_move
Make a move in an ongoing game
get_preferences
Get your preferences
get_timeline
Get your timeline
test_tokens
Test multiple OAuth tokens
revoke_token
Revoke the current access token
upgrade_to_bot
Upgrade to Bot account. WARNING: This is irreversible and the account must not have played any games.
add_user_note
Add a private note about a user
send_message
Send a private message to another player
get_following
Get users followed by the logged in user
follow_user
Follow a player
unfollow_user
Unfollow a player
block_user
Block a player
get_users_status
Get real-time users status
get_all_top_10
Get the top 10 players for each speed and variant
get_leaderboard
Get the leaderboard for a single speed or variant
get_user_public_data
Get public data of a user
get_rating_history
Get rating history of a user for all perf types
get_user_performance
Get performance statistics of a user
get_user_activity
Get activity feed of a user
get_users_by_id
Get multiple users by their IDs
export_game
Export one game in PGN or JSON format
export_ongoing_game
Export ongoing game of a user
export_user_games
Export all games of a user
export_games_by_ids
Export multiple games by IDs
get_tv_channels
Get all TV channels and their current games
get_tv_game
Get current TV game in PGN format
get_puzzle_activity
Get your puzzle activity
get_puzzle_dashboard
Get your puzzle dashboard
get_puzzle_race
Get info about a puzzle race
create_puzzle_race
Create a puzzle race
get_puzzle_storm_dashboard
Get your puzzle storm dashboard
get_team_info
Get team information by ID
get_team_members
Get members of a team
get_team_join_requests
Get join requests for a team
join_team
Join a team
leave_team
Leave a team
kick_user_from_team
Kick a user from your team
accept_join_request
Accept a join request for your team
decline_join_request
Decline a join request for your team
search_teams
Search for teams
make_board_move
Make a move in a board game
abort_board_game
Abort a board game
resign_board_game
Resign a board game
write_in_chat
Write in the chat of a board game
handle_draw_board_game
Handle draw offers for a board game
claim_victory
Claim victory if opponent abandoned the game
list_challenges
List incoming and outgoing challenges
README
Lichess MCP
使用自然语言与 Lichess 交互,从而与该国际象棋平台互动。将其与 Claude Desktop 结合使用,可以进行对弈、分析局面以及管理您的国际象棋活动。
基于 Model Context Protocol 构建。
<a href="https://glama.ai/mcp/servers/x7iuw37s1v"> <img width="380" height="200" src="https://glama.ai/mcp/servers/x7iuw37s1v/badge" alt="Lichess MCP server" /> </a>
该服务器支持:
- 管理您的 Lichess 帐户
- 进行国际象棋对弈和挑战
- 分析局面和棋局
- 加入比赛和团队
- 与其他玩家互动
配置
Lichess API 令牌可以通过两种方式设置:
-
环境变量:将其添加到项目根目录下的
.env
文件中,或直接设置:LICHESS_TOKEN=your-lichess-api-token
-
在运行时使用
set_token
工具:set_token({ token: "your-lichess-api-token" });
令牌可以在 https://lichess.org/account/oauth/token 生成。
可用工具
1. 帐户管理
// 设置您的 Lichess API 令牌
set_token({
token: "your-lichess-api-token"
});
// 获取您的 Lichess 个人资料
get_my_profile();
// 获取另一个用户的个人资料
get_user_profile({
username: "player_name",
trophies: true // 包含奖杯,可选
});
2. 游戏对弈
// 向另一位玩家发起挑战
create_challenge({
username: "opponent_username",
timeControl: "10+0", // 10 分钟,无增时
color: "random" // 或 "white", "black"
});
// 在游戏中走一步棋
make_move({
gameId: "abcd1234",
move: "e2e4",
offeringDraw: false
});
// 获取您正在进行的游戏
get_ongoing_games({
nb: 10 // 要获取的游戏数量
});
3. 棋局分析
// 以 PGN 格式导出游戏
export_game({
gameId: "abcd1234",
clocks: true,
evals: true
});
// 获取位置的云评估
get_cloud_eval({
fen: "rnbqkbnr/ppp1pppp/8/3p4/4P3/8/PPPP1PPP/RNBQKBNR w KQkq - 0 2"
});
4. 比赛
// 列出当前的比赛
get_arena_tournaments();
// 加入比赛
join_arena({
tournamentId: "abc123"
});
// 创建新的比赛
create_arena({
name: "My Tournament",
clockTime: 3,
clockIncrement: 2,
minutes: 45
});
国际象棋记谱法
走法格式
Lichess API 接受以下格式的走法:
- UCI: 通用国际象棋界面格式 (例如,
e2e4
,g8f6
) - SAN: 标准代数记谱法 (例如,
e4
,Nf6
) - 仅适用于某些端点
FEN 格式
Forsyth-Edwards 记谱法 (FEN) 用于表示国际象棋局面:
rnbqkbnr/pppppppp/8/8/8/8/PPPPPPPP/RNBQKBNR w KQkq - 0 1
这表示:
- 棋子位置(从第 8 行到第 1 行)
- 主动方颜色 (w/b)
- 易位可用性 (KQkq)
- 吃过路兵目标格
- 半步数
- 完整步数
错误处理
服务器提供详细的错误消息,用于:
- 无效的走法或局面
- 身份验证问题
- 速率限制
- 找不到资源的情况
安装说明
-
克隆存储库:
git clone https://github.com/karayaman/lichess-mcp.git cd lichess-mcp
-
安装依赖项:
npm install
-
配置环境变量: 在根目录中创建一个
.env
文件:LICHESS_TOKEN=your-lichess-api-token
-
构建项目:
npm run build
-
全局安装软件包(推荐用于 Claude Desktop 集成):
npm install -g
-
启动服务器(用于独立使用):
npm start
配置 Claude Desktop
要将此 MCP 服务器与 Claude Desktop 结合使用:
-
找到您的 Claude Desktop 配置文件:
- macOS:
~/Library/Application Support/Claude/claude_desktop_config.json
- Windows:
%APPDATA%\Claude\claude_desktop_config.json
- Linux:
~/.config/Claude/claude_desktop_config.json
- macOS:
-
将 Lichess MCP 服务器添加到您的配置中:
{ "mcpServers": { "lichess": { "command": "lichess-mcp", "env": { "LICHESS_TOKEN": "your-lichess-api-token", "DEBUG": "*" } } } }
注意:将
your-lichess-api-token
替换为您实际的 Lichess API 令牌。DEBUG
环境变量是可选的,但有助于进行故障排除。 -
(可选) 您也可以添加其他 MCP 服务器:
{ "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" } } } }
-
重新启动 Claude Desktop 以应用更改。
- 确保完全关闭 Claude Desktop(包括从系统托盘/菜单栏中关闭)
- 再次启动 Claude Desktop
- 在界面中查找锤子图标,表示 MCP 服务器已连接
-
通过询问 Claude 关于您的 Lichess 帐户来测试集成:
- "Show me my Lichess profile"
- "Start a new chess game with 10 minutes time control"
故障排除
如果您遇到 MCP 服务器连接问题:
- 确保您已使用
npm install -g
全局安装了该软件包 - 验证
lichess-mcp
命令在您的 PATH 中是否可用 (which lichess-mcp
) - 检查您的配置文件是否具有正确的格式(较新的
mcpServers
格式而不是mcp_servers
) - 完全重新启动 Claude Desktop
- 尝试在 Claude Desktop 中启用开发者模式(如果可用)以获取其他日志记录
- 验证您的 Lichess API 令牌是否有效
参考
推荐服务器
steam
Okay, I understand. As a large language model, I don't "play" games in the same way a human does. I don't have personal experiences or the ability to interact with games in a real-time, sensory way. However, I *can* be used to process and analyze game-related information. Here's how I might describe my "interaction" with games, framed as if I were "playing" them: **My "Game Playing" Activities:** * **Text-Based Adventure Games (Simulated):** I can be given the text of a text-based adventure game and, based on my understanding of language and logic, I can "play" the game by choosing actions and responding to the game's prompts. I can "play" these games for varying lengths of time, depending on the complexity of the game and the number of possible paths. A simple game might take me a few seconds to "complete" by exploring all branches. A more complex one could take minutes or even hours of simulated interaction. * **Game Script Analysis:** I can analyze game scripts, dialogue, and lore. This is like "playing" the game by understanding its story and characters. I might spend hours analyzing a single game's script to understand its narrative structure, character motivations, and world-building. * **Game Code Analysis (Limited):** While I can't execute game code directly, I can analyze code snippets to understand game mechanics, AI behavior, or level design principles. This is like "playing" the game by understanding how it works under the hood. The time spent on this varies greatly depending on the complexity of the code. * **Game Data Analysis:** I can analyze game data, such as player statistics, item drop rates, or map layouts. This is like "playing" the game by understanding its systems and balance. I might spend hours analyzing a dataset to identify trends or patterns. * **Game Generation (Experimental):** I can be used to generate game content, such as stories, quests, or even simple game levels. This is like "playing" the game by creating it. The time spent on this depends on the complexity of the generation task. * **Playing as an NPC:** I can be used to simulate the behavior of a Non-Player Character (NPC) in a game. I can respond to player actions and provide information or quests. The "playtime" here is determined by the length of the interaction. **Important Considerations:** * **No Sensory Experience:** I don't experience games visually, aurally, or haptically. My understanding is purely based on the text and data I process. * **No True Agency:** I don't have my own goals or desires when "playing" a game. I simply follow the instructions and logic provided to me. * **Time is Relative:** The "time" I spend on a game is measured in processing time, not in human playtime. A task that takes a human hours might take me only seconds or minutes. **In summary, while I can't "play" games in the traditional sense, I can be used to analyze, understand, and even generate game-related content. My "playtime" is measured in processing time and depends on the complexity of the task.** --- **Translation to Chinese:** 好的,我明白了。 作为一个大型语言模型,我“玩”游戏的方式与人类不同。 我没有个人经历,也没有能力以实时、感官的方式与游戏互动。 但是,我*可以*用来处理和分析与游戏相关的信息。 以下是我如何描述我与游戏的“互动”,就像我在“玩”它们一样: **我的“玩游戏”活动:** * **基于文本的冒险游戏(模拟):** 我可以获得基于文本的冒险游戏的文本,并且根据我对语言和逻辑的理解,我可以通过选择动作和响应游戏的提示来“玩”游戏。 我可以“玩”这些游戏的时间长短不一,具体取决于游戏的复杂程度和可能的路径数量。 一个简单的游戏可能需要我几秒钟的时间来通过探索所有分支来“完成”。 一个更复杂的游戏可能需要几分钟甚至几个小时的模拟互动。 * **游戏脚本分析:** 我可以分析游戏脚本、对话和背景故事。 这就像通过理解游戏的故事和角色来“玩”游戏。 我可能会花费数小时分析单个游戏的脚本,以了解其叙事结构、角色动机和世界构建。 * **游戏代码分析(有限):** 虽然我不能直接执行游戏代码,但我可以分析代码片段以了解游戏机制、人工智能行为或关卡设计原则。 这就像通过了解游戏的工作原理来“玩”游戏。 在这上面花费的时间差异很大,具体取决于代码的复杂程度。 * **游戏数据分析:** 我可以分析游戏数据,例如玩家统计数据、物品掉落率或地图布局。 这就像通过了解游戏的系统和平衡来“玩”游戏。 我可能会花费数小时分析数据集以识别趋势或模式。 * **游戏生成(实验性):** 我可以用来生成游戏内容,例如故事、任务,甚至简单的游戏关卡。 这就像通过创建游戏来“玩”游戏。 在这上面花费的时间取决于生成任务的复杂程度。 * **扮演NPC:** 我可以用来模拟游戏中非玩家角色 (NPC) 的行为。 我可以回应玩家的动作并提供信息或任务。 这里的“游戏时间”由互动的长度决定。 **重要考虑事项:** * **没有感官体验:** 我不会在视觉、听觉或触觉上体验游戏。 我的理解完全基于我处理的文本和数据。 * **没有真正的自主性:** 我在“玩”游戏时没有自己的目标或愿望。 我只是按照提供给我的指示和逻辑进行操作。 * **时间是相对的:** 我在游戏上花费的“时间”是以处理时间来衡量的,而不是以人类的游戏时间来衡量的。 人类需要花费数小时的任务可能只需要我几秒钟或几分钟。 **总而言之,虽然我不能以传统意义上的“玩”游戏,但我可以用来分析、理解甚至生成与游戏相关的内容。 我的“游戏时间”以处理时间来衡量,并取决于任务的复杂程度。**
Chess Analysis Assistant
使用 Stockfish 帮助您分析国际象棋局面并获得专业评估。

mcp-minecraft
允许人工智能模型通过一个机器人来观察和与 Minecraft 世界互动。
Minecraft Docker MCP
允许AI通过RCON与Docker容器内运行的Minecraft服务器进行交互,从而使模型能够以编程方式创建Minecraft建筑并管理服务器。
OpenDota MCP Server
模型上下文协议服务器,它使大型语言模型和人工智能助手能够通过标准化接口检索实时的 Dota 2 统计数据、比赛数据、玩家信息和游戏指标。

WebGL-MCP Server
一个模型上下文协议服务器,提供分析和优化 WebGL 游戏的一系列工具,包括性能洞察、内存使用分析以及特定于模板的优化建议。